Record Class SessionStats

java.lang.Object
java.lang.Record
com.loomcache.server.cp.SessionStats
Record Components:
activeSessions - the number of currently active sessions
expiredSessions - the total number of sessions that have expired
closedSessions - the total number of sessions that were explicitly closed
totalCreated - the total number of sessions ever created
avgSessionDuration - the average session duration in milliseconds (0 if no closed sessions)

public record SessionStats(int activeSessions, long expiredSessions, long closedSessions, long totalCreated, long avgSessionDuration) extends Record
Statistics about active and historical CP sessions.
Since:
1.0
  • Constructor Details

    • SessionStats

      public SessionStats(int activeSessions, long expiredSessions, long closedSessions, long totalCreated, long avgSessionDuration)
      Creates an instance of a SessionStats record class.
      Parameters:
      activeSessions - the value for the activeSessions record component
      expiredSessions - the value for the expiredSessions record component
      closedSessions - the value for the closedSessions record component
      totalCreated - the value for the totalCreated record component
      avgSessionDuration - the value for the avgSessionDuration record component
  • Method Details

    • toString

      public 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 the compare method from their corresponding wrapper classes.
      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.
    • activeSessions

      public int activeSessions()
      Returns the value of the activeSessions record component.
      Returns:
      the value of the activeSessions record component
    • expiredSessions

      public long expiredSessions()
      Returns the value of the expiredSessions record component.
      Returns:
      the value of the expiredSessions record component
    • closedSessions

      public long closedSessions()
      Returns the value of the closedSessions record component.
      Returns:
      the value of the closedSessions record component
    • totalCreated

      public long totalCreated()
      Returns the value of the totalCreated record component.
      Returns:
      the value of the totalCreated record component
    • avgSessionDuration

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