Class CoordinatorRunStats
- java.lang.Object
-
- org.apache.druid.server.coordinator.stats.CoordinatorRunStats
-
@ThreadSafe public class CoordinatorRunStats extends Object
Contains statistics typically tracked during a single coordinator run or the runtime of a single coordinator duty.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCoordinatorRunStats.StatHandler
-
Constructor Summary
Constructors Constructor Description CoordinatorRunStats()CoordinatorRunStats(Map<Dimension,String> debugDimensions)Creates a newCoordinatorRunStats.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(CoordinatorStat stat, long value)voidadd(CoordinatorStat stat, RowKey rowKey, long value)voidaddToSegmentStat(CoordinatorStat stat, String tier, String datasource, long value)StringbuildStatsTable()Builds a printable table of all the collected error, info and debug level stats (if there are qualifying debugDimensions) with non-zero values.voidclear()static CoordinatorRunStatsempty()voidforEachStat(CoordinatorRunStats.StatHandler handler)longget(CoordinatorStat stat)longget(CoordinatorStat stat, RowKey rowKey)longgetSegmentStat(CoordinatorStat stat, String tier, String datasource)CoordinatorRunStatsgetSnapshotAndReset()Creates a newCoordinatorRunStatswhich represents the snapshot of the stats collected so far in this instance.booleanhasStat(CoordinatorStat stat)introwCount()voidupdateMax(CoordinatorStat stat, RowKey rowKey, long value)Updates the maximum value of the stat for the given RowKey if applicable.
-
-
-
Method Detail
-
empty
public static CoordinatorRunStats empty()
-
getSegmentStat
public long getSegmentStat(CoordinatorStat stat, String tier, String datasource)
-
get
public long get(CoordinatorStat stat)
-
get
public long get(CoordinatorStat stat, RowKey rowKey)
-
forEachStat
public void forEachStat(CoordinatorRunStats.StatHandler handler)
-
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.
-
hasStat
public boolean hasStat(CoordinatorStat stat)
-
rowCount
public int rowCount()
-
clear
public void clear()
-
add
public void add(CoordinatorStat stat, long value)
-
add
public void add(CoordinatorStat stat, RowKey rowKey, long value)
-
addToSegmentStat
public void addToSegmentStat(CoordinatorStat stat, String tier, String datasource, long value)
-
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 newCoordinatorRunStatswhich 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.
-
-