Skip to content

Commit

Permalink
Appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed Mar 18, 2021
1 parent 99586de commit d50d5da
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions beacon_node/http_metrics/src/explorer_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub use lighthouse_metrics::*;

/// Process names which need to be encoded
/// Note: Only Gauge and Counter metrics can be encoded.
pub const BEACON_PROCESS_METRICS: &'static [&str] = &[
pub const BEACON_PROCESS_METRICS: &[&str] = &[
"cpu_process_seconds_total",
"process_virtual_memory_bytes",
"sync_eth1_fallback_configured",
Expand All @@ -23,7 +23,7 @@ pub fn gather_required_metrics<T: BeaconChainTypes>(
let mut buffer = vec![];
let encoder = JsonEncoder::new(
BEACON_PROCESS_METRICS
.into_iter()
.iter()
.map(|m| m.to_string())
.collect(),
);
Expand Down
18 changes: 6 additions & 12 deletions common/explorer_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,9 @@ impl ExplorerHttpClient {

/// Gets beacon metrics and updates the metrics struct
pub async fn get_beacon_metrics(&self) -> Result<ExplorerMetrics, Error> {
let path = self
.beacon_endpoint
.clone()
.ok_or(Error::BeaconMetricsFailed(
"Beacon metrics endpoint not provided".to_string(),
))?;
let path = self.beacon_endpoint.clone().ok_or_else(|| {
Error::BeaconMetricsFailed("Beacon metrics endpoint not provided".to_string())
})?;
let resp: BeaconProcessMetrics = self.get(path).await?;
Ok(ExplorerMetrics {
metadata: Metadata::new(ProcessType::Beacon),
Expand All @@ -159,12 +156,9 @@ impl ExplorerHttpClient {

/// Gets validator process metrics by querying the validator metrics endpoint
pub async fn get_validator_metrics(&self) -> Result<ExplorerMetrics, Error> {
let path = self
.validator_endpoint
.clone()
.ok_or(Error::ValidatorMetricsFailed(
"Validator metrics endpoint not provided".to_string(),
))?;
let path = self.validator_endpoint.clone().ok_or_else(|| {
Error::ValidatorMetricsFailed("Validator metrics endpoint not provided".to_string())
})?;
let resp: ValidatorProcessMetrics = self.get(path).await?;
Ok(ExplorerMetrics {
metadata: Metadata::new(ProcessType::Beacon),
Expand Down
1 change: 1 addition & 0 deletions common/lighthouse_version/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use git_version::git_version;
use target_info::Target;

/// Returns the version number.
pub const VERSION_NUMBER: &str = "1.1.3";

/// Returns the current version of this build of Lighthouse.
Expand Down
4 changes: 2 additions & 2 deletions validator_client/src/http_metrics/explorer_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use lighthouse_metrics::*;

/// Process names which need to be encoded
/// Note: Only Gauge and Counter metric types can be encoded.
pub const VALIDATOR_PROCESS_METRICS: &'static [&str] = &[
pub const VALIDATOR_PROCESS_METRICS: &[&str] = &[
"cpu_process_seconds_total",
"process_virtual_memory_bytes",
"vc_validators_enabled_count",
Expand All @@ -22,7 +22,7 @@ pub fn gather_required_metrics<T: EthSpec>(
let mut buffer = vec![];
let encoder = JsonEncoder::new(
VALIDATOR_PROCESS_METRICS
.into_iter()
.iter()
.map(|m| m.to_string())
.collect(),
);
Expand Down

0 comments on commit d50d5da

Please sign in to comment.