redgold-schema 0.1.48

Decentralized Portfolio Contracts & Data Lake
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use metrics::counter;
use crate::RgResult;

pub trait WithMetrics {
    fn with_err_count(self, counter: impl Into<String>) -> Self;
}

impl<T> WithMetrics for RgResult<T> {
    fn with_err_count(self, counter: impl Into<String>) -> Self {
        counter!(counter.into()).increment(1);
        self
    }
}