showuon commented on code in PR #16959: URL: https://github.com/apache/kafka/pull/16959#discussion_r1730617565
########## core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java: ########## @@ -2530,6 +2635,21 @@ public void testDeleteLogSegmentDueToRetentionTimeBreach(int segmentCount, verifyDeleteLogSegment(segmentMetadataList, deletableSegmentCount, currentLeaderEpoch); } + private void verifyRemoteDeleteMetrics(long remoteDeleteLagBytes, long remoteDeleteLagSegments) { + assertEquals(remoteDeleteLagBytes, safeLongYammerMetricValue("RemoteDeleteLagBytes"), + String.format("Expected to find %d for RemoteDeleteLagBytes metric value, but found %d", + remoteDeleteLagBytes, safeLongYammerMetricValue("RemoteDeleteLagBytes"))); + assertEquals(remoteDeleteLagBytes, safeLongYammerMetricValue("RemoteDeleteLagBytes"), + String.format("Expected to find %d for RemoteDeleteLagBytes metric value, but found %d", + remoteDeleteLagBytes, safeLongYammerMetricValue("RemoteDeleteLagBytes"))); + assertEquals(remoteDeleteLagSegments, safeLongYammerMetricValue("RemoteDeleteLagSegments,topic=" + leaderTopic), + String.format("Expected to find %d for RemoteDeleteLagSegments for 'Leader' topic metric value, but found %d", + remoteDeleteLagSegments, safeLongYammerMetricValue("RemoteDeleteLagSegments,topic=" + leaderTopic))); + assertEquals(remoteDeleteLagSegments, safeLongYammerMetricValue("RemoteDeleteLagSegments,topic=" + leaderTopic), + String.format("Expected to find %d for RemoteDeleteLagSegments for 'Leader' topic metric value, but found %d", + remoteDeleteLagSegments, safeLongYammerMetricValue("RemoteDeleteLagSegments,topic=" + leaderTopic))); + } Review Comment: Oh, nice catch! Thanks! -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org