Class TransactionMetricsAdapter
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.transactions.TransactionMetricsAdapter
-
- All Implemented Interfaces:
TransactionMetrics
public class TransactionMetricsAdapter extends Object implements TransactionMetrics
Tx metrics adapter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTransactionMetricsAdapter.TransactionMetricsSnapshotTransaction metrics snapshot.
-
Field Summary
Fields Modifier and Type Field Description static StringMETRIC_SYSTEM_TIME_HISTOGRAMMetric name for system time histogram on node.static long[]METRIC_TIME_BUCKETSHistogram buckets for metrics of system and user time.static StringMETRIC_TOTAL_SYSTEM_TIMEMetric name for total system time on node.static StringMETRIC_TOTAL_USER_TIMEMetric name for total user time on node.static StringMETRIC_USER_TIME_HISTOGRAMMetric name for user time histogram on node.
-
Constructor Summary
Constructors Constructor Description TransactionMetricsAdapter(GridKernalContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcommitTime()Gets last time transaction was committed.Map<String,String>getAllOwnerTransactions()Gets a map of all transactions for which the local node is the originating node.longgetLockedKeysNumber()The number of keys locked on the node.Map<String,String>getLongRunningOwnerTransactions(int duration)Gets a map of all transactions for which the local node is the originating node and which duration exceeds the given duration.longgetOwnerTransactionsNumber()The number of active transactions for which this node is the initiator.longgetTransactionsCommittedNumber()The number of transactions which were committed on the local node.longgetTransactionsHoldingLockNumber()The number of active transactions on the local node holding at least one key lock.longgetTransactionsRolledBackNumber()The number of transactions which were rolled back on the local node.voidonNearTxComplete(long systemTime, long userTime)Callback for completion of near transaction.voidonTxCommit()Transaction commit callback.voidonTxManagerStarted()Callback invoked whenIgniteTxManagerstarted.voidonTxRollback()Transaction rollback callback.voidreset()Reset.longrollbackTime()Gets last time transaction was rollback.TransactionMetricssnapshot()StringtoString()inttxCommits()Gets total number of transaction commits.inttxRollbacks()Gets total number of transaction rollbacks.
-
-
-
Field Detail
-
METRIC_TOTAL_SYSTEM_TIME
public static final String METRIC_TOTAL_SYSTEM_TIME
Metric name for total system time on node.- See Also:
- Constant Field Values
-
METRIC_SYSTEM_TIME_HISTOGRAM
public static final String METRIC_SYSTEM_TIME_HISTOGRAM
Metric name for system time histogram on node.- See Also:
- Constant Field Values
-
METRIC_TOTAL_USER_TIME
public static final String METRIC_TOTAL_USER_TIME
Metric name for total user time on node.- See Also:
- Constant Field Values
-
METRIC_USER_TIME_HISTOGRAM
public static final String METRIC_USER_TIME_HISTOGRAM
Metric name for user time histogram on node.- See Also:
- Constant Field Values
-
METRIC_TIME_BUCKETS
public static final long[] METRIC_TIME_BUCKETS
Histogram buckets for metrics of system and user time.
-
-
Constructor Detail
-
TransactionMetricsAdapter
public TransactionMetricsAdapter(GridKernalContext ctx)
- Parameters:
ctx- Kernal context.
-
-
Method Detail
-
onTxManagerStarted
public void onTxManagerStarted()
Callback invoked whenIgniteTxManagerstarted.
-
commitTime
public long commitTime()
Gets last time transaction was committed.- Specified by:
commitTimein interfaceTransactionMetrics- Returns:
- Last commit time.
-
rollbackTime
public long rollbackTime()
Gets last time transaction was rollback.- Specified by:
rollbackTimein interfaceTransactionMetrics- Returns:
- Last rollback time.
-
txCommits
public int txCommits()
Gets total number of transaction commits.- Specified by:
txCommitsin interfaceTransactionMetrics- Returns:
- Number of transaction commits.
-
txRollbacks
public int txRollbacks()
Gets total number of transaction rollbacks.- Specified by:
txRollbacksin interfaceTransactionMetrics- Returns:
- Number of transaction rollbacks.
-
getAllOwnerTransactions
public Map<String,String> getAllOwnerTransactions()
Gets a map of all transactions for which the local node is the originating node.- Specified by:
getAllOwnerTransactionsin interfaceTransactionMetrics- Returns:
- Map of local node owning transactions.
-
getLongRunningOwnerTransactions
public Map<String,String> getLongRunningOwnerTransactions(int duration)
Gets a map of all transactions for which the local node is the originating node and which duration exceeds the given duration.- Specified by:
getLongRunningOwnerTransactionsin interfaceTransactionMetrics- Parameters:
duration- Transaction duration.- Returns:
- Map of local node owning transactions which duration is longer than
duration.
-
getTransactionsCommittedNumber
public long getTransactionsCommittedNumber()
The number of transactions which were committed on the local node.- Specified by:
getTransactionsCommittedNumberin interfaceTransactionMetrics- Returns:
- The number of transactions which were committed on the local node.
-
getTransactionsRolledBackNumber
public long getTransactionsRolledBackNumber()
The number of transactions which were rolled back on the local node.- Specified by:
getTransactionsRolledBackNumberin interfaceTransactionMetrics- Returns:
- The number of transactions which were rolled back on the local node.
-
getTransactionsHoldingLockNumber
public long getTransactionsHoldingLockNumber()
The number of active transactions on the local node holding at least one key lock.- Specified by:
getTransactionsHoldingLockNumberin interfaceTransactionMetrics- Returns:
- The number of active transactions holding at least one key lock.
-
getLockedKeysNumber
public long getLockedKeysNumber()
The number of keys locked on the node.- Specified by:
getLockedKeysNumberin interfaceTransactionMetrics- Returns:
- The number of keys locked on the node.
-
getOwnerTransactionsNumber
public long getOwnerTransactionsNumber()
The number of active transactions for which this node is the initiator. Effectively, this method is semantically equivalent togetAllOwnerTransactions.size().- Specified by:
getOwnerTransactionsNumberin interfaceTransactionMetrics- Returns:
- The number of active transactions for which this node is the initiator.
-
onTxCommit
public void onTxCommit()
Transaction commit callback.
-
onTxRollback
public void onTxRollback()
Transaction rollback callback.
-
onNearTxComplete
public void onNearTxComplete(long systemTime, long userTime)Callback for completion of near transaction. Writes metrics of single near transaction.- Parameters:
systemTime- Transaction system time.userTime- Transaction user time.
-
reset
public void reset()
Reset.
-
snapshot
public TransactionMetrics snapshot()
- Returns:
- Current metrics values.
-
-