Add more eth1 metrics (#728)

* Add metrics for junk eth1 votes

* Add eth1 cache metrics
This commit is contained in:
Paul Hauner
2019-12-17 10:20:27 +11:00
committed by GitHub
parent 61be1491a1
commit 34f003adb8
7 changed files with 61 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
use crate::metrics;
use eth1::{Config as Eth1Config, Eth1Block, Service as HttpService};
use eth2_hashing::hash;
use exit_future::Exit;
@@ -351,6 +352,8 @@ impl<T: EthSpec, S: Store<T>> Eth1ChainBackend<T> for CachingEth1Backend<T, S> {
fn random_eth1_data() -> Eth1Data {
let mut rng = rand::thread_rng();
metrics::inc_counter(&metrics::JUNK_ETH1_VOTES);
macro_rules! rand_bytes {
($num_bytes: expr) => {{
let mut arr = [0_u8; $num_bytes];

View File

@@ -153,6 +153,12 @@ lazy_static! {
pub static ref CHECKPOINT_CACHE_MISSES: Result<IntCounter> =
try_create_int_counter("beacon_checkpoint_cache_misses_total", "Count of times checkpoint cache fulfils request");
/*
* Eth1
*/
pub static ref JUNK_ETH1_VOTES: Result<IntCounter> =
try_create_int_counter("beacon_eth1_junk_votes", "Count of times we have voted junk for eth1 dat");
/*
* Chain Head
*/