Add more store metrics

This commit is contained in:
Paul Hauner
2019-08-12 13:49:09 +10:00
parent 913ee4694e
commit 0b4a8893a4
3 changed files with 51 additions and 3 deletions

View File

@@ -41,6 +41,12 @@ pub fn inc_counter(counter: &Result<IntCounter>) {
}
}
pub fn inc_counter_by(counter: &Result<IntCounter>, value: i64) {
if let Ok(counter) = counter {
counter.inc_by(value);
}
}
pub fn set_gauge(gauge: &Result<IntGauge>, value: i64) {
if let Ok(gauge) = gauge {
gauge.set(value);