Method: Redis::TimeSeries#incrby

Defined in:
lib/redis/time_series.rb

#incrby(value = 1, timestamp = nil, uncompressed: nil, chunk_size: nil) ⇒ Integer Also known as: increment

Increment the current value of the series.

Parameters:

  • value (Integer) (defaults to: 1)

    the amount to increment by

  • timestamp (Time, Integer) (defaults to: nil)

    the Time or integer millisecond timestamp to save the new value at

  • uncompressed (Boolean) (defaults to: nil)

    if true, stores data in an uncompressed format

  • chunk_size (Integer) (defaults to: nil)

    set default chunk size, in bytes, for the time series

Returns:

  • (Integer)

    the timestamp the value was stored at

See Also:



346
347
348
349
350
351
352
353
# File 'lib/redis/time_series.rb', line 346

def incrby(value = 1, timestamp = nil, uncompressed: nil, chunk_size: nil)
  cmd 'TS.INCRBY',
      key,
      value,
      (timestamp if timestamp),
      ('UNCOMPRESSED' if uncompressed),
      (['CHUNK_SIZE', chunk_size] if chunk_size)
end