Add prometheus metrics for block authorship (#10316)

* Add prom metric  to basic authorship

* Add proposer_block_proposal_time

* +nightly-2021-10-29 fmt

* Use saturating_duration_since, not elasped

* Update client/basic-authorship/src/basic_authorship.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/basic-authorship/src/basic_authorship.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* +nightly-2021-10-29 fmt

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Zeke Mostov
2021-11-19 16:14:21 +01:00
committed by GitHub
parent d0b851abe9
commit 5ea4823dab
2 changed files with 38 additions and 1 deletions
@@ -47,6 +47,8 @@ impl MetricsLink {
pub struct Metrics {
pub block_constructed: Histogram,
pub number_of_transactions: Gauge<U64>,
pub create_inherents_time: Histogram,
pub create_block_proposal_time: Histogram,
}
impl Metrics {
@@ -66,6 +68,20 @@ impl Metrics {
)?,
registry,
)?,
create_inherents_time: register(
Histogram::with_opts(HistogramOpts::new(
"proposer_create_inherents_time",
"Histogram of time taken to execute create inherents",
))?,
registry,
)?,
create_block_proposal_time: register(
Histogram::with_opts(HistogramOpts::new(
"proposer_block_proposal_time",
"Histogram of time taken to construct a block and prepare it for proposal",
))?,
registry,
)?,
})
}
}