kamalcph commented on code in PR #16959:
URL: https://github.com/apache/kafka/pull/16959#discussion_r1729080078
##########
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:
```suggestion
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(remoteDeleteLagSegments,
safeLongYammerMetricValue("RemoteDeleteLagSegments"),
String.format("Expected to find %d for
RemoteDeleteLagSegments metric value, but found %d",
remoteDeleteLagSegments,
safeLongYammerMetricValue("RemoteDeleteLagSegments")));
assertEquals(remoteDeleteLagBytes,
safeLongYammerMetricValue("RemoteDeleteLagBytes,topic=" + leaderTopic),
String.format("Expected to find %d for RemoteDeleteLagBytes
for 'Leader' topic metric value, but found %d",
remoteDeleteLagBytes,
safeLongYammerMetricValue("RemoteDeleteLagBytes,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)));
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]