Class TxStats

java.lang.Object
com.arjuna.ats.arjuna.coordinator.TxStats
All Implemented Interfaces:
TxStatsMBean

public class TxStats extends Object implements TxStatsMBean
This class is used to maintain statistics on transactions that have been created. This includes the number of transactions, their termination status (committed or rolled back), ...
Since:
JTS 2.1.
Version:
$Id: TxStats.java 2342 2006-03-30 13:06:17Z $
Author:
Mark Little (mark@arjuna.com)
  • Method Details

    • enabled

      public static boolean enabled()
    • getInstance

      public static TxStats getInstance()
    • getNumberOfTransactions

      public long getNumberOfTransactions()
      Description copied from interface: TxStatsMBean
      Returns the total number of transactions (top-level and nested) created
      Specified by:
      getNumberOfTransactions in interface TxStatsMBean
      Returns:
      the number of transactions (top-level and nested) created so far.
    • getNumberOfNestedTransactions

      public long getNumberOfNestedTransactions()
      Description copied from interface: TxStatsMBean
      Returns the total number of nested (sub) transactions created. Note: in JTA environments will normally be 0, since JTA disallows nested tx by default.
      Specified by:
      getNumberOfNestedTransactions in interface TxStatsMBean
      Returns:
      the number of nested (sub) transactions created so far.
    • getNumberOfHeuristics

      public long getNumberOfHeuristics()
      Description copied from interface: TxStatsMBean
      Returns the number of transactions which have terminated with heuristic outcomes.
      Specified by:
      getNumberOfHeuristics in interface TxStatsMBean
      Returns:
      the number of transactions which have terminated with heuristic outcomes.
    • getNumberOfCommittedTransactions

      public long getNumberOfCommittedTransactions()
      Description copied from interface: TxStatsMBean
      Returns the number of committed transactions
      Specified by:
      getNumberOfCommittedTransactions in interface TxStatsMBean
      Returns:
      the number of committed transactions.
    • getAverageCommitTime

      public long getAverageCommitTime()
      Description copied from interface: TxStatsMBean
      Returns the average time, in nanoseconds, it is taking to commit a transaction. This time is measured from the moment the client calls commit until the transaction manager determines that the commit attempt was successful (ie that all participants successfully committed). This includes cases where:
      • there are no transaction participants;
      • the transaction only contains readonly participants;
      The average will not be updated if any participants failed to commit. Note that a small number of stuck transactions can skew the overall average. Similarly the average time will be reduced if there are many transactions without participants or with only readonly participants.
      Specified by:
      getAverageCommitTime in interface TxStatsMBean
      Returns:
      the average time, in nanoseconds, it has taken to commit a transaction.
    • getNumberOfAbortedTransactions

      public long getNumberOfAbortedTransactions()
      Description copied from interface: TxStatsMBean
      Returns the number of aborted (i.e. rolledback) transactions
      Specified by:
      getNumberOfAbortedTransactions in interface TxStatsMBean
      Returns:
      the total number of transactions which have rolled back.
    • getNumberOfInflightTransactions

      public long getNumberOfInflightTransactions()
      Description copied from interface: TxStatsMBean
      Get the number of transactions that have begun but not yet terminated. Note: This count is approximate, particularly in recovery situations.
      Specified by:
      getNumberOfInflightTransactions in interface TxStatsMBean
      Returns:
      total number of inflight (active) transactions.
    • getNumberOfTimedOutTransactions

      public long getNumberOfTimedOutTransactions()
      Description copied from interface: TxStatsMBean
      Returns the number of transactions that have rolled back due to timeout.
      Specified by:
      getNumberOfTimedOutTransactions in interface TxStatsMBean
      Returns:
      the number of transactions that have rolled back due to timeout.
    • getNumberOfApplicationRollbacks

      public long getNumberOfApplicationRollbacks()
      Description copied from interface: TxStatsMBean
      Returns the number of transactions that have been rolled back by application request. This includes those that timeout, since the timeout behaviour is considered an attribute of the application configuration.
      Specified by:
      getNumberOfApplicationRollbacks in interface TxStatsMBean
      Returns:
      the number of transactions that been rolled back by the application.
    • getNumberOfSystemRollbacks

      public long getNumberOfSystemRollbacks()
      Description copied from interface: TxStatsMBean
      Returns the number of transactions that have been rolled back due to internal system errors including failure to create log storage and failure to write a transaction log. It does not include rollbacks caused by resource failures.
      Specified by:
      getNumberOfSystemRollbacks in interface TxStatsMBean
      Returns:
      the number of transactions that been rolled back due to internal system errors including failure to create log storage and failure to write a transaction log.
    • getNumberOfResourceRollbacks

      public long getNumberOfResourceRollbacks()
      Description copied from interface: TxStatsMBean
      Returns the number of transactions that rolled back due to resource (participant) failure.
      Specified by:
      getNumberOfResourceRollbacks in interface TxStatsMBean
      Returns:
      the number of transactions that have been rolled back by participants.
    • printStatus

      public void printStatus(PrintWriter pw)
      Print all of the current statistics information.
      Parameters:
      pw - the writer to use.