public static class Gauge.Child extends Object
Warning: References to a Child become invalid after using
SimpleCollector.remove(java.lang.String...)
or SimpleCollector.clear()
,
Constructor and Description |
---|
Child() |
Modifier and Type | Method and Description |
---|---|
void |
dec()
Decrement the gauge by 1.
|
void |
dec(double amt)
Decrement the gauge by the given amount.
|
double |
get()
Get the value of the gauge.
|
void |
inc()
Increment the gauge by 1.
|
void |
inc(double amt)
Increment the gauge by the given amount.
|
void |
set(double val)
Set the gauge to the given value.
|
void |
setToCurrentTime()
Set the gauge to the current unixtime.
|
double |
setToTime(Runnable timeable)
Executes runnable code (i.e.
|
Gauge.Timer |
startTimer()
Start a timer to track a duration.
|
public Child()
public void inc()
public void inc(double amt)
public void dec()
public void dec(double amt)
public void set(double val)
public void setToCurrentTime()
public Gauge.Timer startTimer()
Call Gauge.Timer.setDuration()
at the end of what you want to measure the duration of.
This is primarily useful for tracking the durations of major steps of batch jobs,
which are then pushed to a PushGateway.
For tracking other durations/latencies you should usually use a Summary
.
public double setToTime(Runnable timeable)
timeable
- Code that is being timedpublic double get()
Copyright © 2018. All Rights Reserved.