TsIncrByDecrByOptions

Struct TsIncrByDecrByOptions 

Source
pub struct TsIncrByDecrByOptions<'a> { /* private fields */ }
Expand description

Options for the ts_incrby and ts_decrby commands.

§Notes

  • You can use this command to add data to a nonexisting time series in a single command. This is why retention, uncompressed, chunk_size, and labels are optional arguments.
  • When specified and the key doesn’t exist, a new time series is created. Setting the retention and labels options introduces additional time complexity.

Implementations§

Source§

impl<'a> TsIncrByDecrByOptions<'a>

Source

pub fn timestamp(self, timestamp: TsTimestamp) -> Self

is (integer) UNIX sample timestamp in milliseconds or * to set the timestamp according to the server clock.

timestamp must be equal to or higher than the maximum existing timestamp. When equal, the value of the sample with the maximum existing timestamp is decreased. If it is higher, a new sample with a timestamp set to timestamp is created, and its value is set to the value of the sample with the maximum existing timestamp minus value.

If the time series is empty, the value is set to value.

When not specified, the timestamp is set according to the server clock.

Source

pub fn retention(self, retention_period: u64) -> Self

maximum age for samples compared to the highest reported timestamp, in milliseconds.

Use it only if you are creating a new time series. It is ignored if you are adding samples to an existing time series

See retention.

Source

pub fn uncompressed(self) -> Self

changes data storage from compressed (default) to uncompressed.

Use it only if you are creating a new time series. It is ignored if you are adding samples to an existing time series. See encoding.

Source

pub fn chunk_size(self, chunk_size: u32) -> Self

memory size, in bytes, allocated for each data chunk.

Use it only if you are creating a new time series. It is ignored if you are adding samples to an existing time series. See chunk_size.

Source

pub fn labels(self, label: &'a str, value: &'a str) -> Self

set of label-value pairs that represent metadata labels of the time series.

Use it only if you are creating a new time series. It is ignored if you are adding samples to an existing time series. See labels.

Trait Implementations§

Source§

impl<'a> Default for TsIncrByDecrByOptions<'a>

Source§

fn default() -> TsIncrByDecrByOptions<'a>

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

impl<'a> Serialize for TsIncrByDecrByOptions<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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