public class RuntimeEventAggregator extends Object
RuntimeEventAggregator rolls up runtime events into time windows so that a slow
operation triggered many times is summarized as a handful of rows (one per window) carrying an
occurrence count and, when available, the total and maximum durations, rather than one row per
occurrence.
The aggregator is thread-safe: runtime events arrive from many application threads, while a
single background thread periodically flushes the windows that have closed. On JVM shutdown, or
when stop() is called, any remaining windows are flushed as well.
| Constructor and Description |
|---|
RuntimeEventAggregator(EventPersistenceSettings settings,
EventStore eventStore) |
| Modifier and Type | Method and Description |
|---|---|
void |
flushAll()
Flush all windows, regardless of whether they have closed.
|
void |
flushClosedWindows(long referenceMillis)
Flush every window whose end time is at or before the provided reference time.
|
long |
getDroppedCount()
Get the number of runtime events that were dropped because the signature cap was reached.
|
void |
record(Event event)
Record a single runtime event into the current time window.
|
void |
start()
Start the background flush scheduler and register the JVM shutdown hook.
|
void |
stop()
Stop the aggregator, flushing any remaining windows.
|
public RuntimeEventAggregator(EventPersistenceSettings settings, EventStore eventStore)
public void start()
public void record(Event event)
event - the runtime Eventpublic void flushClosedWindows(long referenceMillis)
referenceMillis - the reference time in millisecondspublic void flushAll()
public void stop()
public long getDroppedCount()
Copyright © 2026. All rights reserved.