Pass Prometheus Registry into Client (#5120)

* Add a few metrics to Client

* Improve PrometheusConfig

* Fix client docs
This commit is contained in:
Gavin Wood
2020-03-05 13:40:33 +01:00
committed by GitHub
parent 7177ad5cf0
commit 906e08ee2a
13 changed files with 59 additions and 55 deletions
+3
View File
@@ -28,6 +28,7 @@ use sp_core::traits::CodeExecutor;
use sp_runtime::BuildStorage;
use sp_runtime::traits::{Block as BlockT, HashFor};
use sp_blockchain::Result as ClientResult;
use prometheus_endpoint::Registry;
use crate::call_executor::LocalCallExecutor;
use crate::client::Client;
@@ -58,6 +59,7 @@ pub fn new_light<B, S, GS, RA, E>(
backend: Arc<Backend<S, HashFor<B>>>,
genesis_storage: &GS,
code_executor: E,
prometheus_registry: Option<Registry>,
) -> ClientResult<
Client<
Backend<S, HashFor<B>>,
@@ -84,6 +86,7 @@ pub fn new_light<B, S, GS, RA, E>(
Default::default(),
Default::default(),
Default::default(),
prometheus_registry,
)
}