Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fix Provisioner dispute metrics naming (#4374)
Browse files Browse the repository at this point in the history
* update dispute metric names

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* update

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
  • Loading branch information
sandreim authored Nov 26, 2021
1 parent e90ee61 commit 8d6c882
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions node/core/provisioner/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ struct MetricsInner {
request_inherent_data: prometheus::Histogram,
provisionable_data: prometheus::Histogram,

/// The `dispute_statement_*` metrics track how many disputes/votes the runtime will have to process. It will count
/// The following metrics track how many disputes/votes the runtime will have to process. These will count
/// all recent statements meaning every dispute from last sessions: 10 min on Rococo, 60 min on Kusama and
/// 4 hours on Polkadot. The metrics are updated only when the node authors a block, so values vary across nodes.
dispute_statement_sets_requested: prometheus::Counter<prometheus::U64>,
dispute_statements_requested: prometheus::CounterVec<prometheus::U64>,
inherent_data_dispute_statement_sets: prometheus::Counter<prometheus::U64>,
inherent_data_dispute_statements: prometheus::CounterVec<prometheus::U64>,
}

/// Provisioner metrics.
Expand Down Expand Up @@ -61,7 +61,7 @@ impl Metrics {
pub(crate) fn inc_valid_statements_by(&self, votes: usize) {
if let Some(metrics) = &self.0 {
metrics
.dispute_statements_requested
.inherent_data_dispute_statements
.with_label_values(&["valid"])
.inc_by(votes.try_into().unwrap_or(0));
}
Expand All @@ -70,7 +70,7 @@ impl Metrics {
pub(crate) fn inc_invalid_statements_by(&self, votes: usize) {
if let Some(metrics) = &self.0 {
metrics
.dispute_statements_requested
.inherent_data_dispute_statements
.with_label_values(&["invalid"])
.inc_by(votes.try_into().unwrap_or(0));
}
Expand All @@ -79,7 +79,7 @@ impl Metrics {
pub(crate) fn inc_dispute_statement_sets_by(&self, disputes: usize) {
if let Some(metrics) = &self.0 {
metrics
.dispute_statement_sets_requested
.inherent_data_dispute_statement_sets
.inc_by(disputes.try_into().unwrap_or(0));
}
}
Expand Down Expand Up @@ -112,20 +112,20 @@ impl metrics::Metrics for Metrics {
))?,
registry,
)?,
dispute_statements_requested: prometheus::register(
inherent_data_dispute_statements: prometheus::register(
prometheus::CounterVec::new(
prometheus::Opts::new(
"parachain_inherent_dispute_statements_requested",
"Number of inherent dispute statements requested.",
"parachain_inherent_data_dispute_statements",
"Number of dispute statements passed to `create_inherent()`.",
),
&["validity"],
)?,
&registry,
)?,
dispute_statement_sets_requested: prometheus::register(
inherent_data_dispute_statement_sets: prometheus::register(
prometheus::Counter::new(
"parachain_inherent_dispute_statement_sets_requested",
"Number of inherent DisputeStatementSets requested.",
"parachain_inherent_data_dispute_statement_sets",
"Number of dispute statements sets passed to `create_inherent()`.",
)?,
registry,
)?,
Expand Down

0 comments on commit 8d6c882

Please sign in to comment.