Package org.openspaces.admin
Interface StatisticsMonitor
- All Known Subinterfaces:
Admin,InternalAdmin,InternalOperatingSystem,InternalOperatingSystems,InternalProcessingUnit,InternalProcessingUnitInstance,InternalProcessingUnits,InternalSpace,InternalSpaceInstance,InternalSpaces,InternalTransport,InternalTransports,InternalVirtualMachine,InternalVirtualMachines,OperatingSystem,OperatingSystems,ProcessingUnit,ProcessingUnitInstance,ProcessingUnits,Space,SpaceInstance,Spaces,Transport,Transports,VirtualMachine,VirtualMachines
- All Known Implementing Classes:
DefaultAdmin,DefaultOperatingSystem,DefaultOperatingSystems,DefaultProcessingUnit,DefaultProcessingUnitInstance,DefaultProcessingUnits,DefaultSpace,DefaultSpaceInstance,DefaultSpaces,DefaultTransport,DefaultTransports,DefaultVirtualMachine,DefaultVirtualMachines
public interface StatisticsMonitor
Components implement this interface indicating that they can be monitored for statistics.
Components will allow to get their respective statistics without being monitoring (while caching the calls for the provided statistics interval).
Monitoring statistics is only required when wanting to receive statistics change events.
The statistics interval controls either for how long the latest statistics call will be cached, or, when monitoring is enabled, the interval the statistics will be pooled. Its default value is 5 seconds.
- Author:
- kimchy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default history size stored in statistics.static final longThe default statistics interval which is 5 seconds. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif statistics are now being monitored.voidsetStatisticsHistorySize(int historySize) Sets the history size of number of statistics stored.voidsetStatisticsInterval(long interval, TimeUnit timeUnit) Sets the statistics interval, automatically updating the monitoring scheduled tasks if monitoring is enabled.voidStarts the statistics monitor, starting a scheduled monitor that polls for statistics.voidStops the statistics monitor.
-
Field Details
-
DEFAULT_MONITOR_INTERVAL
static final long DEFAULT_MONITOR_INTERVALThe default statistics interval which is 5 seconds.- See Also:
-
DEFAULT_HISTORY_SIZE
static final int DEFAULT_HISTORY_SIZEThe default history size stored in statistics.- See Also:
-
-
Method Details
-
setStatisticsInterval
Sets the statistics interval, automatically updating the monitoring scheduled tasks if monitoring is enabled.- Since:
- 8.0 Restarts monitoring, with new interval, if no other party is already monitoring for statistics.
-
setStatisticsHistorySize
void setStatisticsHistorySize(int historySize) Sets the history size of number of statistics stored. -
startStatisticsMonitor
void startStatisticsMonitor()Starts the statistics monitor, starting a scheduled monitor that polls for statistics. Monitoring is required only when wanting to receive statistics change events.- Since:
- 8.0 Restarts monitoring if no other party is already monitoring for statistics.
-
stopStatisticsMonitor
void stopStatisticsMonitor()Stops the statistics monitor.- Since:
- 8.0 Stops monitoring if no other party is monitoring for statistics.
-
isMonitoring
boolean isMonitoring()Returnstrueif statistics are now being monitored.
-