Example: event.asInterval("bucket-a"). Converts the event key to a labeled Interval covering the same extent.
Example: event.begin(). Returns the inclusive event start in milliseconds since epoch.
Example: event.collapse(["in", "out"], "avg", fn). Collapses selected payload fields into a single derived field using the supplied reducer.
Example: event.contains(time). Returns true when the event extent fully contains the supplied temporal value.
Example: event.data(). Returns the immutable event payload.
Example: event.end(). Returns the inclusive event end in milliseconds since epoch.
Example: event.intersection(range). Returns the temporal intersection of the event extent and the supplied value, if any.
Example: event.isAfter(range). Returns true when the event begins strictly after the supplied temporal value ends.
Example: event.isBefore(range). Returns true when the event ends strictly before the supplied temporal value begins.
Example: event.key(). Returns the event key.
Example: event.overlaps(range). Returns true when the event extent overlaps the supplied temporal value.
Example: event.rename({ cpu: "usage" }). Returns a new event with payload fields renamed according to the supplied mapping.
Example: event.timeRange(). Returns the event extent as a TimeRange.
Example: event.toJsonRow(schema). Returns the JSON-shape row
for this event — like Event.toRow but with the key
serialized to its JSON form (numeric ms / [start, end] /
[value, start, end]) and undefined cells emitted as null.
Pass { rowFormat: 'object' } to get the schema-keyed object
shape instead of the array tuple.
Mirrors TimeSeries.toJSON's row-level serialization, so
event.toJsonRow(schema) plugs straight into a wire envelope
that the receiver feeds into LiveSeries.pushJson(...) or
LiveSeries.fromJSON(...).
Trust contract: same as Event.toRow — no validation
against schema. Mismatched column names produce null
cells in the JSON output (serializeJsonValue(undefined)),
which round-trip through pushJson as undefined. Pass the
same as const schema the event was originally produced under.
Optionaloptions: { rowFormat?: "array" }Example: event.toJsonRow(schema). Returns the JSON-shape row
for this event — like Event.toRow but with the key
serialized to its JSON form (numeric ms / [start, end] /
[value, start, end]) and undefined cells emitted as null.
Pass { rowFormat: 'object' } to get the schema-keyed object
shape instead of the array tuple.
Mirrors TimeSeries.toJSON's row-level serialization, so
event.toJsonRow(schema) plugs straight into a wire envelope
that the receiver feeds into LiveSeries.pushJson(...) or
LiveSeries.fromJSON(...).
Trust contract: same as Event.toRow — no validation
against schema. Mismatched column names produce null
cells in the JSON output (serializeJsonValue(undefined)),
which round-trip through pushJson as undefined. Pass the
same as const schema the event was originally produced under.
Example: event.toRow(schema). Returns the typed-row tuple for
this event in the column order declared by schema — [key, ...values].
Use this in batch-listener fanout to convert a stream of Event
objects into the same shape LiveSeries.toRows() /
pushMany(rows) consume, without walking columns by hand:
live.on('batch', (events) => {
const rows = events.map((e) => e.toRow(schema));
sendOverWire(rows); // codec of your choice
});
Trust contract: no validation against schema. If the
caller passes a schema whose value-column names don't match the
event's payload keys, data[col.name] is undefined for every
mismatched column and the row is silently corrupt — downstream
pushMany(rows) accepts it (column count matches), but reads
via event.get('col') from the resulting events return
undefined. Pass the same as const schema the event was
originally produced under.
Example: event.trim(range). Returns a new event clipped to the supplied temporal value, if the event overlaps it.
Example: event.type(). Returns the underlying key kind.
An immutable event made of a temporal key and typed payload data.
Example