Skip to content

counter_series:increment

series:increment(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.

Adds value to the current bucket of the series.

  • value — unsigned integer amount to add. Must be >= 0.

The current bucket is the one corresponding to the present moment in time; older buckets rotate out automatically as time elapses.

Addition saturates at u64::MAX. To subtract from the current bucket, use delta with a negative value.

Example

local series = kumo.counter_series.define {
  name = 'deliveries.ok',
  num_buckets = 5,
  bucket_size = '1m',
}
series:increment(1)