TsMRangeOptions

Struct TsMRangeOptions 

Source
pub struct TsMRangeOptions { /* private fields */ }
Expand description

Options for the ts_mrange and ts_mrevrange commands.

Implementations§

Source§

impl TsMRangeOptions

Source

pub fn latest(self) -> Self

Used when a time series is a compaction.

With latest, ts_mrange also reports the compacted value of the latest possibly partial bucket, given that this bucket’s start time falls within [from_timestamp, to_timestamp]. Without latest, ts_mrange does not report the latest possibly partial bucket. When a time series is not a compaction, latest is ignored.

The data in the latest bucket of a compaction is possibly partial. A bucket is closed and compacted only upon arrival of a new sample that opens a new latest bucket. There are cases, however, when the compacted value of the latest possibly partial bucket is also required. In such a case, use latest.

Source

pub fn filter_by_ts(self, ts: impl Args) -> Self

filters samples by a list of specific timestamps.

A sample passes the filter if its exact timestamp is specified and falls within [from_timestamp, to_timestamp].

Source

pub fn filter_by_value(self, min: f64, max: f64) -> Self

filters samples by minimum and maximum values.

Source

pub fn withlabels(self) -> Self

Includes in the reply all label-value pairs representing metadata labels of the time series.

If withlabels or selected_labels are not specified, by default, an empty list is reported as label-value pairs.

Source

pub fn selected_labels(self, labels: impl Args) -> Self

returns a subset of the label-value pairs that represent metadata labels of the time series.

Use when a large number of labels exists per series, but only the values of some of the labels are required. If withlabels or selected_labels are not specified, by default, an empty list is reported as label-value pairs.

Source

pub fn count(self, count: usize) -> Self

limits the number of returned samples.

Source

pub fn align(self, align: impl Args) -> Self

A time bucket alignment control for aggregation.

It controls the time bucket timestamps by changing the reference timestamp on which a bucket is defined.

Values include:

  • start or -: The reference timestamp will be the query start interval time (from_timestamp) which can’t be -
  • end or +: The reference timestamp will be the query end interval time (to_timestamp) which can’t be +
  • A specific timestamp: align the reference timestamp to a specific time
§Note

When not provided, alignment is set to 0.

Source

pub fn aggregation( self, aggregator: TsAggregationType, bucket_duration: u64, ) -> Self

Aggregates results into time buckets, where:

  • aggregator - takes a value of TsAggregationType
  • bucket_duration - is duration of each bucket, in milliseconds.

Without align, bucket start times are multiples of bucket_duration.

With align, bucket start times are multiples of bucket_duration with remainder align % bucket_duration.

The first bucket start time is less than or equal to from_timestamp.

Source

pub fn bucket_timestamp(self, bucket_timestamp: u64) -> Self

controls how bucket timestamps are reported. bucket_timestamp values include:

  • - or low - Timestamp reported for each bucket is the bucket’s start time (default)
  • + or high - Timestamp reported for each bucket is the bucket’s end time
  • ~ or mid - Timestamp reported for each bucket is the bucket’s mid time (rounded down if not an integer)
Source

pub fn empty(self) -> Self

A flag, which, when specified, reports aggregations also for empty buckets. when aggregator values are:

  • sum, count - the value reported for each empty bucket is 0
  • last - the value reported for each empty bucket is the value of the last sample before the bucket’s start. NaN when no such sample.
  • twa - the value reported for each empty bucket is the average value over the bucket’s timeframe based on linear interpolation of the last sample before the bucket’s start and the first sample after the bucket’s end. NaN when no such samples.
  • min, max, range, avg, first, std.p, std.s - the value reported for each empty bucket is NaN

Regardless of the values of from_timestamp and to_timestamp, no data is reported for buckets that end before the earliest sample or begin after the latest sample in the time series.

Trait Implementations§

Source§

impl Args for TsMRangeOptions

Source§

fn write_args(&self, args: &mut CommandArgs)

Write this Rust type as one ore multiple args into CommandArgs. Read more
Source§

fn num_args(&self) -> usize

Number arguments generated by this Rust type
Source§

impl Default for TsMRangeOptions

Source§

fn default() -> TsMRangeOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V