Skip to content

Commit

Permalink
feat(funder): change latency metrics to millis (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfourzerofour authored Oct 4, 2024
1 parent 2a0e8be commit 6c3691a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crates/rpc/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ impl RpcMetrics {
}

fn record_request_latency(method_name: String, latency: Duration) {
metrics::histogram!("rpc_request_latency", "method_name" => method_name).record(latency);
metrics::histogram!("rpc_request_latency", "method_name" => method_name)
.record(latency.as_millis() as f64);
}
}
2 changes: 1 addition & 1 deletion crates/task/src/grpc/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,6 @@ impl GrpcMetricsRecorder {

// Record the latency of a request for a given method and service.
fn record_request_latency(method_name: &str, scope: &str, latency: Duration) {
metrics::histogram!("grpc_request_latency", "method_name" => method_name.to_string(), "service" => scope.to_string()).record(latency)
metrics::histogram!("grpc_request_latency", "method_name" => method_name.to_string(), "service" => scope.to_string()).record(latency.as_millis() as f64)
}
}

0 comments on commit 6c3691a

Please sign in to comment.