Record Class TraceLimits

java.lang.Object
java.lang.Record
cs1302.tracer.execution.TraceLimits
Record Components:
timeoutMillis - Elapsed tracing deadline, excluding compilation.
snapshots - Maximum completed snapshots captured, including replaced snapshots.
outputBytes - Maximum retained bytes per guest output stream.
heapObjects - Maximum distinct reachable objects per snapshot.
elements - Maximum inspected fields/array elements/string characters per snapshot.
traceBytes - Maximum accounted retained snapshot bytes.
sourceBytes - Maximum UTF-8 source bytes.
sourceFiles - Maximum streamed source files.
threads - Maximum live application threads.
frames - Maximum total frames per snapshot.
snapshotBytes - Maximum accounted bytes for one snapshot.

public record TraceLimits(long timeoutMillis, long snapshots, long outputBytes, long heapObjects, long elements, long traceBytes, long sourceBytes, long sourceFiles, long threads, long frames, long snapshotBytes) extends Record
Trace budgets. Zero means unlimited; byte counts use bytes, time uses milliseconds.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TraceLimits(long timeoutMillis, long snapshots, long outputBytes, long heapObjects, long elements, long traceBytes, long sourceBytes, long sourceFiles)
    Constructs the original budgets with unlimited thread-specific ceilings.
    TraceLimits(long timeoutMillis, long snapshots, long outputBytes, long heapObjects, long elements, long traceBytes, long sourceBytes, long sourceFiles, long threads, long frames, long snapshotBytes)
    Validates budgets before any work starts.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the value of the elements record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the frames record component.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the heapObjects record component.
    Returns the ordinary instructor CLI policy.
    long
    Returns the value of the outputBytes record component.
    long
    Returns the value of the snapshotBytes record component.
    long
    Returns the value of the snapshots record component.
    long
    Returns the value of the sourceBytes record component.
    long
    Returns the value of the sourceFiles record component.
    long
    Returns the value of the threads record component.
    long
    Returns the value of the timeoutMillis record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the traceBytes record component.
    Returns the trusted unlimited policy.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TraceLimits

      public TraceLimits(long timeoutMillis, long snapshots, long outputBytes, long heapObjects, long elements, long traceBytes, long sourceBytes, long sourceFiles)
      Constructs the original budgets with unlimited thread-specific ceilings.
      Parameters:
      timeoutMillis - Deadline.
      snapshots - Snapshot count.
      outputBytes - Output bytes.
      heapObjects - Heap objects.
      elements - Inspected elements.
      traceBytes - Retained bytes.
      sourceBytes - Source bytes.
      sourceFiles - Source files.
    • TraceLimits

      public TraceLimits(long timeoutMillis, long snapshots, long outputBytes, long heapObjects, long elements, long traceBytes, long sourceBytes, long sourceFiles, long threads, long frames, long snapshotBytes)
      Validates budgets before any work starts.
  • Method Details

    • instructorDefaults

      public static TraceLimits instructorDefaults()
      Returns the ordinary instructor CLI policy.
      Returns:
      Finite budgets for interactive examples.
    • unlimited

      public static TraceLimits unlimited()
      Returns the trusted unlimited policy.
      Returns:
      Unlimited budgets.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • timeoutMillis

      public long timeoutMillis()
      Returns the value of the timeoutMillis record component.
      Returns:
      the value of the timeoutMillis record component
    • snapshots

      public long snapshots()
      Returns the value of the snapshots record component.
      Returns:
      the value of the snapshots record component
    • outputBytes

      public long outputBytes()
      Returns the value of the outputBytes record component.
      Returns:
      the value of the outputBytes record component
    • heapObjects

      public long heapObjects()
      Returns the value of the heapObjects record component.
      Returns:
      the value of the heapObjects record component
    • elements

      public long elements()
      Returns the value of the elements record component.
      Returns:
      the value of the elements record component
    • traceBytes

      public long traceBytes()
      Returns the value of the traceBytes record component.
      Returns:
      the value of the traceBytes record component
    • sourceBytes

      public long sourceBytes()
      Returns the value of the sourceBytes record component.
      Returns:
      the value of the sourceBytes record component
    • sourceFiles

      public long sourceFiles()
      Returns the value of the sourceFiles record component.
      Returns:
      the value of the sourceFiles record component
    • threads

      public long threads()
      Returns the value of the threads record component.
      Returns:
      the value of the threads record component
    • frames

      public long frames()
      Returns the value of the frames record component.
      Returns:
      the value of the frames record component
    • snapshotBytes

      public long snapshotBytes()
      Returns the value of the snapshotBytes record component.
      Returns:
      the value of the snapshotBytes record component