mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 20:17:57 +00:00
Decorate mpsc-notification-to-protocol with the protocol name (#3873)
Currently, all protocols use the same metric name for `mpsc-notification-to-protocol` this is bad because we can't actually tell which protocol might cause problems. This patch proposes we derive the name of the metric from the protocol name, so that we have separate metrics for each protocol and properly detect which one is having problem processing its messages. --------- Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
This commit is contained in:
committed by
GitHub
parent
b310b575cd
commit
5638d1a830
@@ -86,7 +86,7 @@ pub fn tracing_unbounded<T>(
|
||||
warning_fired: Arc::new(AtomicBool::new(false)),
|
||||
creation_backtrace: Arc::new(Backtrace::force_capture()),
|
||||
};
|
||||
let receiver = TracingUnboundedReceiver { inner: r, name };
|
||||
let receiver = TracingUnboundedReceiver { inner: r, name: name.into() };
|
||||
(sender, receiver)
|
||||
}
|
||||
|
||||
@@ -157,6 +157,11 @@ impl<T> TracingUnboundedReceiver<T> {
|
||||
pub fn len(&self) -> usize {
|
||||
self.inner.len()
|
||||
}
|
||||
|
||||
/// The name of this receiver
|
||||
pub fn name(&self) -> &'static str {
|
||||
self.name
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Drop for TracingUnboundedReceiver<T> {
|
||||
|
||||
Reference in New Issue
Block a user