From 36ff115b04a90f767e08d5b52754a643aa2c950d Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Sun, 11 Aug 2019 14:46:20 +1000 Subject: [PATCH] Use global prometheus gather at rest api --- beacon_node/beacon_chain/src/metrics.rs | 4 ---- beacon_node/rest_api/src/metrics.rs | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/beacon_node/beacon_chain/src/metrics.rs b/beacon_node/beacon_chain/src/metrics.rs index 417c2904a..dc2919cc4 100644 --- a/beacon_node/beacon_chain/src/metrics.rs +++ b/beacon_node/beacon_chain/src/metrics.rs @@ -116,7 +116,3 @@ lazy_static! { pub static ref FORK_CHOICE_TIMES: Result = register_histogram!("fork_choice_time", "Full runtime of fork choice"); } - -pub fn gather_metrics() -> Vec { - prometheus::gather() -} diff --git a/beacon_node/rest_api/src/metrics.rs b/beacon_node/rest_api/src/metrics.rs index 1ecdf8b68..b0f5b8605 100644 --- a/beacon_node/rest_api/src/metrics.rs +++ b/beacon_node/rest_api/src/metrics.rs @@ -7,9 +7,7 @@ pub fn get_prometheus(_req: Request) -> ApiResult { let mut buffer = vec![]; let encoder = TextEncoder::new(); - encoder - .encode(&beacon_chain::gather_metrics(), &mut buffer) - .unwrap(); + encoder.encode(&prometheus::gather(), &mut buffer).unwrap(); String::from_utf8(buffer) .map(|string| success_response(Body::from(string)))