Class TxStats
java.lang.Object
com.arjuna.ats.arjuna.coordinator.TxStats
- All Implemented Interfaces:
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
Modifier and TypeMethodDescriptionstatic boolean
enabled()
long
Returns the average time, in nanoseconds, it is taking to commit a transaction.static TxStats
long
Returns the number of aborted (i.e.long
Returns the number of transactions that have been rolled back by application request.long
Returns the number of committed transactionslong
Returns the number of transactions which have terminated with heuristic outcomes.long
Get the number of transactions that have begun but not yet terminated.long
Returns the total number of nested (sub) transactions created.long
Returns the number of transactions that rolled back due to resource (participant) failure.long
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.long
Returns the number of transactions that have rolled back due to timeout.long
Returns the total number of transactions (top-level and nested) createdvoid
Print all of the current statistics information.
-
Method Details
-
enabled
public static boolean enabled() -
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 interfaceTxStatsMBean
- 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 interfaceTxStatsMBean
- 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 interfaceTxStatsMBean
- 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 interfaceTxStatsMBean
- 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;
- Specified by:
getAverageCommitTime
in interfaceTxStatsMBean
- 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 interfaceTxStatsMBean
- 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 interfaceTxStatsMBean
- 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 interfaceTxStatsMBean
- 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 interfaceTxStatsMBean
- 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 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:TxStatsMBean
Returns the number of transactions that rolled back due to resource (participant) failure.- Specified by:
getNumberOfResourceRollbacks
in interfaceTxStatsMBean
- Returns:
- the number of transactions that have been rolled back by participants.
-
printStatus
Print all of the current statistics information.- Parameters:
pw
- the writer to use.
-