Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
428a4178
Commit
428a4178
authored
3 years ago
by
asynchronous rob
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add metric for timing recovery and approval (#3228)
parent
5bc2b277
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
polkadot/node/core/approval-voting/src/lib.rs
+19
-0
19 additions, 0 deletions
polkadot/node/core/approval-voting/src/lib.rs
with
19 additions
and
0 deletions
polkadot/node/core/approval-voting/src/lib.rs
+
19
−
0
View file @
428a4178
...
...
@@ -128,6 +128,7 @@ struct MetricsInner {
candidate_approval_time_ticks
:
prometheus
::
Histogram
,
block_approval_time_ticks
:
prometheus
::
Histogram
,
time_db_transaction
:
prometheus
::
Histogram
,
time_recover_and_approve
:
prometheus
::
Histogram
,
}
/// Aproval Voting metrics.
...
...
@@ -180,6 +181,10 @@ impl Metrics {
fn
time_db_transaction
(
&
self
)
->
Option
<
metrics
::
prometheus
::
prometheus
::
HistogramTimer
>
{
self
.0
.as_ref
()
.map
(|
metrics
|
metrics
.time_db_transaction
.start_timer
())
}
fn
time_recover_and_approve
(
&
self
)
->
Option
<
metrics
::
prometheus
::
prometheus
::
HistogramTimer
>
{
self
.0
.as_ref
()
.map
(|
metrics
|
metrics
.time_recover_and_approve
.start_timer
())
}
}
impl
metrics
::
Metrics
for
Metrics
{
...
...
@@ -249,6 +254,15 @@ impl metrics::Metrics for Metrics {
)
?
,
registry
,
)
?
,
time_recover_and_approve
:
prometheus
::
register
(
prometheus
::
Histogram
::
with_opts
(
prometheus
::
HistogramOpts
::
new
(
"parachain_time_recover_and_approve"
,
"Time spent recovering and approving data in approval voting"
,
)
)
?
,
registry
,
)
?
,
};
Ok
(
Metrics
(
Some
(
metrics
)))
...
...
@@ -729,6 +743,7 @@ async fn handle_actions(
let
handle
=
launch_approval
(
ctx
,
metrics
.clone
(),
background_tx
.clone
(),
session
,
&
candidate
,
...
...
@@ -1857,6 +1872,7 @@ fn process_wakeup(
// to cancel the background work and any requests it has spawned.
async
fn
launch_approval
(
ctx
:
&
mut
impl
SubsystemContext
,
metrics
:
Metrics
,
mut
background_tx
:
mpsc
::
Sender
<
BackgroundRequest
>
,
session_index
:
SessionIndex
,
candidate
:
&
CandidateReceipt
,
...
...
@@ -1877,6 +1893,7 @@ async fn launch_approval(
"Recovering data."
,
);
let
timer
=
metrics
.time_recover_and_approve
();
ctx
.send_message
(
AvailabilityRecoveryMessage
::
RecoverAvailableData
(
candidate
.clone
(),
session_index
,
...
...
@@ -1896,6 +1913,8 @@ async fn launch_approval(
let
candidate
=
candidate
.clone
();
let
background
=
async
move
{
// Force the move of the timer into the background task.
let
_timer
=
timer
;
let
_span
=
jaeger
::
Span
::
from_encodable
((
block_hash
,
candidate_hash
),
"launch-approval"
)
.with_relay_parent
(
block_hash
)
.with_candidate
(
candidate_hash
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment