Record Class GcEvent

java.lang.Object
java.lang.Record
com.helix.profiler.gc.GcEvent
Record Components:
timestampMs - Timestamp in milliseconds relative to JVM launch
gcId - GC collection ID
type - GC type (e.g. "Pause Young (Normal)", "Pause Full")
cause - GC cause / phase (e.g. "G1 Evacuation Pause", "System.gc()")
heapBeforeKb - Heap memory used before collection in KB
heapAfterKb - Heap memory used after collection in KB
heapTotalKb - Total committed heap capacity in KB
pauseTimeMs - Duration of GC pause in milliseconds
isFullGc - True if this collection was a Full GC
timestamp - Instant when event was parsed

public record GcEvent(long timestampMs, int gcId, String type, String cause, long heapBeforeKb, long heapAfterKb, long heapTotalKb, double pauseTimeMs, boolean isFullGc, Instant timestamp) extends Record
Record representing a Garbage Collection event parsed from JDK Unified GC Logging (-Xlog:gc*).
  • Constructor Details

    • GcEvent

      public GcEvent(long timestampMs, int gcId, String type, String cause, long heapBeforeKb, long heapAfterKb, long heapTotalKb, double pauseTimeMs, boolean isFullGc, Instant timestamp)
      Creates an instance of a GcEvent record class.
      Parameters:
      timestampMs - the value for the timestampMs record component
      gcId - the value for the gcId record component
      type - the value for the type record component
      cause - the value for the cause record component
      heapBeforeKb - the value for the heapBeforeKb record component
      heapAfterKb - the value for the heapAfterKb record component
      heapTotalKb - the value for the heapTotalKb record component
      pauseTimeMs - the value for the pauseTimeMs record component
      isFullGc - the value for the isFullGc record component
      timestamp - the value for the timestamp record component
  • Method Details

    • getReclaimedKb

      public long getReclaimedKb()
      Calculates memory reclaimed during this collection cycle in KB.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • timestampMs

      public long timestampMs()
      Returns the value of the timestampMs record component.
      Returns:
      the value of the timestampMs record component
    • gcId

      public int gcId()
      Returns the value of the gcId record component.
      Returns:
      the value of the gcId record component
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • cause

      public String cause()
      Returns the value of the cause record component.
      Returns:
      the value of the cause record component
    • heapBeforeKb

      public long heapBeforeKb()
      Returns the value of the heapBeforeKb record component.
      Returns:
      the value of the heapBeforeKb record component
    • heapAfterKb

      public long heapAfterKb()
      Returns the value of the heapAfterKb record component.
      Returns:
      the value of the heapAfterKb record component
    • heapTotalKb

      public long heapTotalKb()
      Returns the value of the heapTotalKb record component.
      Returns:
      the value of the heapTotalKb record component
    • pauseTimeMs

      public double pauseTimeMs()
      Returns the value of the pauseTimeMs record component.
      Returns:
      the value of the pauseTimeMs record component
    • isFullGc

      public boolean isFullGc()
      Returns the value of the isFullGc record component.
      Returns:
      the value of the isFullGc record component
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component