Skip to content

Commit

Permalink
feat: add metric for number of chunks excluded from the block due to …
Browse files Browse the repository at this point in the history
…insufficient endorsement (#12562)
  • Loading branch information
pugachAG authored Dec 6, 2024
1 parent 0287e07 commit 5196eb9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chain/client/src/chunk_inclusion_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ impl ChunkInclusionTracker {
(stats.total_validators_count.saturating_sub(stats.endorsed_validators_count))
as f64,
);
if !stats.is_endorsed {
metrics::BLOCK_PRODUCER_INSUFFICIENT_ENDORSEMENT_CHUNK_COUNT
.with_label_values(label_values)
.inc();
}
}
}
}
10 changes: 10 additions & 0 deletions chain/client/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,16 @@ pub(crate) static ORPHAN_CHUNK_STATE_WITNESS_POOL_MEMORY_USED: LazyLock<IntGauge
.unwrap()
});

pub(crate) static BLOCK_PRODUCER_INSUFFICIENT_ENDORSEMENT_CHUNK_COUNT: LazyLock<CounterVec> =
LazyLock::new(|| {
try_create_counter_vec(
"near_block_producer_insufficient_endorsement_chunk_count",
"Number of chunks excluded from the block due to insufficient chunk endorsements",
&["shard_id"],
)
.unwrap()
});

pub(crate) static BLOCK_PRODUCER_ENDORSED_STAKE_RATIO: LazyLock<HistogramVec> =
LazyLock::new(|| {
try_create_histogram_vec(
Expand Down

0 comments on commit 5196eb9

Please sign in to comment.