struct Series {
desc: String,
attrs: String,
points: Vec<(i64, Pt)>,
dropped: usize,
exemplars: Vec<(i64, String)>,
}Fields§
§desc: StringRendered "name":...,"unit":..., etc. Built once when the series is
first seen; identical for every point in it by construction.
attrs: StringRendered {...} attribute object.
points: Vec<(i64, Pt)>§dropped: usizePoints dropped by max_points, reported rather than hidden. A chart
missing its spike because the engine quietly truncated is the failure
mode this exists to prevent.
exemplars: Vec<(i64, String)>The trace ids behind the points: (time, rendered object), rendered
here because the block they were read from is unmapped before the
response is written.
Implementations§
Source§impl Series
impl Series
Sourcefn compact(&mut self, max: usize)
fn compact(&mut self, max: usize)
Discard all but the newest max points.
Which points a cap keeps is a correctness question, not a tuning one.
Points arrive in block-scan order, so refusing them once the buffer is
full kept whichever ones the directory listing happened to reach first
— an arbitrary subset that the sort at render time then dressed up as a
contiguous series. Newest-wins is the same rule limit already uses on
the record side, and it is a window a reader can reason about.
Called at twice max, so every call throws away half of what it sorts
and the amortised cost is constant per point. A bounded heap would hold
exactly max at all times and pay log max on every point instead;
at these sizes the occasional sort is cheaper and much less code.
ponytail: truncation, not downsampling. A chart that needs the whole
range at a lower resolution needs an aggregation window — until that
exists the response says dropped_points rather than pretending.
Auto Trait Implementations§
impl Freeze for Series
impl RefUnwindSafe for Series
impl Send for Series
impl Sync for Series
impl Unpin for Series
impl UnsafeUnpin for Series
impl UnwindSafe for Series
Blanket Implementations§
impl<T> Allocation 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
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>,
Layered].