/// Configure this panic handler to emit a panic count metric.
///
/// The metric is named `thread_panic_count_total` and is incremented each
/// time the panic handler is invoked.
Configure this panic handler to emit a panic count metric.
The metric is named `thread_panic_count_total` and is incremented each
time the panic handler is invoked.
Configure this panic handler to emit a panic count metric . The metric is named ` thread_panic_count_total ` and is incremented each time the panic handler is invoked .
pub fn with_metrics(self, metrics: &metric::Registry) -> Self {
        let panic_count = metrics
            .register_metric::<U64Counter>("thread_panic_count", "number of thread panics observed")
            .recorder(&[]);
        let old_hook = Arc::clone(self.old_panic_hook.as_ref().expect("no hook set"));
        panic::set_hook(Box::new(move |info| {
            panic_count.inc(1);
            tracing_panic_hook(&old_hook, info)
        }));
        self
    }
pub fn with_metrics ( self , metrics : & metric :: Registry ) -> Self { let panic_count = metrics . register_metric :: < U64Counter > ( " " , " " ) . recorder ( & [ ] ) ; let old_hook = Arc :: clone ( self . old_panic_hook . as_ref ( ) . expect ( " " ) ) ; panic :: set_hook ( Box :: new ( move | info | { panic_count . inc ( 1 ) ; tracing_panic_hook ( & old_hook , info ) } ) ) ; self }
Configure this panic handler to emit a panic count metric.
Configure this panic handler to emit a panic count metric .
self
metrics
&metric::Registry