public class Rate extends Object implements MeasurableStat
SampledStat
implementations can be provided,
however, to record the rate of occurrences (e.g. the count of values measured over the time interval) or other such
values.Constructor and Description |
---|
Rate() |
Rate(SampledStat stat) |
Rate(TimeUnit unit) |
Rate(TimeUnit unit,
SampledStat stat) |
Modifier and Type | Method and Description |
---|---|
double |
measure(MetricConfig config,
long now)
Measure this quantity and return the result as a double
|
void |
record(MetricConfig config,
double value,
long timeMs)
Record the given value
|
String |
toString() |
String |
unitName() |
long |
windowSize(MetricConfig config,
long now) |
public Rate()
public Rate(TimeUnit unit)
public Rate(SampledStat stat)
public Rate(TimeUnit unit, SampledStat stat)
public String unitName()
public void record(MetricConfig config, double value, long timeMs)
Stat
public double measure(MetricConfig config, long now)
Measurable
measure
in interface Measurable
config
- The configuration for this metricnow
- The POSIX time in milliseconds the measurement is being takenpublic long windowSize(MetricConfig config, long now)