HBASE-27316 Time based metrics will be reset after any get request
Change-Id: I9a7a07b2cd0de298b868912306bba03cabe6b3ed
This commit is contained in:
parent
950ad8dd3e
commit
0047b6e2c5
|
@ -312,8 +312,16 @@ public class FastLongHistogram {
|
|||
* Resets the histogram for new counting.
|
||||
*/
|
||||
public Snapshot snapshotAndReset() {
|
||||
final Bins oldBins = this.bins;
|
||||
Snapshot snapshot = snapshot();
|
||||
this.bins = new Bins(this.bins, this.bins.counts.length - 3, 0.01, 0.99);
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
/**
|
||||
* do snapshot without reset
|
||||
*/
|
||||
public Snapshot snapshot() {
|
||||
final Bins oldBins = this.bins;
|
||||
final long[] percentiles = oldBins.getQuantiles(DEFAULT_QUANTILES);
|
||||
final long count = oldBins.count.sum();
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ public class HistogramImpl implements Histogram {
|
|||
|
||||
@Override
|
||||
public Snapshot snapshot() {
|
||||
return histogram.snapshotAndReset();
|
||||
return histogram.snapshot();
|
||||
}
|
||||
|
||||
public long[] getQuantiles(double[] quantiles) {
|
||||
|
|
Loading…
Reference in New Issue