-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add prometheus metrics for block authorship #10316
Add prometheus metrics for block authorship #10316
Conversation
self.metrics.report(|metrics| { | ||
metrics | ||
.create_inherents_time | ||
.observe(create_inherents_timer.elapsed().as_secs_f64()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.observe(create_inherents_timer.elapsed().as_secs_f64()); | |
.observe(create_inherents_timer.elapsed().as_secs_f64()); |
Please use saturating_duration_since
here and below. We already have seen that calls like this panicked because of some fault timers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f7ca1df
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM besides the mentioned need to use https://doc.rust-lang.org/std/time/struct.Instant.html#method.saturating_duration_since rather than fn elapsed(..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to change the order, otherwise looks good.
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
bot merge |
Waiting for commit status. |
* 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>
* 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>
closes paritytech/polkadot#4327
New metrics:
proposer_block_proposal_time
: Time to create a block for proposal. This is a superset of bothproposer_block_constructed
andcreate_inherents_time
.proposer_create_inherents_time
: Time to create the inherents for the block that is about to be constructed. This is a subset ofproposer_block_proposal_time
but does not overlap withproposer_block_constructed
.Existing metrics:
proposer_block_constructed
: Time to construct a block for proposal. This is a subset ofproposer_block_proposal_time
and does not overlap withpropser_create_inherents_time
block_verification_time
: Time to verify a block (takes place directly prior to importing)block_verification_and_import_time
: Time to verify a block and then import a block. A superset ofblock_verification_time