Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][broker] Remove unused method CompactionRecord.reset #22670

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}

}
Loading