public class RuntimeRollup extends Object
RuntimeRollup is a mutable accumulator that aggregates all the runtime events
sharing the same signature within the same time window.
Instead of storing one database row per event occurrence, the aggregator keeps a single
RuntimeRollup per (signature, window) pair, tracking the number of occurrences and,
when the events expose a duration, the total and maximum durations.
| Constructor and Description |
|---|
RuntimeRollup(String eventName,
String signature,
String priority,
long windowStart,
long windowEnd) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the rollup prior to persisting it, so that its values no longer change and any occurrence
recorded concurrently goes into a new rollup instead of being lost.
|
String |
getEventName() |
Long |
getMaxDurationMillis()
Get the maximum duration, or
null when none of the aggregated events exposed one. |
long |
getOccurrenceCount() |
String |
getPriority() |
String |
getSampleDescription() |
String |
getSignature() |
Long |
getTotalDurationMillis()
Get the total duration, or
null when none of the aggregated events exposed one. |
long |
getWindowEnd() |
long |
getWindowStart() |
boolean |
record(Long durationMillis,
String description)
Record a single occurrence into this rollup.
|
public boolean record(Long durationMillis, String description)
durationMillis - the duration of the occurrence, or null if not availabledescription - a representative description (kept only for the first occurrence)true if the occurrence was recorded, or false if the rollup was already closed,
in which case the occurrence must be recorded into a new rolluppublic void close()
public String getEventName()
public String getSignature()
public String getPriority()
public long getWindowStart()
public long getWindowEnd()
public long getOccurrenceCount()
public Long getTotalDurationMillis()
null when none of the aggregated events exposed one.nullpublic Long getMaxDurationMillis()
null when none of the aggregated events exposed one.nullpublic String getSampleDescription()
Copyright © 2026. All rights reserved.