Skip to content

counter_series:delta

series:delta(value)
Since: Dev Builds Only

The functionality described in this section requires a dev build of KumoMTA. You can obtain a dev build by following the instructions in the Installation section.

Adjusts the current bucket of the series by a signed amount.

  • value — signed integer delta. Positive values add; negative values subtract.

Bucket values are unsigned 64-bit integers, so the result saturates at zero on subtraction and at u64::MAX on addition; the bucket value will never go negative or wrap around.

Use increment when you only need to add.

Example

local series = kumo.counter_series.define {
  name = 'inflight',
  num_buckets = 5,
  bucket_size = '1m',
}
series:delta(1) -- a job started
series:delta(-1) -- a job finished