Record Class SystemMetrics.Snapshot

java.lang.Object
java.lang.Record
ai.attackframework.tools.burp.utils.SystemMetrics.Snapshot
Enclosing class:
SystemMetrics

public static record SystemMetrics.Snapshot(long heapUsedBytes, long heapCommittedBytes, long heapMaxBytes, long nonHeapUsedBytes, long nonHeapMaxBytes, int threadCount, int peakThreadCount, long gcCollectionCount, long gcCollectionTimeMs, long uptimeMs, int availableProcessors, double processCpuLoad, long directBufferUsedBytes, long mappedBufferUsedBytes) extends Record
Immutable process-wide resource snapshot.

Negative numeric fields signal "unavailable" - either JMX failed to report or the platform does not expose the metric. processCpuLoad returns Double.NaN when the com.sun.management extension is not reachable (for example on non-HotSpot JVMs or restricted security managers).

heapCommittedBytes is the heap currently allocated from the OS (Runtime.totalMemory()). It bounds heapUsedBytes from above and tracks more closely with process RSS than heapUsedBytes alone -- HotSpot does not eagerly return committed heap to the OS after a peak, so committed often stays high after used drops, which is what makes Task Manager / RSS still look elevated post-Stop.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Snapshot(long heapUsedBytes, long heapCommittedBytes, long heapMaxBytes, long nonHeapUsedBytes, long nonHeapMaxBytes, int threadCount, int peakThreadCount, long gcCollectionCount, long gcCollectionTimeMs, long uptimeMs, int availableProcessors, double processCpuLoad, long directBufferUsedBytes, long mappedBufferUsedBytes)
    Creates an instance of a Snapshot record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the availableProcessors record component.
    long
    Returns the value of the directBufferUsedBytes record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the gcCollectionCount record component.
    long
    Returns the value of the gcCollectionTimeMs record component.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the heapCommittedBytes record component.
    long
    Returns the value of the heapMaxBytes record component.
    long
    Returns the value of the heapUsedBytes record component.
    long
    Returns the value of the mappedBufferUsedBytes record component.
    long
    Returns the value of the nonHeapMaxBytes record component.
    long
    Returns the value of the nonHeapUsedBytes record component.
    int
    Returns the value of the peakThreadCount record component.
    double
    Returns the value of the processCpuLoad record component.
    int
    Returns the value of the threadCount record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the uptimeMs record component.

    Methods inherited from class java.lang.Object

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

    • Snapshot

      public Snapshot(long heapUsedBytes, long heapCommittedBytes, long heapMaxBytes, long nonHeapUsedBytes, long nonHeapMaxBytes, int threadCount, int peakThreadCount, long gcCollectionCount, long gcCollectionTimeMs, long uptimeMs, int availableProcessors, double processCpuLoad, long directBufferUsedBytes, long mappedBufferUsedBytes)
      Creates an instance of a Snapshot record class.
      Parameters:
      heapUsedBytes - the value for the heapUsedBytes record component
      heapCommittedBytes - the value for the heapCommittedBytes record component
      heapMaxBytes - the value for the heapMaxBytes record component
      nonHeapUsedBytes - the value for the nonHeapUsedBytes record component
      nonHeapMaxBytes - the value for the nonHeapMaxBytes record component
      threadCount - the value for the threadCount record component
      peakThreadCount - the value for the peakThreadCount record component
      gcCollectionCount - the value for the gcCollectionCount record component
      gcCollectionTimeMs - the value for the gcCollectionTimeMs record component
      uptimeMs - the value for the uptimeMs record component
      availableProcessors - the value for the availableProcessors record component
      processCpuLoad - the value for the processCpuLoad record component
      directBufferUsedBytes - the value for the directBufferUsedBytes record component
      mappedBufferUsedBytes - the value for the mappedBufferUsedBytes record component
  • Method Details

    • 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.
    • heapUsedBytes

      public long heapUsedBytes()
      Returns the value of the heapUsedBytes record component.
      Returns:
      the value of the heapUsedBytes record component
    • heapCommittedBytes

      public long heapCommittedBytes()
      Returns the value of the heapCommittedBytes record component.
      Returns:
      the value of the heapCommittedBytes record component
    • heapMaxBytes

      public long heapMaxBytes()
      Returns the value of the heapMaxBytes record component.
      Returns:
      the value of the heapMaxBytes record component
    • nonHeapUsedBytes

      public long nonHeapUsedBytes()
      Returns the value of the nonHeapUsedBytes record component.
      Returns:
      the value of the nonHeapUsedBytes record component
    • nonHeapMaxBytes

      public long nonHeapMaxBytes()
      Returns the value of the nonHeapMaxBytes record component.
      Returns:
      the value of the nonHeapMaxBytes record component
    • threadCount

      public int threadCount()
      Returns the value of the threadCount record component.
      Returns:
      the value of the threadCount record component
    • peakThreadCount

      public int peakThreadCount()
      Returns the value of the peakThreadCount record component.
      Returns:
      the value of the peakThreadCount record component
    • gcCollectionCount

      public long gcCollectionCount()
      Returns the value of the gcCollectionCount record component.
      Returns:
      the value of the gcCollectionCount record component
    • gcCollectionTimeMs

      public long gcCollectionTimeMs()
      Returns the value of the gcCollectionTimeMs record component.
      Returns:
      the value of the gcCollectionTimeMs record component
    • uptimeMs

      public long uptimeMs()
      Returns the value of the uptimeMs record component.
      Returns:
      the value of the uptimeMs record component
    • availableProcessors

      public int availableProcessors()
      Returns the value of the availableProcessors record component.
      Returns:
      the value of the availableProcessors record component
    • processCpuLoad

      public double processCpuLoad()
      Returns the value of the processCpuLoad record component.
      Returns:
      the value of the processCpuLoad record component
    • directBufferUsedBytes

      public long directBufferUsedBytes()
      Returns the value of the directBufferUsedBytes record component.
      Returns:
      the value of the directBufferUsedBytes record component
    • mappedBufferUsedBytes

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