com.arjuna.ats.arjuna.coordinator
Class TxStats

java.lang.Object
  extended by 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
static boolean enabled()
           
static TxStats getInstance()
           
 long getNumberOfAbortedTransactions()
          Returns the number of aborted (i.e.
 long getNumberOfApplicationRollbacks()
          Returns the number of transactions that have been rolled back by application request.
 long getNumberOfCommittedTransactions()
          Returns the number of committed transactions
 long getNumberOfHeuristics()
          Returns the number of transactions which have terminated with heuristic outcomes.
 long getNumberOfInflightTransactions()
          Get the number of transactions that have begun but not yet terminated.
 long getNumberOfNestedTransactions()
          Returns the total number of nested (sub) transactions created.
 long getNumberOfResourceRollbacks()
          Returns the number of transactions that rolled back due to resource (participant) failure.
 long getNumberOfTimedOutTransactions()
          Returns the number of transactions that have rolled back due to timeout.
 long getNumberOfTransactions()
          Returns the total number of transactions (top-level and nested) created
 void printStatus(PrintWriter pw)
          Print all of the current statistics information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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.

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.

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.


Copyright © 2011. All Rights Reserved.