pub struct MetricsStorageImpl<B: StorageBackend> { /* private fields */ }Expand description
A wrapper around StorageBackend that implements MetricsStorage
Implementations§
Source§impl<B: StorageBackend> MetricsStorageImpl<B>
impl<B: StorageBackend> MetricsStorageImpl<B>
Trait Implementations§
Source§impl<B: StorageBackend> MetricsStorage for MetricsStorageImpl<B>
impl<B: StorageBackend> MetricsStorage for MetricsStorageImpl<B>
Source§fn backend(&self) -> &dyn StorageBackend
fn backend(&self) -> &dyn StorageBackend
Get the underlying storage backend
Source§fn init<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn init<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize metrics storage (create schema-v2 tables, migrate pre-v2
metrics).Source§fn insert_metrics<'life0, 'async_trait>(
&'life0 self,
metrics: Vec<MetricRecord>,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn insert_metrics<'life0, 'async_trait>(
&'life0 self,
metrics: Vec<MetricRecord>,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert metrics into storage
Source§fn query_metrics<'life0, 'async_trait>(
&'life0 self,
from_timestamp: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<MetricRecord>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query_metrics<'life0, 'async_trait>(
&'life0 self,
from_timestamp: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<MetricRecord>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query metrics from storage
Source§fn aggregate_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
function: AggregateFunction,
group_by: &'life1 GroupBy,
from_timestamp: i64,
to_timestamp: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<AggregateResult>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn aggregate_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
function: AggregateFunction,
group_by: &'life1 GroupBy,
from_timestamp: i64,
to_timestamp: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<AggregateResult>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Aggregate metrics using the specified function and grouping
Source§fn get_metrics_schema() -> Schema
fn get_metrics_schema() -> Schema
Get the standard schema for metric records
Source§fn generate_metric_insert_sql() -> String
fn generate_metric_insert_sql() -> String
Generate SQL for inserting metric records
Source§fn generate_metric_query_sql(from_timestamp: i64) -> String
fn generate_metric_query_sql(from_timestamp: i64) -> String
Generate SQL for querying metrics
Source§fn generate_metric_aggregation_sql(
function: AggregateFunction,
group_by: &GroupBy,
from_timestamp: i64,
to_timestamp: Option<i64>,
) -> String
fn generate_metric_aggregation_sql( function: AggregateFunction, group_by: &GroupBy, from_timestamp: i64, to_timestamp: Option<i64>, ) -> String
Generate SQL for aggregating metrics
Auto Trait Implementations§
impl<B> Freeze for MetricsStorageImpl<B>where
B: Freeze,
impl<B> RefUnwindSafe for MetricsStorageImpl<B>where
B: RefUnwindSafe,
impl<B> Send for MetricsStorageImpl<B>
impl<B> Sync for MetricsStorageImpl<B>
impl<B> Unpin for MetricsStorageImpl<B>where
B: Unpin,
impl<B> UnsafeUnpin for MetricsStorageImpl<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for MetricsStorageImpl<B>where
B: UnwindSafe,
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more