use of org.apache.kafka.common.metrics.Sensor.RecordingLevel in project kafka by apache.
the class StreamsMetricsImplTest method shouldAddClientLevelImmutableMetric.
@Test
public void shouldAddClientLevelImmutableMetric() {
final Metrics metrics = mock(Metrics.class);
final RecordingLevel recordingLevel = RecordingLevel.INFO;
final MetricConfig metricConfig = new MetricConfig().recordLevel(recordingLevel);
final String value = "immutable-value";
final ImmutableMetricValue immutableValue = new ImmutableMetricValue<>(value);
expect(metrics.metricName(METRIC_NAME1, CLIENT_LEVEL_GROUP, DESCRIPTION1, clientLevelTags)).andReturn(metricName1);
metrics.addMetric(eq(metricName1), eqMetricConfig(metricConfig), eq(immutableValue));
replay(metrics);
final StreamsMetricsImpl streamsMetrics = new StreamsMetricsImpl(metrics, CLIENT_ID, VERSION, time);
streamsMetrics.addClientLevelImmutableMetric(METRIC_NAME1, DESCRIPTION1, recordingLevel, value);
verify(metrics);
}
Aggregations