Skip to content
Snippets Groups Projects
Commit 51d68b6d authored by parity-processbot[bot]'s avatar parity-processbot[bot] Committed by GitHub
Browse files

Merge 324e51fb into master

parents a564cafa 324e51fb
No related merge requests found
...@@ -60,7 +60,7 @@ use futures_timer::Delay; ...@@ -60,7 +60,7 @@ use futures_timer::Delay;
use codec::{Decode, Encode}; use codec::{Decode, Encode};
use error::{Error, Result}; use error::{Error, Result};
use log::{debug, error, log_enabled, warn}; use log::{debug, error, log_enabled};
use prometheus_endpoint::{Counter, CounterVec, Gauge, Opts, U64, register}; use prometheus_endpoint::{Counter, CounterVec, Gauge, Opts, U64, register};
use prost::Message; use prost::Message;
use sc_client_api::blockchain::HeaderBackend; use sc_client_api::blockchain::HeaderBackend;
...@@ -328,7 +328,11 @@ where ...@@ -328,7 +328,11 @@ where
} }
if let Err(e) = self.handle_dht_value_found_event(v) { if let Err(e) = self.handle_dht_value_found_event(v) {
error!( if let Some(metrics) = &self.metrics {
metrics.handle_value_found_event_failure.inc();
}
debug!(
target: LOG_TARGET, target: LOG_TARGET,
"Failed to handle Dht value found event: {:?}", e, "Failed to handle Dht value found event: {:?}", e,
); );
...@@ -359,7 +363,7 @@ where ...@@ -359,7 +363,7 @@ where
metrics.dht_event_received.with_label_values(&["value_put_failed"]).inc(); metrics.dht_event_received.with_label_values(&["value_put_failed"]).inc();
} }
warn!( debug!(
target: LOG_TARGET, target: LOG_TARGET,
"Failed to put hash '{:?}' on Dht.", hash "Failed to put hash '{:?}' on Dht.", hash
) )
...@@ -603,6 +607,7 @@ pub(crate) struct Metrics { ...@@ -603,6 +607,7 @@ pub(crate) struct Metrics {
amount_last_published: Gauge<U64>, amount_last_published: Gauge<U64>,
request: Counter<U64>, request: Counter<U64>,
dht_event_received: CounterVec<U64>, dht_event_received: CounterVec<U64>,
handle_value_found_event_failure: Counter<U64>,
priority_group_size: Gauge<U64>, priority_group_size: Gauge<U64>,
} }
...@@ -642,6 +647,13 @@ impl Metrics { ...@@ -642,6 +647,13 @@ impl Metrics {
)?, )?,
registry, registry,
)?, )?,
handle_value_found_event_failure: register(
Counter::new(
"authority_discovery_handle_value_found_event_failure",
"Number of times handling a dht value found event failed."
)?,
registry,
)?,
priority_group_size: register( priority_group_size: register(
Gauge::new( Gauge::new(
"authority_discovery_priority_group_size", "authority_discovery_priority_group_size",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment