Add global metrics registry, pass to BeaconState

This commit is contained in:
Paul Hauner
2019-05-28 17:30:09 +10:00
parent e756a0aaa4
commit 345f7d5f18
10 changed files with 109 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
use beacon_chain::{BeaconChain, BeaconChainTypes};
use iron::typemap::Key;
use prometheus::Registry;
use std::marker::PhantomData;
use std::sync::Arc;
@@ -10,3 +11,9 @@ pub struct BeaconChainKey<T> {
impl<T: BeaconChainTypes + 'static> Key for BeaconChainKey<T> {
type Value = Arc<BeaconChain<T>>;
}
pub struct MetricsRegistryKey;
impl Key for MetricsRegistryKey {
type Value = Registry;
}