diff --git a/docs/ops.html b/docs/ops.html index 4414a0b86adcd..cf53415f04d3c 100644 --- a/docs/ops.html +++ b/docs/ops.html @@ -2956,26 +2956,6 @@
tagMap = streamsMetrics.taskLevelTagMap(threadId, ROLLUP_VALUE); - addInvocationRateAndCountToSensor( - commitOverTasksSensor, - TASK_LEVEL_GROUP, - tagMap, - COMMIT, - COMMIT_OVER_TASKS_RATE_DESCRIPTION, - COMMIT_OVER_TASKS_TOTAL_DESCRIPTION - ); - return commitOverTasksSensor; - } - public static Sensor processRatioSensor(final String threadId, final StreamsMetricsImpl streamsMetrics) { final Sensor sensor = diff --git a/streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/TaskMetricsTest.java b/streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/TaskMetricsTest.java index f284d04fa3e90..161a4f53289f2 100644 --- a/streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/TaskMetricsTest.java +++ b/streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/TaskMetricsTest.java @@ -177,30 +177,6 @@ public void shouldGetPunctuateSensor() { } } - @Test - public void shouldGetCommitSensor() { - final String operation = "commit"; - final String totalDescription = "The total number of calls to commit"; - final String rateDescription = "The average number of calls to commit per second"; - when(streamsMetrics.taskLevelSensor(THREAD_ID, TASK_ID, operation, RecordingLevel.DEBUG)).thenReturn(expectedSensor); - when(streamsMetrics.taskLevelTagMap(THREAD_ID, TASK_ID)).thenReturn(tagMap); - - try (final MockedStatic streamsMetricsStaticMock = mockStatic(StreamsMetricsImpl.class)) { - final Sensor sensor = TaskMetrics.commitSensor(THREAD_ID, TASK_ID, streamsMetrics); - streamsMetricsStaticMock.verify( - () -> StreamsMetricsImpl.addInvocationRateAndCountToSensor( - expectedSensor, - TASK_LEVEL_GROUP, - tagMap, - operation, - rateDescription, - totalDescription - ) - ); - assertThat(sensor, is(expectedSensor)); - } - } - @Test public void shouldGetEnforcedProcessingSensor() { final String operation = "enforced-processing"; diff --git a/streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/ThreadMetricsTest.java b/streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/ThreadMetricsTest.java index 2bbb6acb2a84c..77ff66697026d 100644 --- a/streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/ThreadMetricsTest.java +++ b/streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/ThreadMetricsTest.java @@ -35,7 +35,6 @@ import static org.apache.kafka.streams.processor.internals.metrics.StreamsMetricsImpl.LATENCY_SUFFIX; import static org.apache.kafka.streams.processor.internals.metrics.StreamsMetricsImpl.RATE_SUFFIX; -import static org.apache.kafka.streams.processor.internals.metrics.StreamsMetricsImpl.ROLLUP_VALUE; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -43,7 +42,6 @@ public class ThreadMetricsTest { private static final String THREAD_ID = "thread-id"; private static final String THREAD_LEVEL_GROUP = "stream-thread-metrics"; - private static final String TASK_LEVEL_GROUP = "stream-task-metrics"; private final Sensor expectedSensor = mock(Sensor.class); private final StreamsMetricsImpl streamsMetrics = mock(StreamsMetricsImpl.class); @@ -287,32 +285,6 @@ public void shouldGetCommitRatioSensor() { } } - @Test - public void shouldGetCommitOverTasksSensor() { - final String operation = "commit"; - final String totalDescription = - "The total number of calls to commit over all tasks assigned to one stream thread"; - final String rateDescription = - "The average per-second number of calls to commit over all tasks assigned to one stream thread"; - when(streamsMetrics.threadLevelSensor(THREAD_ID, operation, RecordingLevel.DEBUG)).thenReturn(expectedSensor); - when(streamsMetrics.taskLevelTagMap(THREAD_ID, ROLLUP_VALUE)).thenReturn(tagMap); - - try (final MockedStatic streamsMetricsStaticMock = mockStatic(StreamsMetricsImpl.class)) { - final Sensor sensor = ThreadMetrics.commitOverTasksSensor(THREAD_ID, streamsMetrics); - streamsMetricsStaticMock.verify( - () -> StreamsMetricsImpl.addInvocationRateAndCountToSensor( - expectedSensor, - TASK_LEVEL_GROUP, - tagMap, - operation, - rateDescription, - totalDescription - ) - ); - assertThat(sensor, is(expectedSensor)); - } - } - @Test public void shouldGetPunctuateSensor() { final String operation = "punctuate"; @@ -371,6 +343,8 @@ public void shouldGetPunctuateRatioSensor() { assertThat(sensor, is(expectedSensor)); } } + + @Test public void shouldGetCreateTaskSensor() { final String operation = "task-created"; final String totalDescription = "The total number of newly created tasks";