Skip to content

Commit

Permalink
update: fixed analytics (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
heemankv authored Dec 24, 2024
1 parent 34d629c commit 22b039a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions crates/node/src/service/rpc/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down

0 comments on commit 22b039a

Please sign in to comment.