Time series

Time series with retention, compaction rules, labels, and queries across many series at once (TS.*).

21 commands in KiviDB 1.1.2. Every command.

  • TS.ADD: Adds a sample to the time series at key: timestamp in milliseconds, or * for the server's clock, and value, a floating-point number or NaN.
  • TS.ALTER: Changes a time series' retention, chunk size, duplicate policy or labels.
  • TS.CREATE: Creates a time series at key: samples, each a timestamp in milliseconds and a floating-point value, kept in timestamp order.
  • TS.CREATERULE: Creates a compaction rule: every sample added to sourceKey is aggregated, by agg over buckets of bucketDuration milliseconds, into the existing series destKey.
  • TS.DECRBY: TS.INCRBY, subtracting.
  • TS.DEL: Deletes the samples of the time series at key from fromTimestamp to toTimestamp, both included.
  • TS.DELETERULE: Deletes the compaction rule from sourceKey to destKey.
  • TS.GET: Returns the newest sample of the time series at key.
  • TS.INCRBY: Adds a sample whose value is the series' last value plus value; a missing series starts at 0.
  • TS.INFO: Returns a time series' metadata: its number of samples, memory use, first and last timestamps, retention, chunk size, duplicate policy, labels, and compaction rules.
  • TS.MADD: Adds samples to one or more time series in one call, creating series that do not exist.
  • TS.MGET: Returns the newest sample of every time series whose labels match the FILTER (see TS.MRANGE for conditions).
  • TS.MRANGE: Runs TS.RANGE over every time series whose labels match the FILTER, and returns each with its samples.
  • TS.MREVRANGE: TS.MRANGE, newest first, with the same options.
  • TS.NRANGE: Runs the same range over several named time series and joins the results by timestamp, a command of Redis 8.10.
  • TS.NREVRANGE: TS.NRANGE, newest first.
  • TS.QUERYINDEX: Returns the keys of every time series whose labels match the given conditions (see TS.MRANGE), sorted.
  • TS.QUERYLABELS: Returns the label names in use, with LABELS, or the values of one label, with VALUES label, across the time series that match the FILTER conditions, or all of them (Redis 8.10).
  • TS.RANGE: Returns the samples of the time series at key from fromTimestamp to toTimestamp, both included, oldest first.
  • TS.READ: Returns the samples of the time series at key at or after timestamp, oldest first, for following a series as it grows (Redis 8.10).
  • TS.REVRANGE: TS.RANGE, newest first, with the same options.