Skip to content

Commit

Permalink
Fix linux imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed May 24, 2021
1 parent ac5d90e commit 18ea6c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions common/eth2/src/lighthouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ use crate::{
BeaconNodeHttpClient, DepositData, Error, Eth1Data, Hash256, StateId, StatusCode,
};
use proto_array::core::ProtoArray;
use psutil::cpu::os::linux::CpuTimesExt;
use psutil::memory::os::linux::VirtualMemoryExt;
use reqwest::IntoUrl;
use serde::{Deserialize, Serialize};
use ssz::Decode;
use ssz_derive::{Decode, Encode};
use std::time::UNIX_EPOCH;

pub use eth2_libp2p::{types::SyncState, PeerInfo};

Expand Down Expand Up @@ -79,7 +76,10 @@ pub struct ValidatorInclusionData {
}

#[cfg(target_os = "linux")]
use {procinfo::pid, psutil::process::Process};
use {
procinfo::pid, psutil::cpu::os::linux::CpuTimesExt,
psutil::memory::os::linux::VirtualMemoryExt, psutil::process::Process,
};

/// Reports on the health of the Lighthouse instance.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
Expand Down Expand Up @@ -180,7 +180,7 @@ impl SystemHealth {

let boot_time = psutil::host::boot_time()
.map_err(|e| format!("Unable to get system boot time: {:?}", e))?
.duration_since(UNIX_EPOCH)
.duration_since(std::time::UNIX_EPOCH)
.map_err(|e| format!("Boot time is lower than unix epoch: {}", e))?
.as_secs();

Expand Down

0 comments on commit 18ea6c3

Please sign in to comment.