TS.INCRBY

Since 1.1.0Time series

Syntax

TS.INCRBY key value [TIMESTAMP timestamp] [RETENTION ms] [CHUNK SIZE size] [LABELS label value ...]
  • Flags: write
  • ACL categories: @slow, @timeseries, @write
  • Arity: -2

Adds a sample whose value is the series' last value plus value; a missing series starts at 0. TIMESTAMP gives the sample's time, the server's clock by default. It takes the creation options of TS.CREATE.

Reply

  • The timestamp stored.

Examples

> TS.INCRBY ctr 5 TIMESTAMP 1000
(integer) 1000
> TS.INCRBY ctr 2 TIMESTAMP 2000
(integer) 2000
> TS.RANGE ctr - +
1) 1) (integer) 1000
   2) "5"
2) 1) (integer) 2000
   2) "7"