Class TimingRecord

java.lang.Object
dev.metaschema.core.model.constraint.TimingRecord

public class TimingRecord extends Object
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 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_VALUE if no invocations have been recorded
    • getMaxTimeNs

      public long getMaxTimeNs()
      Get the maximum single-invocation duration recorded.
      Returns:
      maximum time in nanoseconds, or Long.MIN_VALUE if no invocations have been recorded
    • getStartTimestampUtc

      @Nullable public Instant getStartTimestampUtc()
      Get the wall-clock timestamp of the earliest recorded start event.
      Returns:
      the start timestamp, or null if no events have been recorded
    • getEndTimestampUtc

      @Nullable public Instant getEndTimestampUtc()
      Get the wall-clock timestamp of the latest recorded end event.
      Returns:
      the end timestamp, or null if no events have completed