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§

source

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.

source

fn observe_operation_bytes( &self, scheme: Scheme, namespace: Arc<String>, root: Arc<String>, path: &str, op: Operation, bytes: usize, )

Observe the operation bytes happened in IO like read and write.

source

fn observe_operation_errors_total( &self, scheme: Scheme, namespace: Arc<String>, root: Arc<String>, path: &str, op: Operation, error: ErrorKind, )

Observe the operation errors total.

Object Safety§

This trait is not object safe.

Implementors§