Class CoordinatorStat
- java.lang.Object
-
- org.apache.druid.server.coordinator.stats.CoordinatorStat
-
public class CoordinatorStat extends Object
A coordinator statistic, which may or may not be emitted as a metric.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCoordinatorStat.LevelLevel of coordinator stat, typically used for logging.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CoordinatorStat.LevelgetLevel()Level of this stat, typically used for logging.StringgetMetricName()StringgetShortName()Unique name used while logging this stat.booleanshouldEmit()Whether this statistic should be emitted as a metric.static CoordinatorStattoDebugAndEmit(String shortName, String metricName)Creates a new DEBUG level stat which is also emitted as a metric.static CoordinatorStattoDebugOnly(String shortName)Creates a new DEBUG level stat which is not emitted as a metric.static CoordinatorStattoLogAndEmit(String shortName, String metricName, CoordinatorStat.Level level)Creates a new stat of the specified level, which is also emitted as a metric.StringtoString()
-
-
-
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 statmetricName- 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 statmetricName- Name to be used when emitting this stat as a metriclevel- Logging level for this stat
-
getMetricName
public String getMetricName()
- Returns:
- Metric name to be used when emitting this stat.
nullif this stat should not be emitted.
-
getShortName
public String getShortName()
Unique name used while logging this stat.
-
getLevel
public CoordinatorStat.Level getLevel()
Level of this stat, typically used for logging.
-
shouldEmit
public boolean shouldEmit()
Whether this statistic should be emitted as a metric.
-
-