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 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

      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. 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.
    • totalStarted

      public long totalStarted()
      Returns the value of the totalStarted record component.
      Returns:
      the value of the totalStarted record component
    • totalCommitted

      public long totalCommitted()
      Returns the value of the totalCommitted record component.
      Returns:
      the value of the totalCommitted record component
    • totalRolledBack

      public long totalRolledBack()
      Returns the value of the totalRolledBack record component.
      Returns:
      the value of the totalRolledBack record component
    • totalTimedOut

      public long totalTimedOut()
      Returns the value of the totalTimedOut record component.
      Returns:
      the value of the totalTimedOut record component
    • activeCount

      public int activeCount()
      Returns the value of the activeCount record component.
      Returns:
      the value of the activeCount record component