Browse Source

MINOR: Remove tag from metric to measure process-rate on source nodes (#8175)

Reviewers: Guozhang Wang <wangguoz@gmail.com>
pull/8183/head
Bruno Cadonna 5 years ago committed by GitHub
parent
commit
39d5534f8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/ProcessorNodeMetrics.java
  2. 2
      streams/src/test/java/org/apache/kafka/streams/processor/internals/SourceNodeTest.java
  3. 2
      streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/ProcessorNodeMetricsTest.java

2
streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/ProcessorNodeMetrics.java

@ -137,7 +137,7 @@ public class ProcessorNodeMetrics { @@ -137,7 +137,7 @@ public class ProcessorNodeMetrics {
addInvocationRateAndCountToSensor(
parentSensor,
TASK_LEVEL_GROUP,
streamsMetrics.nodeLevelTagMap(threadId, taskId, ROLLUP_VALUE),
streamsMetrics.taskLevelTagMap(threadId, taskId),
PROCESS,
PROCESS_RATE_DESCRIPTION,
PROCESS_TOTAL_DESCRIPTION

2
streams/src/test/java/org/apache/kafka/streams/processor/internals/SourceNodeTest.java

@ -112,8 +112,8 @@ public class SourceNodeTest { @@ -112,8 +112,8 @@ public class SourceNodeTest {
assertTrue(StreamsTestUtils.containsMetric(metrics, "process-total", groupName, metricTags));
// test parent sensors
metricTags.put("processor-node-id", StreamsMetricsImpl.ROLLUP_VALUE);
final String parentGroupName = "stream-task-metrics";
metricTags.remove("processor-node-id");
assertTrue(StreamsTestUtils.containsMetric(metrics, "process-rate", parentGroupName, metricTags));
assertTrue(StreamsTestUtils.containsMetric(metrics, "process-total", parentGroupName, metricTags));

2
streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/ProcessorNodeMetricsTest.java

@ -121,7 +121,7 @@ public class ProcessorNodeMetricsTest { @@ -121,7 +121,7 @@ public class ProcessorNodeMetricsTest {
final String descriptionOfRate = "The average number of calls to process per second";
expect(streamsMetrics.taskLevelSensor(THREAD_ID, TASK_ID, metricNamePrefix, RecordingLevel.DEBUG))
.andReturn(expectedParentSensor);
expect(streamsMetrics.nodeLevelTagMap(THREAD_ID, TASK_ID, StreamsMetricsImpl.ROLLUP_VALUE))
expect(streamsMetrics.taskLevelTagMap(THREAD_ID, TASK_ID))
.andReturn(parentTagMap);
StreamsMetricsImpl.addInvocationRateAndCountToSensor(
expectedParentSensor,

Loading…
Cancel
Save