diff --git a/crates/relayer/src/agent_listener/quic.rs b/crates/relayer/src/agent_listener/quic.rs index 59685d3..02947b3 100644 --- a/crates/relayer/src/agent_listener/quic.rs +++ b/crates/relayer/src/agent_listener/quic.rs @@ -59,7 +59,7 @@ impl AgentQuicListener { match Self::process_incoming_conn(cluster_validator, conn).await { Ok(connection) => { histogram!(METRICS_AGENT_HISTOGRAM) - .record(started.elapsed().as_millis() as f32); + .record(started.elapsed().as_millis() as f32 / 1000.0); log::info!("new connection {}", connection.domain()); if let Err(e) = tx.send(connection).await { log::error!("send new connection to main loop error {:?}", e); diff --git a/crates/relayer/src/agent_listener/tcp.rs b/crates/relayer/src/agent_listener/tcp.rs index ae08fe9..2a43eb7 100644 --- a/crates/relayer/src/agent_listener/tcp.rs +++ b/crates/relayer/src/agent_listener/tcp.rs @@ -97,7 +97,7 @@ impl< match self.process_incoming_stream(stream).await { Ok(connection) => { histogram!(METRICS_AGENT_HISTOGRAM) - .record(started.elapsed().as_millis() as f32); + .record(started.elapsed().as_millis() as f32 / 1000.0); log::info!("new connection {}", connection.domain()); return Ok(connection); } diff --git a/crates/relayer/src/agent_worker.rs b/crates/relayer/src/agent_worker.rs index dc867ac..ef655f5 100644 --- a/crates/relayer/src/agent_worker.rs +++ b/crates/relayer/src/agent_worker.rs @@ -63,7 +63,8 @@ where counter!(METRICS_TUNNEL_AGENT_COUNT).increment(1); let started = Instant::now(); let sub_connection = self.connection.create_sub_connection().await?; - histogram!(METRICS_TUNNEL_AGENT_HISTOGRAM).record(started.elapsed().as_millis() as f32); + histogram!(METRICS_TUNNEL_AGENT_HISTOGRAM) + .record(started.elapsed().as_millis() as f32 / 1000.0); async_std::task::spawn(async move { if conn.local() { diff --git a/crates/relayer/src/tunnel.rs b/crates/relayer/src/tunnel.rs index 03e4e3d..98f5e6b 100644 --- a/crates/relayer/src/tunnel.rs +++ b/crates/relayer/src/tunnel.rs @@ -122,7 +122,8 @@ async fn tunnel_over_cluster<'a>( let (mut send, mut recv) = connection.open_bi().await?; log::info!("opened bi stream to agent for domain: {domain} in node {dest}"); - histogram!(METRICS_TUNNEL_CLUSTER_HISTOGRAM).record(started.elapsed().as_millis() as f32); + histogram!(METRICS_TUNNEL_CLUSTER_HISTOGRAM) + .record(started.elapsed().as_millis() as f32 / 1000.0); let req_buf: Vec = (&ClusterTunnelRequest { domain: domain.clone(),