Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
ef0fdf42
Unverified
Commit
ef0fdf42
authored
Jun 13, 2021
by
asynchronous rob
Committed by
GitHub
Jun 13, 2021
Browse files
add metric for timing recovery and approval (#3228)
parent
19c1d29d
Pipeline
#142030
passed with stages
in 33 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
node/core/approval-voting/src/lib.rs
View file @
ef0fdf42
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment