Trait opendal::layers::observe::MetricsIntercept
source · pub trait MetricsIntercept: Debug + Clone + Send + Sync + Unpin + 'static {
// Required methods
fn observe_operation_duration_seconds(
&self,
scheme: Scheme,
namespace: Arc<String>,
root: Arc<String>,
path: &str,
op: Operation,
duration: Duration,
);
fn observe_operation_bytes(
&self,
scheme: Scheme,
namespace: Arc<String>,
root: Arc<String>,
path: &str,
op: Operation,
bytes: usize,
);
fn observe_operation_errors_total(
&self,
scheme: Scheme,
namespace: Arc<String>,
root: Arc<String>,
path: &str,
op: Operation,
error: ErrorKind,
);
}
Expand description
The interceptor for metrics.
All metrics related libs should implement this trait to observe opendal’s internal operations.
Required Methods§
sourcefn observe_operation_duration_seconds(
&self,
scheme: Scheme,
namespace: Arc<String>,
root: Arc<String>,
path: &str,
op: Operation,
duration: Duration,
)
fn observe_operation_duration_seconds( &self, scheme: Scheme, namespace: Arc<String>, root: Arc<String>, path: &str, op: Operation, duration: Duration, )
Observe the operation duration in seconds.
Object Safety§
This trait is not object safe.