Skip to content

Commit 6f28fcf

Browse files
v1.14: adds metrics tracking deduper saturations (backport of #30779) (#30852)
adds metrics tracking deduper saturations (#30779) (cherry picked from commit 4b595eb) Co-authored-by: behzad nouri <behzadnouri@gmail.com>
1 parent b9522c9 commit 6f28fcf

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

core/src/shred_fetch_stage.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ impl ShredFetchStage {
6363
let mut stats = ShredFetchStats::default();
6464

6565
for mut packet_batch in recvr {
66-
deduper.maybe_reset(&mut rng, DEDUPER_FALSE_POSITIVE_RATE, DEDUPER_RESET_CYCLE);
66+
if deduper.maybe_reset(&mut rng, DEDUPER_FALSE_POSITIVE_RATE, DEDUPER_RESET_CYCLE) {
67+
stats.num_deduper_saturations += 1;
68+
}
6769
if last_updated.elapsed().as_millis() as u64 > DEFAULT_MS_PER_SLOT {
6870
last_updated = Instant::now();
6971
{

core/src/sigverify_stage.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ struct SigVerifierStats {
8080
dedup_packets_pp_us_hist: histogram::Histogram, // per-packet time to call verify_batch
8181
batches_hist: histogram::Histogram, // number of packet batches per verify call
8282
packets_hist: histogram::Histogram, // number of packets per verify call
83+
num_deduper_saturations: usize,
8384
total_batches: usize,
8485
total_packets: usize,
8586
total_dedup: usize,
@@ -196,6 +197,7 @@ impl SigVerifierStats {
196197
("packets_min", self.packets_hist.minimum().unwrap_or(0), i64),
197198
("packets_max", self.packets_hist.maximum().unwrap_or(0), i64),
198199
("packets_mean", self.packets_hist.mean().unwrap_or(0), i64),
200+
("num_deduper_saturations", self.num_deduper_saturations, i64),
199201
("total_batches", self.total_batches, i64),
200202
("total_packets", self.total_packets, i64),
201203
("total_dedup", self.total_dedup, i64),
@@ -418,7 +420,9 @@ impl SigVerifyStage {
418420
let mut rng = rand::thread_rng();
419421
let mut deduper = Deduper::<2>::new(&mut rng, DEDUPER_NUM_BITS);
420422
loop {
421-
deduper.maybe_reset(&mut rng, DEDUPER_FALSE_POSITIVE_RATE, MAX_DEDUPER_AGE);
423+
if deduper.maybe_reset(&mut rng, DEDUPER_FALSE_POSITIVE_RATE, MAX_DEDUPER_AGE) {
424+
stats.num_deduper_saturations += 1;
425+
}
422426
if let Err(e) =
423427
Self::verifier(&deduper, &packet_receiver, &mut verifier, &mut stats)
424428
{

ledger/src/shred/stats.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pub struct ProcessShredsStats {
3232
pub struct ShredFetchStats {
3333
pub index_overrun: usize,
3434
pub shred_count: usize,
35+
pub num_deduper_saturations: usize,
3536
pub(crate) num_shreds_merkle_code: usize,
3637
pub(crate) num_shreds_merkle_data: usize,
3738
pub ping_count: usize,
@@ -117,6 +118,7 @@ impl ShredFetchStats {
117118
name,
118119
("index_overrun", self.index_overrun, i64),
119120
("shred_count", self.shred_count, i64),
121+
("num_deduper_saturations", self.num_deduper_saturations, i64),
120122
("num_shreds_merkle_code", self.num_shreds_merkle_code, i64),
121123
("num_shreds_merkle_data", self.num_shreds_merkle_data, i64),
122124
("ping_count", self.ping_count, i64),

0 commit comments

Comments
 (0)