public interface StatisticsRegistry
For advanced use only; operator authors should not need to access this class.
Provides a way to register statistics instrumentation with the framework.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionforAssignment(NodeAllocationState.AssignmentState assignment) Returns a statistics registry, re-scoped for the given assignmentbooleanIs the current registry scoped for connections? Returns true if the stats that are registered will be for connections.booleanReturns whether statistics are enabled.voidregister(RuntimeStatistic<?> statistic) Registers the given statistics object.<T extends StatisticSupplier>
voidregister(StatisticDefinition<T> definition, T supplier) Registers the given statistics object.
-
Field Details
-
DISABLED
A disabled statistics registry
-
-
Method Details
-
isEnabled
boolean isEnabled()Returns whether statistics are enabled.- Returns:
- whether statistics are enabled.
-
isConnection
boolean isConnection()Is the current registry scoped for connections? Returns true if the stats that are registered will be for connections. False if for operators.- Returns:
- whether the registry is scoped for connections
-
register
Registers the given statistics object. This call is ignored if statistics are not enabled.- Type Parameters:
T- the type of statistic supplier- Parameters:
definition- the statistic definitionsupplier- the statistic supplier; must be a live statistics object.
-
register
Registers the given statistics object. This call is ignored if statistics are not enabled.- Parameters:
statistic- the statistics object; must be a live statistics object.
-
forAssignment
Returns a statistics registry, re-scoped for the given assignment- Parameters:
assignment- the assignment- Returns:
- a statistics registry
-