|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.kafka.common.metrics.Sensor
public final class Sensor
A sensor applies a continuous sequence of numerical values to a set of associated metrics. For example a sensor on
message size would record a sequence of message sizes using the record(double)
api and would maintain a set
of metrics about request sizes such as the average or max.
Method Summary | |
---|---|
void |
add(CompoundStat stat)
Register a compound statistic with this sensor with no config override |
void |
add(CompoundStat stat,
MetricConfig config)
Register a compound statistic with this sensor which yields multiple measurable quantities (like a histogram) |
void |
add(java.lang.String name,
MeasurableStat stat)
Add a metric with default configuration and no description. |
void |
add(java.lang.String name,
MeasurableStat stat,
MetricConfig config)
Add a metric to this sensor with no description. |
void |
add(java.lang.String name,
java.lang.String description,
MeasurableStat stat)
Add a metric with default configuration. |
void |
add(java.lang.String name,
java.lang.String description,
MeasurableStat stat,
MetricConfig config)
Register a metric with this sensor |
java.lang.String |
name()
The name this sensor is registered with. |
void |
record()
Record an occurrence, this is just short-hand for record(1.0) |
void |
record(double value)
Record a value with this sensor |
void |
record(double value,
long timeMs)
Record a value at a known time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.String name()
public void record()
record(1.0)
public void record(double value)
value
- The value to record
QuotaViolationException
- if recording this value moves a metric beyond its configured maximum or minimum
boundpublic void record(double value, long timeMs)
record(double)
since it will reuse
the time stamp.
value
- The value we are recordingtimeMs
- The current POSIX time in milliseconds
QuotaViolationException
- if recording this value moves a metric beyond its configured maximum or minimum
boundpublic void add(CompoundStat stat)
public void add(CompoundStat stat, MetricConfig config)
stat
- The stat to registerconfig
- The configuration for this stat. If null then the stat will use the default configuration for this
sensor.public void add(java.lang.String name, MeasurableStat stat)
add(name, "", stat, null)
public void add(java.lang.String name, java.lang.String description, MeasurableStat stat)
add(name, description, stat, null)
public void add(java.lang.String name, MeasurableStat stat, MetricConfig config)
add(name, "", stat, config)
name
- stat
- config
- public void add(java.lang.String name, java.lang.String description, MeasurableStat stat, MetricConfig config)
name
- The name of the metricdescription
- A description used when reporting the valuestat
- The statistic to keepconfig
- A special configuration for this metric. If null use the sensor default configuration.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |