Fix windows build by removing sys-info (#8860)

Doesn't build for windows.
This commit is contained in:
sakridge
2020-03-16 12:53:13 -07:00
committed by GitHub
parent 0641244378
commit 7079559c2d
10 changed files with 25 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
//! The `metrics` module enables sending measurements to an `InfluxDB` instance
use crate::{counter::CounterPoint, datapoint::DataPoint};
use gethostname::gethostname;
use lazy_static::lazy_static;
use log::*;
use solana_sdk::hash::hash;
@@ -11,7 +12,6 @@ use std::sync::{Arc, Barrier, Mutex, Once, RwLock};
use std::thread;
use std::time::{Duration, Instant};
use std::{cmp, env};
use sys_info::hostname;
type CounterMap = HashMap<(&'static str, u64), CounterPoint>;
@@ -317,7 +317,9 @@ fn get_singleton_agent() -> Arc<Mutex<MetricsAgent>> {
lazy_static! {
static ref HOST_ID: Arc<RwLock<String>> = {
Arc::new(RwLock::new({
let hostname: String = hostname().unwrap_or_else(|_| "".to_string());
let hostname: String = gethostname()
.into_string()
.unwrap_or_else(|_| "".to_string());
format!("{}", hash(hostname.as_bytes()))
}))
};