adds metrics tracking crds writes and votes (#20953)

This commit is contained in:
behzad nouri
2021-10-26 13:02:30 +00:00
committed by GitHub
parent cd5e690427
commit 1297a13586
14 changed files with 544 additions and 111 deletions

View File

@@ -5,7 +5,7 @@ extern crate test;
use {
rand::{thread_rng, Rng},
solana_gossip::{
crds::{Crds, VersionedCrdsValue},
crds::{Crds, GossipRoute, VersionedCrdsValue},
crds_shards::CrdsShards,
crds_value::CrdsValue,
},
@@ -20,7 +20,8 @@ fn new_test_crds_value<R: Rng>(rng: &mut R) -> VersionedCrdsValue {
let value = CrdsValue::new_rand(rng, None);
let label = value.label();
let mut crds = Crds::default();
crds.insert(value, timestamp()).unwrap();
crds.insert(value, timestamp(), GossipRoute::LocalMessage)
.unwrap();
crds.get::<&VersionedCrdsValue>(&label).cloned().unwrap()
}