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];