pub struct TailCutLayer { /* private fields */ }Expand description
Layer that automatically cancels long-tail requests.
This layer monitors request latency distribution and cancels requests that are significantly slower than the historical baseline (e.g., slower than P95).
This layer should be created via TailCutLayer::builder() and can be
cloned to share statistics across multiple operators.
§Examples
use opendal::layers::TailCutLayer;
use std::time::Duration;
let layer = TailCutLayer::builder()
.percentile(95)
.safety_factor(1.3)
.window(Duration::from_secs(60))
.build();
let op = Operator::new(services::Memory::default())?
.layer(layer)
.finish();Implementations§
Source§impl TailCutLayer
impl TailCutLayer
Sourcepub fn builder() -> TailCutLayerBuilder
pub fn builder() -> TailCutLayerBuilder
Create a builder to configure the layer.
Trait Implementations§
Source§impl Clone for TailCutLayer
impl Clone for TailCutLayer
Source§fn clone(&self) -> TailCutLayer
fn clone(&self) -> TailCutLayer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for TailCutLayer
impl Default for TailCutLayer
Source§impl<A: Access> Layer<A> for TailCutLayer
impl<A: Access> Layer<A> for TailCutLayer
Source§type LayeredAccess = TailCutAccessor<A>
type LayeredAccess = TailCutAccessor<A>
The layered accessor that returned by this layer.
Source§fn layer(&self, inner: A) -> Self::LayeredAccess
fn layer(&self, inner: A) -> Self::LayeredAccess
Intercept the operations on the underlying storage.
Auto Trait Implementations§
impl Freeze for TailCutLayer
impl RefUnwindSafe for TailCutLayer
impl Send for TailCutLayer
impl Sync for TailCutLayer
impl Unpin for TailCutLayer
impl UnwindSafe for TailCutLayer
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§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
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
Source§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
Source§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