Record Class TransactionManager.TransactionManagerStats
java.lang.Object
java.lang.Record
com.loomcache.server.transaction.TransactionManager.TransactionManagerStats
- Record Components:
totalStarted- total number of transactions started (must be non-negative)totalCommitted- total number of transactions committed successfully (must be non-negative)totalRolledBack- total number of transactions rolled back manually (must be non-negative)totalTimedOut- total number of transactions that timed out (must be non-negative)activeCount- current number of active transactions (must be non-negative)
- Enclosing class:
TransactionManager
public static record TransactionManager.TransactionManagerStats(long totalStarted, long totalCommitted, long totalRolledBack, long totalTimedOut, int activeCount)
extends Record
Statistics about transaction execution.
Fields:
- totalStarted: total number of transactions started
- totalCommitted: total number of transactions committed successfully
- totalRolledBack: total number of transactions rolled back (manually)
- totalTimedOut: total number of transactions that timed out
- activeCount: current number of active (in-progress) transactions
Invariants: All counters are non-negative. totalCommitted + totalRolledBack + totalTimedOut should equal totalStarted (minus activeCount).
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionManagerStats(long totalStarted, long totalCommitted, long totalRolledBack, long totalTimedOut, int activeCount) Compact constructor validating all statistics are non-negative. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theactiveCountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalCommittedrecord component.longReturns the value of thetotalRolledBackrecord component.longReturns the value of thetotalStartedrecord component.longReturns the value of thetotalTimedOutrecord component.
-
Constructor Details
-
TransactionManagerStats
public TransactionManagerStats(long totalStarted, long totalCommitted, long totalRolledBack, long totalTimedOut, int activeCount) Compact constructor validating all statistics are non-negative.- Throws:
IllegalArgumentException- if any statistic is negative
-
-
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. -
totalStarted
public long totalStarted()Returns the value of thetotalStartedrecord component.- Returns:
- the value of the
totalStartedrecord component
-
totalCommitted
public long totalCommitted()Returns the value of thetotalCommittedrecord component.- Returns:
- the value of the
totalCommittedrecord component
-
totalRolledBack
public long totalRolledBack()Returns the value of thetotalRolledBackrecord component.- Returns:
- the value of the
totalRolledBackrecord component
-
totalTimedOut
public long totalTimedOut()Returns the value of thetotalTimedOutrecord component.- Returns:
- the value of the
totalTimedOutrecord component
-
activeCount
public int activeCount()Returns the value of theactiveCountrecord component.- Returns:
- the value of the
activeCountrecord component
-