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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanenabled()longgetAverageCommitTime()Returns the average time, in nanoseconds, it is taking to commit a transaction.static TxStatsgetInstance()longgetNumberOfAbortedTransactions()Returns the number of aborted (i.e.longgetNumberOfApplicationRollbacks()Returns the number of transactions that have been rolled back by application request.longgetNumberOfCommittedTransactions()Returns the number of committed transactionslonggetNumberOfHeuristics()Returns the number of transactions which have terminated with heuristic outcomes.longgetNumberOfInflightTransactions()Get the number of transactions that have begun but not yet terminated.longgetNumberOfNestedTransactions()Returns the total number of nested (sub) transactions created.longgetNumberOfResourceRollbacks()Returns the number of transactions that rolled back due to resource (participant) failure.longgetNumberOfSystemRollbacks()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.longgetNumberOfTimedOutTransactions()Returns the number of transactions that have rolled back due to timeout.longgetNumberOfTransactions()Returns the total number of transactions (top-level and nested) createdvoidprintStatus(PrintWriter pw)Print all of the current statistics information.
-
-
-
Method Detail
-
enabled
public static boolean enabled()
-
getInstance
public static TxStats getInstance()
-
getNumberOfTransactions
public long getNumberOfTransactions()
Description copied from interface:TxStatsMBeanReturns the total number of transactions (top-level and nested) created- Specified by:
getNumberOfTransactionsin interfaceTxStatsMBean- Returns:
- the number of transactions (top-level and nested) created so far.
-
getNumberOfNestedTransactions
public long getNumberOfNestedTransactions()
Description copied from interface:TxStatsMBeanReturns 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:
getNumberOfNestedTransactionsin interfaceTxStatsMBean- Returns:
- the number of nested (sub) transactions created so far.
-
getNumberOfHeuristics
public long getNumberOfHeuristics()
Description copied from interface:TxStatsMBeanReturns the number of transactions which have terminated with heuristic outcomes.- Specified by:
getNumberOfHeuristicsin interfaceTxStatsMBean- Returns:
- the number of transactions which have terminated with heuristic outcomes.
-
getNumberOfCommittedTransactions
public long getNumberOfCommittedTransactions()
Description copied from interface:TxStatsMBeanReturns the number of committed transactions- Specified by:
getNumberOfCommittedTransactionsin interfaceTxStatsMBean- Returns:
- the number of committed transactions.
-
getAverageCommitTime
public long getAverageCommitTime()
Description copied from interface:TxStatsMBeanReturns 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;
- Specified by:
getAverageCommitTimein interfaceTxStatsMBean- Returns:
- the average time, in nanoseconds, it has taken to commit a transaction.
-
getNumberOfAbortedTransactions
public long getNumberOfAbortedTransactions()
Description copied from interface:TxStatsMBeanReturns the number of aborted (i.e. rolledback) transactions- Specified by:
getNumberOfAbortedTransactionsin interfaceTxStatsMBean- Returns:
- the total number of transactions which have rolled back.
-
getNumberOfInflightTransactions
public long getNumberOfInflightTransactions()
Description copied from interface:TxStatsMBeanGet the number of transactions that have begun but not yet terminated. Note: This count is approximate, particularly in recovery situations.- Specified by:
getNumberOfInflightTransactionsin interfaceTxStatsMBean- Returns:
- total number of inflight (active) transactions.
-
getNumberOfTimedOutTransactions
public long getNumberOfTimedOutTransactions()
Description copied from interface:TxStatsMBeanReturns the number of transactions that have rolled back due to timeout.- Specified by:
getNumberOfTimedOutTransactionsin interfaceTxStatsMBean- Returns:
- the number of transactions that have rolled back due to timeout.
-
getNumberOfApplicationRollbacks
public long getNumberOfApplicationRollbacks()
Description copied from interface:TxStatsMBeanReturns 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:
getNumberOfApplicationRollbacksin interfaceTxStatsMBean- Returns:
- the number of transactions that been rolled back by the application.
-
getNumberOfSystemRollbacks
public long getNumberOfSystemRollbacks()
Description copied from interface:TxStatsMBeanReturns 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:
getNumberOfSystemRollbacksin interfaceTxStatsMBean- 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:TxStatsMBeanReturns the number of transactions that rolled back due to resource (participant) failure.- Specified by:
getNumberOfResourceRollbacksin interfaceTxStatsMBean- 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.
-
-