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
bd83612d
Unverified
Commit
bd83612d
authored
May 21, 2021
by
Pierre Krieger
Committed by
GitHub
May 21, 2021
Browse files
Add `parachain_desired_peer_count` metric (#3035)
parent
3ffb048f
Pipeline
#138949
passed with stages
in 27 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
node/network/bridge/src/lib.rs
View file @
bd83612d
...
...
@@ -131,6 +131,14 @@ impl Metrics {
.inc_by
((
size
*
to_peers
)
as
u64
);
}
}
fn
note_desired_peer_count
(
&
self
,
peer_set
:
PeerSet
,
size
:
usize
)
{
self
.0
.as_ref
()
.map
(|
metrics
|
metrics
.desired_peer_count
.with_label_values
(
&
[
peer_set
.get_protocol_name_static
()])
.set
(
size
as
u64
)
);
}
}
#[derive(Clone)]
...
...
@@ -138,6 +146,7 @@ struct MetricsInner {
peer_count
:
prometheus
::
GaugeVec
<
prometheus
::
U64
>
,
connected_events
:
prometheus
::
CounterVec
<
prometheus
::
U64
>
,
disconnected_events
:
prometheus
::
CounterVec
<
prometheus
::
U64
>
,
desired_peer_count
:
prometheus
::
GaugeVec
<
prometheus
::
U64
>
,
notifications_received
:
prometheus
::
CounterVec
<
prometheus
::
U64
>
,
notifications_sent
:
prometheus
::
CounterVec
<
prometheus
::
U64
>
,
...
...
@@ -181,6 +190,16 @@ impl metrics::Metrics for Metrics {
)
?
,
registry
,
)
?
,
desired_peer_count
:
prometheus
::
register
(
prometheus
::
GaugeVec
::
new
(
prometheus
::
Opts
::
new
(
"parachain_desired_peer_count"
,
"The number of peers that the local node is expected to connect to on a parachain-related peer-set"
,
),
&
[
"protocol"
]
)
?
,
registry
,
)
?
,
notifications_received
:
prometheus
::
register
(
prometheus
::
CounterVec
::
new
(
prometheus
::
Opts
::
new
(
...
...
@@ -519,6 +538,8 @@ where
"Received a validator connection request"
,
);
metrics
.note_desired_peer_count
(
peer_set
,
validator_ids
.len
());
let
(
ns
,
ads
)
=
validator_discovery
.on_request
(
validator_ids
,
peer_set
,
...
...
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