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
ConstructorsConstructorDescriptionSnapshot(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 aSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theavailableProcessorsrecord component.longReturns the value of thedirectBufferUsedBytesrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of thegcCollectionCountrecord component.longReturns the value of thegcCollectionTimeMsrecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of theheapCommittedBytesrecord component.longReturns the value of theheapMaxBytesrecord component.longReturns the value of theheapUsedBytesrecord component.longReturns the value of themappedBufferUsedBytesrecord component.longReturns the value of thenonHeapMaxBytesrecord component.longReturns the value of thenonHeapUsedBytesrecord component.intReturns the value of thepeakThreadCountrecord component.doubleReturns the value of theprocessCpuLoadrecord component.intReturns the value of thethreadCountrecord component.final StringtoString()Returns a string representation of this record class.longuptimeMs()Returns the value of theuptimeMsrecord component.
-
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 aSnapshotrecord class.- Parameters:
heapUsedBytes- the value for theheapUsedBytesrecord componentheapCommittedBytes- the value for theheapCommittedBytesrecord componentheapMaxBytes- the value for theheapMaxBytesrecord componentnonHeapUsedBytes- the value for thenonHeapUsedBytesrecord componentnonHeapMaxBytes- the value for thenonHeapMaxBytesrecord componentthreadCount- the value for thethreadCountrecord componentpeakThreadCount- the value for thepeakThreadCountrecord componentgcCollectionCount- the value for thegcCollectionCountrecord componentgcCollectionTimeMs- the value for thegcCollectionTimeMsrecord componentuptimeMs- the value for theuptimeMsrecord componentavailableProcessors- the value for theavailableProcessorsrecord componentprocessCpuLoad- the value for theprocessCpuLoadrecord componentdirectBufferUsedBytes- the value for thedirectBufferUsedBytesrecord componentmappedBufferUsedBytes- the value for themappedBufferUsedBytesrecord component
-
-
Method Details
-
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. -
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. -
equals
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 '=='. -
heapUsedBytes
public long heapUsedBytes()Returns the value of theheapUsedBytesrecord component.- Returns:
- the value of the
heapUsedBytesrecord component
-
heapCommittedBytes
public long heapCommittedBytes()Returns the value of theheapCommittedBytesrecord component.- Returns:
- the value of the
heapCommittedBytesrecord component
-
heapMaxBytes
public long heapMaxBytes()Returns the value of theheapMaxBytesrecord component.- Returns:
- the value of the
heapMaxBytesrecord component
-
nonHeapUsedBytes
public long nonHeapUsedBytes()Returns the value of thenonHeapUsedBytesrecord component.- Returns:
- the value of the
nonHeapUsedBytesrecord component
-
nonHeapMaxBytes
public long nonHeapMaxBytes()Returns the value of thenonHeapMaxBytesrecord component.- Returns:
- the value of the
nonHeapMaxBytesrecord component
-
threadCount
public int threadCount()Returns the value of thethreadCountrecord component.- Returns:
- the value of the
threadCountrecord component
-
peakThreadCount
public int peakThreadCount()Returns the value of thepeakThreadCountrecord component.- Returns:
- the value of the
peakThreadCountrecord component
-
gcCollectionCount
public long gcCollectionCount()Returns the value of thegcCollectionCountrecord component.- Returns:
- the value of the
gcCollectionCountrecord component
-
gcCollectionTimeMs
public long gcCollectionTimeMs()Returns the value of thegcCollectionTimeMsrecord component.- Returns:
- the value of the
gcCollectionTimeMsrecord component
-
uptimeMs
public long uptimeMs()Returns the value of theuptimeMsrecord component.- Returns:
- the value of the
uptimeMsrecord component
-
availableProcessors
public int availableProcessors()Returns the value of theavailableProcessorsrecord component.- Returns:
- the value of the
availableProcessorsrecord component
-
processCpuLoad
public double processCpuLoad()Returns the value of theprocessCpuLoadrecord component.- Returns:
- the value of the
processCpuLoadrecord component
-
directBufferUsedBytes
public long directBufferUsedBytes()Returns the value of thedirectBufferUsedBytesrecord component.- Returns:
- the value of the
directBufferUsedBytesrecord component
-
mappedBufferUsedBytes
public long mappedBufferUsedBytes()Returns the value of themappedBufferUsedBytesrecord component.- Returns:
- the value of the
mappedBufferUsedBytesrecord component
-