Record Class SessionStats
java.lang.Object
java.lang.Record
com.loomcache.server.cp.SessionStats
- Record Components:
activeSessions- the number of currently active sessionsexpiredSessions- the total number of sessions that have expiredclosedSessions- the total number of sessions that were explicitly closedtotalCreated- the total number of sessions ever createdavgSessionDuration- 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 Summary
ConstructorsConstructorDescriptionSessionStats(int activeSessions, long expiredSessions, long closedSessions, long totalCreated, long avgSessionDuration) Creates an instance of aSessionStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theactiveSessionsrecord component.longReturns the value of theavgSessionDurationrecord component.longReturns the value of theclosedSessionsrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of theexpiredSessionsrecord component.final inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this record class.longReturns the value of thetotalCreatedrecord component.
-
Constructor Details
-
SessionStats
public SessionStats(int activeSessions, long expiredSessions, long closedSessions, long totalCreated, long avgSessionDuration) Creates an instance of aSessionStatsrecord class.- Parameters:
activeSessions- the value for theactiveSessionsrecord componentexpiredSessions- the value for theexpiredSessionsrecord componentclosedSessions- the value for theclosedSessionsrecord componenttotalCreated- the value for thetotalCreatedrecord componentavgSessionDuration- the value for theavgSessionDurationrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
activeSessions
public int activeSessions()Returns the value of theactiveSessionsrecord component.- Returns:
- the value of the
activeSessionsrecord component
-
expiredSessions
public long expiredSessions()Returns the value of theexpiredSessionsrecord component.- Returns:
- the value of the
expiredSessionsrecord component
-
closedSessions
public long closedSessions()Returns the value of theclosedSessionsrecord component.- Returns:
- the value of the
closedSessionsrecord component
-
totalCreated
public long totalCreated()Returns the value of thetotalCreatedrecord component.- Returns:
- the value of the
totalCreatedrecord component
-
avgSessionDuration
public long avgSessionDuration()Returns the value of theavgSessionDurationrecord component.- Returns:
- the value of the
avgSessionDurationrecord component
-