Class Rate
java.lang.Object
org.apache.kafka.common.metrics.stats.Rate
- All Implemented Interfaces:
Measurable,MeasurableStat,MetricValueProvider<Double>,Stat
- Direct Known Subclasses:
SimpleRate
The rate of the given quantity. By default this is the total observed over a set of samples from a sampled statistic divided by the elapsed time over the sample windows. Alternative
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 Summary
ConstructorsConstructorDescriptionRate()Rate(TimeUnit unit, SampledStat stat) Rate(TimeUnit unit, SampledStat stat, long window) Rate(SampledStat stat) Method Summary
Modifier and TypeMethodDescriptiondoublemeasure(MetricConfig config, long now) Measure this quantity and return the result as a double.voidrecord(MetricConfig config, double value, long timeMs) Record the given valuetoString()unitName()longwindowSize(MetricConfig config, long now) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.kafka.common.metrics.Measurable
value
Constructor Details
Rate
public Rate()Rate
Rate
Rate
Rate
Method Details
unitName
record
Description copied from interface:StatRecord the given valuemeasure
Description copied from interface:MeasurableMeasure this quantity and return the result as a double.- Specified by:
measurein interfaceMeasurable- Parameters:
config- The configuration for this metricnow- The POSIX time in milliseconds the measurement is being taken- Returns:
- The measured value
windowSize
toString