Skip to content

Commit

Permalink
use refresh instead of collect
Browse files Browse the repository at this point in the history
  • Loading branch information
coderzc committed Mar 26, 2023
1 parent 3c3d284 commit d6c12d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,6 @@ public void refresh() {
this.count = count;
}

public void collect() {
long count = 0;
sum = sumCounter.sum();

for (int i = 0; i < buckets.length; i++) {
long value = buckets[i].sum();
count += value;
values[i] = value;
}

this.count = count;
}

public void reset() {
sum = 0;
sumCounter.reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Map<String, TopicMetricBean> genTopicMetricMap() {
});

delayedMessageIndexBucketOpLatencyMs.forEach((typeName, statsBuckets) -> {
statsBuckets.collect();
statsBuckets.refresh();
long[] buckets = statsBuckets.getBuckets();
for (int i = 0; i < buckets.length; i++) {
long count = buckets[i];
Expand Down

0 comments on commit d6c12d1

Please sign in to comment.