pub struct TsAddOptions { /* private fields */ }
redis-time-series
only.Expand description
Options for the ts_add
command.
§Notes
- You can use this command to add data to a nonexisting time series in a single command.
This is why
retention
,encoding
,chunk_size
,on_duplicate
, andlabels
are optional arguments. - Setting
retention
andlabels
introduces additional time complexity.
Implementations§
Source§impl TsAddOptions
impl TsAddOptions
Sourcepub fn retention(self, retention_period: u64) -> Self
pub fn retention(self, retention_period: u64) -> Self
maximum retention period, compared to the maximum existing 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
.
Sourcepub fn encoding(self, encoding: TsEncoding) -> Self
pub fn encoding(self, encoding: TsEncoding) -> Self
specifies the series sample’s encoding format.
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
.
Sourcepub fn chunk_size(self, chunk_size: usize) -> Self
pub fn chunk_size(self, chunk_size: usize) -> 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
.
Sourcepub fn on_duplicate(self, policy: TsDuplicatePolicy) -> Self
pub fn on_duplicate(self, policy: TsDuplicatePolicy) -> Self
overwrite key and database configuration for
DUPLICATE_POLICY
Sourcepub fn labels<L: SingleArg, V: SingleArg, LL: KeyValueArgsCollection<L, V>>(
self,
labels: LL,
) -> Self
pub fn labels<L: SingleArg, V: SingleArg, LL: KeyValueArgsCollection<L, V>>( self, labels: LL, ) -> 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
.
The ts_mget
, ts_mrange
,
and ts_mrevrange
commands operate on multiple time series based on their labels.
The ts_queryindex
command returns all time series keys matching a given filter based on their labels.