public class MetricDef extends Object
MetricSampleAggregator
to look up the metrics.
Also, each metric can belong to a metric group. The metrics in the same metric group are expected to be of
the same type and unit. For example, the bytes in rate of the entire system may be divided into the bytes in
rate of a few subsystems. In this case, the metric bytes in rate of the subsystems can be defined within
the same metric group, so that they can be accumulated to the bytes in rate of the entire system.
This class is supposed to be initialized only once and passed around after the creation for read only.Constructor and Description |
---|
MetricDef() |
Modifier and Type | Method and Description |
---|---|
List<MetricInfo> |
all() |
MetricDef |
define(KafkaMetricDef kafkaMetricDef)
Define the metric.
|
void |
doneDefinition()
Finish the metric definition and make the MetricDef immutable.
|
MetricInfo |
metricInfo(KafkaMetricDef metricDef)
Get the metric id from the metric name.
|
MetricInfo |
metricInfo(short id) |
List<MetricInfo> |
metricInfoForResource(Resource resource)
Get all the metric info for the given resource.
|
int |
size() |
public MetricDef define(KafkaMetricDef kafkaMetricDef)
kafkaMetricDef
- the kafka metric definitionpublic List<MetricInfo> metricInfoForResource(Resource resource)
resource
- the resource to get the info.public void doneDefinition()
public MetricInfo metricInfo(KafkaMetricDef metricDef)
metricDef
- the metric definition.MetricInfo
associated with the metric name.public MetricInfo metricInfo(short id)
MetricInfo
by id;public List<MetricInfo> all()
public int size()