Class CoordinatorRunStats


  • @ThreadSafe
    public class CoordinatorRunStats
    extends Object
    Contains statistics typically tracked during a single coordinator run or the runtime of a single coordinator duty.
    • Constructor Detail

      • CoordinatorRunStats

        public CoordinatorRunStats()
      • CoordinatorRunStats

        public CoordinatorRunStats​(Map<Dimension,​String> debugDimensions)
        Creates a new CoordinatorRunStats.
        Parameters:
        debugDimensions - Dimension values for which all metrics should be collected and logged.
    • Method Detail

      • buildStatsTable

        public String buildStatsTable()
        Builds a printable table of all the collected error, info and debug level stats (if there are qualifying debugDimensions) with non-zero values.
      • rowCount

        public int rowCount()
      • clear

        public void clear()
      • updateMax

        public void updateMax​(CoordinatorStat stat,
                              RowKey rowKey,
                              long value)
        Updates the maximum value of the stat for the given RowKey if applicable.
      • getSnapshotAndReset

        public CoordinatorRunStats getSnapshotAndReset()
        Creates a new CoordinatorRunStats which represents the snapshot of the stats collected so far in this instance.

        While this method is in progress, any updates made to the stats of this instance by another thread are not guaranteed to be present in the snapshot. But the snapshots are consistent, i.e. stats present in the snapshot created in one invocation of this method are permanently removed from this instance and will not be present in subsequent snapshots.

        Returns:
        Snapshot of the current state of this CoordinatorRunStats.