cadonna commented on a change in pull request #9094:
URL: https://github.com/apache/kafka/pull/9094#discussion_r463514179



##########
File path: 
streams/src/test/java/org/apache/kafka/streams/integration/MetricsIntegrationTest.java
##########
@@ -668,6 +671,9 @@ private void checkKeyValueStoreMetrics(final String 
group0100To24,
         checkMetricByName(listMetricStore, SUPPRESSION_BUFFER_SIZE_CURRENT, 0);
         checkMetricByName(listMetricStore, SUPPRESSION_BUFFER_SIZE_AVG, 0);
         checkMetricByName(listMetricStore, SUPPRESSION_BUFFER_SIZE_MAX, 0);
+        checkMetricByName(listMetricStore, RECORD_E2E_LATENCY_AVG, 
expectedNumberofE2ELatencyMetrics);
+        checkMetricByName(listMetricStore, RECORD_E2E_LATENCY_MIN, 
expectedNumberofE2ELatencyMetrics);
+        checkMetricByName(listMetricStore, RECORD_E2E_LATENCY_MAX, 
expectedNumberofE2ELatencyMetrics);

Review comment:
       You can use the following to get it right without the need to do the 
check for the e2e latency before filtering
   
   ```
   .filter(m -> m.metricName().tags().containsKey(tagKey) && 
       (m.metricName().group().equals(group0100To24) || 
m.metricName().group().equals(STATE_STORE_LEVEL_GROUP))
   ).collect(Collectors.toList());
   
   ```
   
   The reason for the difference between the KV store and the window store is 
that they are used in different tests with different number of state stores.
   
   The test that uses the KV stores tests three different types of KV stores, 
namely in-memory, rocksdb, and in-memory-lru-cache. For each of this types the 
old group name changes. That is also the reason we need to pass the parameter 
`group0100To24` to `checkKeyValueStoreMetrics()`.
   
   In `checkWindowStoreAndSuppressionBufferMetrics()` we need to filter for 
four groups, because the corresponding test uses suppression and window state 
store. Suppression buffers had their own group in the old version. In the new 
version they moved into the state store group. Those groups are 
`BUFFER_LEVEL_GROUP_0100_TO_24` and `STATE_STORE_LEVEL_GROUP`. The window state 
store had their own group in the old version, i.e., 
`STATE_STORE_LEVEL_GROUP_ROCKSDB_WINDOW_STORE_0100_TO_24` (we are only using 
RocksDB-based window stores in the test). Finally, during the implementation of 
KIP-444, we discovered that we named a group incorrectly. That's why we filter 
also for group `stream-rocksdb-window-metrics`.
   
   So to sum up, it is hard to compare the verifications for KV stores and 
window stores, because they are used in different tests. Sorry, I should have 
been clearer on that before. 




----------------------------------------------------------------
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


Reply via email to