Class TransactionMetricsAdapter

    • 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 when IgniteTxManager started.
      • commitTime

        public long commitTime()
        Gets last time transaction was committed.
        Specified by:
        commitTime in interface TransactionMetrics
        Returns:
        Last commit time.
      • rollbackTime

        public long rollbackTime()
        Gets last time transaction was rollback.
        Specified by:
        rollbackTime in interface TransactionMetrics
        Returns:
        Last rollback time.
      • txCommits

        public int txCommits()
        Gets total number of transaction commits.
        Specified by:
        txCommits in interface TransactionMetrics
        Returns:
        Number of transaction commits.
      • txRollbacks

        public int txRollbacks()
        Gets total number of transaction rollbacks.
        Specified by:
        txRollbacks in interface TransactionMetrics
        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:
        getAllOwnerTransactions in interface TransactionMetrics
        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:
        getLongRunningOwnerTransactions in interface TransactionMetrics
        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:
        getTransactionsCommittedNumber in interface TransactionMetrics
        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:
        getTransactionsRolledBackNumber in interface TransactionMetrics
        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:
        getTransactionsHoldingLockNumber in interface TransactionMetrics
        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:
        getLockedKeysNumber in interface TransactionMetrics
        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 to getAllOwnerTransactions.size().
        Specified by:
        getOwnerTransactionsNumber in interface TransactionMetrics
        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.