From 22b039a51731a166328d6bd9d295c94fe341ca5f Mon Sep 17 00:00:00 2001 From: Heemank Verma Date: Tue, 24 Dec 2024 14:43:23 +0530 Subject: [PATCH] update: fixed analytics (#421) --- CHANGELOG.md | 1 + crates/node/src/service/rpc/metrics.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 852abc649..c51fe7747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Next release +- fix: instrumentation code - feat: block resource cap removed from the pending tick - fix: replace class hash issue resolved + gas fees issue resolved - fix: trim hash of eth state was failing with 0x0 diff --git a/crates/node/src/service/rpc/metrics.rs b/crates/node/src/service/rpc/metrics.rs index 91799172b..2f4ae77db 100644 --- a/crates/node/src/service/rpc/metrics.rs +++ b/crates/node/src/service/rpc/metrics.rs @@ -91,12 +91,12 @@ impl RpcMetrics { } pub(crate) fn ws_disconnect(&self, now: Instant) { - let micros = now.elapsed().as_secs(); + let millis = now.elapsed().as_millis(); if let Some(counter) = self.ws_sessions_closed.as_ref() { counter.add(1, &[]); } - self.ws_sessions_time.record(micros as f64, &[]); + self.ws_sessions_time.record(millis as f64, &[]); } pub(crate) fn on_call(&self, req: &Request, transport_label: &'static str) { @@ -113,15 +113,15 @@ impl RpcMetrics { tracing::trace!(target: "rpc_metrics", "[{transport_label}] on_response started_at={:?}", now); tracing::trace!(target: "rpc_metrics::extra", "[{transport_label}] result={}", rp.as_result()); - let micros = now.elapsed().as_micros(); + let millis = now.elapsed().as_millis(); tracing::debug!( target: "rpc_metrics", - "[{transport_label}] {} call took {} μs", + "[{transport_label}] {} call took {:?}", req.method_name(), - micros, + millis, ); - self.calls_time.record(micros as f64, &[KeyValue::new("method", req.method_name().to_string())]); + self.calls_time.record(millis as f64, &[KeyValue::new("method", req.method_name().to_string())]); self.calls_finished.add( 1,