You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/05/26 23:19:00 UTC

[GitHub] [kafka] guozhangwang commented on a change in pull request #10765: KAFKA-12519: Remove built-in Streams metrics for versions 0.10.0-2.4

guozhangwang commented on a change in pull request #10765:
URL: https://github.com/apache/kafka/pull/10765#discussion_r640180457



##########
File path: streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/TaskMetricsTest.java
##########
@@ -56,20 +49,9 @@
     private final Sensor expectedSensor = createMock(Sensor.class);
     private final Map<String, String> tagMap = Collections.singletonMap("hello", "world");
 
-    @Parameters(name = "{0}")
-    public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][] {
-            {Version.LATEST},
-            {Version.FROM_0100_TO_24}
-        });
-    }
-
-    @Parameter
-    public Version builtInMetricsVersion;
-
     @Before
     public void setUp() {
-        expect(streamsMetrics.version()).andReturn(builtInMetricsVersion).anyTimes();
+        expect(streamsMetrics.version()).andStubReturn(Version.LATEST);

Review comment:
       Learned something new about andStubReturn v.s. andReturn :)

##########
File path: streams/src/test/java/org/apache/kafka/streams/state/internals/MeteredWindowStoreTest.java
##########
@@ -272,21 +230,8 @@ public void shouldRecordRestoreLatencyOnInit() {
         expectLastCall();
         replay(innerStoreMock);
         store.init((StateStoreContext) context, store);
-        final Map<MetricName, ? extends Metric> metrics = context.metrics().metrics();
-        if (StreamsConfig.METRICS_0100_TO_24.equals(builtInMetricsVersion)) {
-            assertEquals(1.0, getMetricByNameFilterByTags(
-                metrics,
-                "restore-total",
-                storeLevelGroup,
-                singletonMap(STORE_TYPE + "-state-id", STORE_NAME)
-            ).metricValue());
-            assertEquals(1.0, getMetricByNameFilterByTags(
-                metrics,
-                "restore-total",
-                storeLevelGroup,
-                singletonMap(STORE_TYPE + "-state-id", ROLLUP_VALUE)
-            ).metricValue());
-        }
+
+        verify(innerStoreMock);

Review comment:
       We forgot to add this 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:
users@infra.apache.org