java.lang.Object
dev.metaschema.core.model.constraint.TimingRecord
Thread-safe accumulator for timing measurements of a single timed entity
(constraint, let-statement, phase, or overall validation).
Records total elapsed time, invocation count, and min/max per-invocation durations. Also tracks the wall-clock start and end timestamps in UTC.
All methods are safe to call from multiple threads concurrently.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetCount()Get the number of times this entity has been timed.Get the wall-clock timestamp of the latest recorded end event.longGet the maximum single-invocation duration recorded.longGet the minimum single-invocation duration recorded.Get the wall-clock timestamp of the earliest recorded start event.longGet the total accumulated time across all invocations.
-
Constructor Details
-
TimingRecord
public TimingRecord()
-
-
Method Details
-
getTotalTimeNs
public long getTotalTimeNs()Get the total accumulated time across all invocations.- Returns:
- total time in nanoseconds
-
getCount
public long getCount()Get the number of times this entity has been timed.- Returns:
- the invocation count
-
getMinTimeNs
public long getMinTimeNs()Get the minimum single-invocation duration recorded.- Returns:
- minimum time in nanoseconds, or
Long.MAX_VALUEif no invocations have been recorded
-
getMaxTimeNs
public long getMaxTimeNs()Get the maximum single-invocation duration recorded.- Returns:
- maximum time in nanoseconds, or
Long.MIN_VALUEif no invocations have been recorded
-
getStartTimestampUtc
Get the wall-clock timestamp of the earliest recorded start event.- Returns:
- the start timestamp, or
nullif no events have been recorded
-
getEndTimestampUtc
Get the wall-clock timestamp of the latest recorded end event.- Returns:
- the end timestamp, or
nullif no events have completed
-