diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-08-15 15:30:56 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-08-15 15:30:56 +0200 |
commit | 2d439c388c03eaf36f0c8675df9cac57d08ff9f6 (patch) | |
tree | ddb959ed0091acf99c5f17e2dacad2dbac997408 | |
parent | 1685d83c04f569ed66e706f3a548c20e9eb423b8 (diff) | |
download | garage-2d439c388c03eaf36f0c8675df9cac57d08ff9f6.tar.gz garage-2d439c388c03eaf36f0c8675df9cac57d08ff9f6.zip |
switch from micros to millis
-rw-r--r-- | src/db/metric_proxy.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/db/metric_proxy.rs b/src/db/metric_proxy.rs index c0856a57..469f8088 100644 --- a/src/db/metric_proxy.rs +++ b/src/db/metric_proxy.rs @@ -32,7 +32,7 @@ impl MetricDbProxy { op_duration: meter .f64_value_recorder("db.op_duration") .with_description("Duration of operations on the local metadata engine") - .with_unit(Unit::new("us")) + .with_unit(Unit::new("ms")) .init(), }; Db(Arc::new(s)) @@ -57,9 +57,8 @@ impl MetricDbProxy { let delay_nanos = Instant::now() .saturating_duration_since(request_start) .as_nanos(); - let delay_micro: f64 = delay_nanos as f64 / 1000.0f64; - println!("delay {}", delay_micro); - self.op_duration.record(delay_micro, &metric_tags); + let delay_millis: f64 = delay_nanos as f64 / 1_000_000f64; + self.op_duration.record(delay_millis, &metric_tags); res } |