use of org.apache.kafka.common.metrics.Sensor.RecordingLevel in project kafka by apache.
the class StreamsMetricsImplTest method shouldGetExistingClientLevelSensor.
@Test
public void shouldGetExistingClientLevelSensor() {
final Metrics metrics = mock(Metrics.class);
final RecordingLevel recordingLevel = RecordingLevel.INFO;
setupGetExistingSensorTest(metrics);
final StreamsMetricsImpl streamsMetrics = new StreamsMetricsImpl(metrics, CLIENT_ID, VERSION, time);
final Sensor actualSensor = streamsMetrics.clientLevelSensor(SENSOR_NAME_1, recordingLevel);
verify(metrics);
assertThat(actualSensor, is(equalToObject(sensor)));
}
use of org.apache.kafka.common.metrics.Sensor.RecordingLevel in project kafka by apache.
the class StreamsMetricsImplTest method shouldGetNewStoreLevelSensorIfNoneExists.
@Test
public void shouldGetNewStoreLevelSensorIfNoneExists() {
final Metrics metrics = mock(Metrics.class);
final RecordingLevel recordingLevel = RecordingLevel.INFO;
final Capture<String> sensorKeys = setupGetNewSensorTest(metrics, recordingLevel);
final StreamsMetricsImpl streamsMetrics = new StreamsMetricsImpl(metrics, CLIENT_ID, VERSION, time);
final Sensor actualSensor = streamsMetrics.storeLevelSensor(TASK_ID1, STORE_NAME1, SENSOR_NAME_1, recordingLevel);
verify(metrics);
assertThat(actualSensor, is(equalToObject(sensor)));
assertThat(sensorKeys.getValues().get(0), is(sensorKeys.getValues().get(1)));
}
use of org.apache.kafka.common.metrics.Sensor.RecordingLevel in project kafka by apache.
the class StreamsMetricsImplTest method shouldGetExistingTaskLevelSensor.
@Test
public void shouldGetExistingTaskLevelSensor() {
final Metrics metrics = mock(Metrics.class);
final RecordingLevel recordingLevel = RecordingLevel.INFO;
setupGetExistingSensorTest(metrics);
final StreamsMetricsImpl streamsMetrics = new StreamsMetricsImpl(metrics, CLIENT_ID, VERSION, time);
final Sensor actualSensor = streamsMetrics.taskLevelSensor(THREAD_ID1, TASK_ID1, SENSOR_NAME_1, recordingLevel);
verify(metrics);
assertThat(actualSensor, is(equalToObject(sensor)));
}
use of org.apache.kafka.common.metrics.Sensor.RecordingLevel in project kafka by apache.
the class StreamsMetricsImplTest method shouldGetNewNodeLevelSensor.
@Test
public void shouldGetNewNodeLevelSensor() {
final Metrics metrics = mock(Metrics.class);
final RecordingLevel recordingLevel = RecordingLevel.INFO;
final String processorNodeName = "processorNodeName";
setupGetNewSensorTest(metrics, recordingLevel);
final StreamsMetricsImpl streamsMetrics = new StreamsMetricsImpl(metrics, CLIENT_ID, VERSION, time);
final Sensor actualSensor = streamsMetrics.nodeLevelSensor(THREAD_ID1, TASK_ID1, processorNodeName, SENSOR_NAME_1, recordingLevel);
verify(metrics);
assertThat(actualSensor, is(equalToObject(sensor)));
}
use of org.apache.kafka.common.metrics.Sensor.RecordingLevel in project kafka by apache.
the class StreamsMetricsImplTest method shouldGetNewCacheLevelSensor.
@Test
public void shouldGetNewCacheLevelSensor() {
final Metrics metrics = mock(Metrics.class);
final RecordingLevel recordingLevel = RecordingLevel.INFO;
final String processorCacheName = "processorNodeName";
setupGetNewSensorTest(metrics, recordingLevel);
final StreamsMetricsImpl streamsMetrics = new StreamsMetricsImpl(metrics, CLIENT_ID, VERSION, time);
final Sensor actualSensor = streamsMetrics.cacheLevelSensor(THREAD_ID1, TASK_ID1, processorCacheName, SENSOR_NAME_1, recordingLevel);
verify(metrics);
assertThat(actualSensor, is(equalToObject(sensor)));
}
Aggregations