g3-histogram: fix mem usage

This commit is contained in:
Zhang Jingqiang 2023-12-19 14:28:47 +08:00
parent 7b303b86ee
commit 2e145dbacb
2 changed files with 2 additions and 0 deletions

View file

@ -103,6 +103,7 @@ where
for v in buf.iter().take(count) {
let _ = self.inner.record(v.as_u64());
}
buf.clear();
stats.update(self.inner());
}
});

View file

@ -110,6 +110,7 @@ where
for v in buf.iter().take(n) {
let _ = self.inner.record(v.as_u64());
}
buf.clear();
}
_ = rotate_interval.tick() => {
if !self.inner.is_empty() {