Remove hostname() from calls to metrics as it's expensive operation (#1557)
This commit is contained in:
parent
f8516b677a
commit
df9ccce5b2
|
@ -22,7 +22,6 @@ use std::thread::{self, Builder, JoinHandle};
|
|||
use std::time::Duration;
|
||||
use std::time::Instant;
|
||||
use streamer::{responder, BlobSender};
|
||||
use sys_info::hostname;
|
||||
use vote_stage::send_validator_vote;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
|
@ -75,10 +74,7 @@ impl ReplicateStage {
|
|||
|
||||
metrics::submit(
|
||||
influxdb::Point::new("replicate-stage")
|
||||
.add_field(
|
||||
"host",
|
||||
influxdb::Value::String(hostname().unwrap_or_else(|_| "?".to_string())),
|
||||
).add_field("count", influxdb::Value::Integer(entries.len() as i64))
|
||||
.add_field("count", influxdb::Value::Integer(entries.len() as i64))
|
||||
.to_owned(),
|
||||
);
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ use std::sync::{Arc, RwLock};
|
|||
use std::thread::{self, Builder, JoinHandle};
|
||||
use std::time::Duration;
|
||||
use streamer::BlobReceiver;
|
||||
use sys_info::hostname;
|
||||
use window::SharedWindow;
|
||||
use window_service::window_service;
|
||||
|
||||
|
@ -34,10 +33,7 @@ fn retransmit(
|
|||
|
||||
metrics::submit(
|
||||
influxdb::Point::new("retransmit-stage")
|
||||
.add_field(
|
||||
"host",
|
||||
influxdb::Value::String(hostname().unwrap_or_else(|_| "?".to_string())),
|
||||
).add_field("count", influxdb::Value::Integer(dq.len() as i64))
|
||||
.add_field("count", influxdb::Value::Integer(dq.len() as i64))
|
||||
.to_owned(),
|
||||
);
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ use std::sync::{Arc, RwLock};
|
|||
use std::thread::{Builder, JoinHandle};
|
||||
use std::time::{Duration, Instant};
|
||||
use streamer::{BlobReceiver, BlobSender};
|
||||
use sys_info::hostname;
|
||||
use timing::duration_as_ms;
|
||||
use window::{blob_idx_in_window, SharedWindow, WindowUtil};
|
||||
|
||||
|
@ -122,9 +121,6 @@ fn retransmit_all_leader_blocks(
|
|||
metrics::submit(
|
||||
influxdb::Point::new("retransmit-queue")
|
||||
.add_field(
|
||||
"host",
|
||||
influxdb::Value::String(hostname().unwrap_or_else(|_| "?".to_string())),
|
||||
).add_field(
|
||||
"count",
|
||||
influxdb::Value::Integer(retransmit_queue.len() as i64),
|
||||
).to_owned(),
|
||||
|
@ -177,10 +173,7 @@ fn recv_window(
|
|||
|
||||
metrics::submit(
|
||||
influxdb::Point::new("recv-window")
|
||||
.add_field(
|
||||
"host",
|
||||
influxdb::Value::String(hostname().unwrap_or_else(|_| "?".to_string())),
|
||||
).add_field("count", influxdb::Value::Integer(dq.len() as i64))
|
||||
.add_field("count", influxdb::Value::Integer(dq.len() as i64))
|
||||
.to_owned(),
|
||||
);
|
||||
|
||||
|
@ -314,10 +307,7 @@ pub fn window_service(
|
|||
|
||||
metrics::submit(
|
||||
influxdb::Point::new("window-stage")
|
||||
.add_field(
|
||||
"host",
|
||||
influxdb::Value::String(hostname().unwrap_or_else(|_| "?".to_string())),
|
||||
).add_field("consumed", influxdb::Value::Integer(consumed as i64))
|
||||
.add_field("consumed", influxdb::Value::Integer(consumed as i64))
|
||||
.to_owned(),
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue