This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Histogram support in runtime metrics #6935
Merged
Merged
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
52b28cb
Histogram support in runtime metrics
tdimitrov 2092b34
Add noops
tdimitrov 5beeec9
u64 instead of f64
tdimitrov 45993c4
Update buckets
tdimitrov af0563b
Wrap `get_current_time()` in runtime metrics
tdimitrov 6163ddd
Change the dimension of the Histogram from usec to sec
tdimitrov 06290b4
Fix a compilation error
tdimitrov 2229ec4
Update buckets
tdimitrov 846158c
Fix `on_signature_check_complete` calculation
tdimitrov 4256b6a
Update buckets
tdimitrov 141eb99
Update buckets
tdimitrov c08691b
formatting
tdimitrov 2adb739
Another weights update
tdimitrov beef22a
Adjust buckets again
tdimitrov fdd1449
Final buckets adjustment
tdimitrov 160475d
Revert "Fix a compilation error"
tdimitrov e0fd490
Merge branch 'master' into tsv-runtime-metrics
tdimitrov 9aa5b73
Update primitives/src/v4/metrics.rs
tdimitrov b382cdd
Use `saturating_sub` for time difference calculation
tdimitrov e13c772
Pass nanoseconds to client instead of seconds (using f64 in runtime i…
tdimitrov a1a0517
Merge branch 'master' into tsv-runtime-metrics
tdimitrov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ pub enum RuntimeMetricOp { | |
IncrementCounterVec(u64, RuntimeMetricLabelValues), | ||
/// Increment a counter metric by value. | ||
IncrementCounter(u64), | ||
/// Observe histogram value | ||
ObserveHistogram(u128), | ||
} | ||
|
||
/// Runtime metric update event. | ||
|
@@ -127,6 +129,16 @@ pub mod metric_definitions { | |
pub labels: &'a [&'static str], | ||
} | ||
|
||
/// `Histogram` metric definition | ||
pub struct HistogramDefinition<'a> { | ||
/// The name of the metric. | ||
pub name: &'static str, | ||
/// The description of the metric. | ||
pub description: &'static str, | ||
/// The buckets for the histogram | ||
pub buckets: &'a [f64], | ||
} | ||
|
||
/// Counts parachain inherent data weights. Use `before` and `after` labels to differentiate | ||
/// between the weight before and after filtering. | ||
pub const PARACHAIN_INHERENT_DATA_WEIGHT: CounterVecDefinition = CounterVecDefinition { | ||
|
@@ -176,4 +188,12 @@ pub mod metric_definitions { | |
description: "Counts the number of bitfields signature checked in `enter_inner`.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This metric doesn't work (before and after my changes) for some reason - it's not reported at all by prometheus. I'll investigate further. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've created a follow up issue for this: https://github.com/paritytech/polkadot/issues/6943 |
||
labels: &["validity"], | ||
}; | ||
|
||
/// Measures how much time does it take to verify a single validator signature of a dispute statement | ||
pub const PARACHAIN_VERIFY_DISPUTE_SIGNATURE: HistogramDefinition = | ||
HistogramDefinition { | ||
name: "polkadot_parachain_verify_dispute_signature", | ||
description: "How much time does it take to verify a single validator signature of a dispute statement, in seconds", | ||
buckets: &[0.0, 0.00005, 0.00006, 0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1, 0.3, 0.5, 1.0], | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
👍