Skip to content

Commit

Permalink
[improve][broker] Remove unused method CompactionRecord.reset (#22670)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragosvictor authored May 8, 2024
1 parent ada31a9 commit ad75e3f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ public class CompactionRecord {
public final Rate writeRate = new Rate();
public final Rate readRate = new Rate();

public void reset() {
compactionRemovedEventCount.reset();
compactionSucceedCount.reset();
compactionFailedCount.reset();
compactionDurationTimeInMills.reset();
writeLatencyStats.reset();
}

public void addCompactionRemovedEvent() {
lastCompactionRemovedEventCountOp.increment();
compactionRemovedEventCount.increment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ public Set<String> getTopics() {
return compactionRecordOps.keySet();
}

public void reset() {
compactionRecordOps.values().forEach(CompactionRecord::reset);
}

public void addCompactionReadOp(String topic, long readableBytes) {
compactionRecordOps.computeIfAbsent(topic, k -> new CompactionRecord()).addCompactionReadOp(readableBytes);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ public void testSimple() throws Exception {
assertTrue(compaction.getCompactionWriteThroughput() > 0L);
mxBean.addCompactionLatencyOp(topic, 10, TimeUnit.NANOSECONDS);
assertTrue(compaction.getCompactionLatencyBuckets()[0] > 0L);
mxBean.reset();
assertEquals(compaction.getCompactionRemovedEventCount(), 0, 0);
assertEquals(compaction.getCompactionSucceedCount(), 0, 0);
assertEquals(compaction.getCompactionFailedCount(), 0, 0);
assertEquals(compaction.getCompactionDurationTimeInMills(), 0, 0);
}

}

0 comments on commit ad75e3f

Please sign in to comment.