cadonna commented on a change in pull request #9094: URL: https://github.com/apache/kafka/pull/9094#discussion_r462883347
########## File path: streams/src/test/java/org/apache/kafka/streams/state/internals/metrics/StateStoreMetricsTest.java ########## @@ -327,6 +327,38 @@ public void shouldGetExpiredWindowRecordDropSensor() { assertThat(sensor, is(expectedSensor)); } + @Test + public void shouldGetRecordE2ELatencySensor() { + final String metricName = "record-e2e-latency"; + + final String e2eLatencyDescription = + "end-to-end latency of a record, measuring by comparing the record timestamp with the " + + "system time when it has been fully processed by the node"; + final String descriptionOfAvg = "The average " + e2eLatencyDescription; + final String descriptionOfMin = "The minimum " + e2eLatencyDescription; + final String descriptionOfMax = "The maximum " + e2eLatencyDescription; + + expect(streamsMetrics.storeLevelSensor(THREAD_ID, TASK_ID, STORE_NAME, metricName, RecordingLevel.TRACE)) + .andReturn(expectedSensor); + expect(streamsMetrics.storeLevelTagMap(THREAD_ID, TASK_ID, STORE_TYPE, STORE_NAME)).andReturn(storeTagMap); + StreamsMetricsImpl.addAvgAndMinAndMaxToSensor( + expectedSensor, + STORE_LEVEL_GROUP, Review comment: I just realized that we should not put new metrics into old groups. Your code is fine. Do not use instance variable `storeLevelGroup`! Sorry for the confusion. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org