@InterfaceStability.Unstable
public interface StreamsMetrics
Modifier and Type | Method and Description |
---|---|
org.apache.kafka.common.metrics.Sensor |
addLatencyAndThroughputSensor(String scopeName,
String entityName,
String operationName,
org.apache.kafka.common.metrics.Sensor.RecordingLevel recordingLevel,
String... tags)
Add a latency and throughput sensor for a specific operation, which will include the following sensors:
average latency
max latency
throughput (num.operations / time unit)
Also create a parent sensor with the same metrics that aggregates all entities with the same operation under the
same scope if it has not been created.
|
org.apache.kafka.common.metrics.Sensor |
addSensor(String name,
org.apache.kafka.common.metrics.Sensor.RecordingLevel recordingLevel)
Generic method to create a sensor.
|
org.apache.kafka.common.metrics.Sensor |
addSensor(String name,
org.apache.kafka.common.metrics.Sensor.RecordingLevel recordingLevel,
org.apache.kafka.common.metrics.Sensor... parents)
Generic method to create a sensor with parent sensors.
|
org.apache.kafka.common.metrics.Sensor |
addThroughputSensor(String scopeName,
String entityName,
String operationName,
org.apache.kafka.common.metrics.Sensor.RecordingLevel recordingLevel,
String... tags)
Add a throughput sensor for a specific operation:
throughput (num.operations / time unit)
Also create a parent sensor with the same metrics that aggregates all entities with the same operation under the
same scope if it has not been created.
|
Map<MetricName,? extends Metric> |
metrics()
Get read-only handle on global metrics registry.
|
void |
recordLatency(org.apache.kafka.common.metrics.Sensor sensor,
long startNs,
long endNs)
Record the given latency value of the sensor.
|
void |
recordThroughput(org.apache.kafka.common.metrics.Sensor sensor,
long value)
Record the throughput value of a sensor.
|
void |
removeSensor(org.apache.kafka.common.metrics.Sensor sensor)
Remove a sensor.
|
Map<MetricName,? extends Metric> metrics()
org.apache.kafka.common.metrics.Sensor addLatencyAndThroughputSensor(String scopeName, String entityName, String operationName, org.apache.kafka.common.metrics.Sensor.RecordingLevel recordingLevel, String... tags)
scopeName
- name of the scope, could be the type of the state store, etc.entityName
- name of the entity, could be the name of the state store instance, etc.operationName
- name of the operation, could be get / put / delete / etc.recordingLevel
- the recording level (e.g., INFO or DEBUG) for this sensor.tags
- additional tags of the sensorvoid recordLatency(org.apache.kafka.common.metrics.Sensor sensor, long startNs, long endNs)
addLatencyAndThroughputSensor(String, String, String, Sensor.RecordingLevel, String...)
method, then the
throughput metrics will also be recorded from this event.sensor
- sensor whose latency we are recording.startNs
- start of measurement time in nanoseconds.endNs
- end of measurement time in nanoseconds.org.apache.kafka.common.metrics.Sensor addThroughputSensor(String scopeName, String entityName, String operationName, org.apache.kafka.common.metrics.Sensor.RecordingLevel recordingLevel, String... tags)
addLatencyAndThroughputSensor(String, String, String, Sensor.RecordingLevel, String...)
.scopeName
- name of the scope, could be the type of the state store, etc.entityName
- name of the entity, could be the name of the state store instance, etc.operationName
- name of the operation, could be get / put / delete / etc.recordingLevel
- the recording level (e.g., INFO or DEBUG) for this sensor.tags
- additional tags of the sensorvoid recordThroughput(org.apache.kafka.common.metrics.Sensor sensor, long value)
sensor
- add Sensor whose throughput we are recordingvalue
- throughput valueorg.apache.kafka.common.metrics.Sensor addSensor(String name, org.apache.kafka.common.metrics.Sensor.RecordingLevel recordingLevel)
addThroughputSensor(String, String, String, Sensor.RecordingLevel, String...)
or addLatencyAndThroughputSensor(String, String, String, Sensor.RecordingLevel, String...)
to ensure
metric name well-formedness and conformity with the rest of the streams code base.
However, if the above two methods are not sufficient, this method can also be used.name
- name of the sensor.recordingLevel
- the recording level (e.g., INFO or DEBUG) for this sensororg.apache.kafka.common.metrics.Sensor addSensor(String name, org.apache.kafka.common.metrics.Sensor.RecordingLevel recordingLevel, org.apache.kafka.common.metrics.Sensor... parents)
addThroughputSensor(String, String, String, Sensor.RecordingLevel, String...)
or addLatencyAndThroughputSensor(String, String, String, Sensor.RecordingLevel, String...)
to ensure
metric name well-formedness and conformity with the rest of the streams code base.
However, if the above two methods are not sufficient, this method can also be used.name
- name of the sensorrecordingLevel
- the recording level (e.g., INFO or DEBUG) for this sensorvoid removeSensor(org.apache.kafka.common.metrics.Sensor sensor)
sensor
- sensor to be removed