Skip to content

Commit e1d9306

Browse files
authored
feat: use histogram in place of Gauge for signer (#349)
1 parent 8f83a0a commit e1d9306

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/signer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl Signer {
8888
let future = Box::pin(async move {
8989
let now = Instant::now();
9090
let res = sign_block(block, signer).await;
91-
metric.signing_duration.set(now.elapsed().as_secs_f64());
91+
metric.signing_duration.record(now.elapsed().as_secs_f64());
9292
res
9393
});
9494
self.in_progress.push_back(future);

crates/signer/src/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use metrics::Gauge;
1+
use metrics::Histogram;
22
use metrics_derive::Metrics;
33

44
/// The metrics for the [`super::Signer`].
55
#[derive(Metrics, Clone)]
66
#[metrics(scope = "signer")]
77
pub struct SignerMetrics {
88
/// The signing duration.
9-
pub signing_duration: Gauge,
9+
pub signing_duration: Histogram,
1010
}

0 commit comments

Comments
 (0)