measure
Replaces the input with metrics describing the input.
Description
The measure
operator yields metrics for each received batch of events or bytes
using the following schema, respectively:
real_time = bool (optional)
Whether to emit metrics immediately with every batch, rather than buffering until the upstream operator stalls, i.e., is idle or waiting for further input.
The is especially useful when measure
should emit data without latency.
cumulative = bool (optional)
Whether to emit running totals for the events
and bytes
fields rather than
per-batch statistics.
Examples
Get the number of bytes read incrementally for a file
{timestamp: 2023-04-28T10:22:10.192322, bytes: 16384}
{timestamp: 2023-04-28T10:22:10.223612, bytes: 16384}
{timestamp: 2023-04-28T10:22:10.297169, bytes: 16384}
{timestamp: 2023-04-28T10:22:10.387172, bytes: 16384}
{timestamp: 2023-04-28T10:22:10.408171, bytes: 8232}