Class CoordinatorStat


  • public class CoordinatorStat
    extends Object
    A coordinator statistic, which may or may not be emitted as a metric.
    • Method Detail

      • toDebugOnly

        public static CoordinatorStat toDebugOnly​(String shortName)
        Creates a new DEBUG level stat which is not emitted as a metric.
        Parameters:
        shortName - Unique name used while logging the stat
      • toDebugAndEmit

        public static CoordinatorStat toDebugAndEmit​(String shortName,
                                                     String metricName)
        Creates a new DEBUG level stat which is also emitted as a metric.
        Parameters:
        shortName - Unique name used while logging the stat
        metricName - Name to be used when emitting this stat as a metric
      • toLogAndEmit

        public static CoordinatorStat toLogAndEmit​(String shortName,
                                                   String metricName,
                                                   CoordinatorStat.Level level)
        Creates a new stat of the specified level, which is also emitted as a metric.
        Parameters:
        shortName - Unique name used while logging the stat
        metricName - Name to be used when emitting this stat as a metric
        level - Logging level for this stat
      • getMetricName

        public String getMetricName()
        Returns:
        Metric name to be used when emitting this stat. null if this stat should not be emitted.
      • getShortName

        public String getShortName()
        Unique name used while logging this stat.
      • shouldEmit

        public boolean shouldEmit()
        Whether this statistic should be emitted as a metric.