R extends TableMultiResult>
- All Implemented Interfaces:
TODO: Instead of a fixed history size, aggregate data into larger time ranges and keep track of mean, min, max, and standard deviation (or perhaps 5th/95th percentile?). Keep the following time ranges:
1 minute for 2 days = 2880 samples 5 minutes for 5 days = 1440 samples 15 minutes for 7 days = 672 samples 30 minutes for 14 days = 672 samples 1 hour for 28 days = 672 samples 2 hours for 56 days = 672 samples 4 hours for 112 days = 672 samples 1 day forever beyond this ================================== total: 7680 samples + one per day beyond 224 days
Update in a single background thread across all workers, and handle recovery from unexpected shutdown gracefully by inserting aggregate before removing samples, and detect on next aggregation. Also, the linked list should always be sorted by time descending, confirm this on aggregation pass.
- AO Industries, Inc.
Method SummaryModifier and TypeMethodDescription
protected voidCancels the current getSample call on a best-effort basis.
protected abstract AlertLevelAndMessageDetermines the alert level and message for the provided result.
protected longThe default future timeout is 5 minutes.
protected TimeUnitThe default future timeout unit is MINUTES.
protected abstract intThe number of history items to store.
protected intThe default startup delay is within five minutes.
protected abstract SThis is the main monitor routine.
protected longThe default sleep delay is five minutes when successful or one minute when unsuccessful.
(boolean isError)Enables incremental alert level ramp-up, where the node's alert level is only incremented one step at a time per monitoring pass.
protected abstract RCreates a new result container object for error condition.
protected abstract RCreates a new result container object for success condition.
protected booleanBy default, the call to
Futureand times-out at 5 minutes.
getNextStartupDelayprotected int getNextStartupDelay()The default startup delay is within five minutes.
isIncrementalRampUpprotected boolean isIncrementalRampUp
(boolean isError)Enables incremental alert level ramp-up, where the node's alert level is only incremented one step at a time per monitoring pass. This makes the resource more tolerant of intermittent problems, at the cost of slower reaction time.
Enabled by default
runpublic final void run()
getSleepDelayprotected long getSleepDelay
(boolean lastSuccessful, AlertLevel alertLevel)The default sleep delay is five minutes when successful or one minute when unsuccessful.
null, treated as
getHistorySizeprotected abstract int getHistorySize()The number of history items to store.
getSampleThis is the main monitor routine. Gets the current sample for this worker, any error should result in an exception. The sample may be any object that encapsulates the state of the resource in order to determine its alert level, alert message, and overall result.
newErrorResultCreates a new result container object for error condition.
newSampleResultCreates a new result container object for success condition.
cancelCancels the current getSample call on a best-effort basis. Implementations of this method must not block. This default implementation calls
getAlertLevelAndMessageprotected abstract AlertLevelAndMessage getAlertLevelAndMessage
(S sample, Iterable<? extends R> previousResults) throws ExceptionDetermines the alert level and message for the provided result. If unable to parse, may throw an exception to report the error. This should not block or delay for any reason.
useFutureTimeoutprotected boolean useFutureTimeout()By default, the call to
Futureand times-out at 5 minutes. If the monitoring check cannot block indefinitely, it is more efficient to not use this decoupling.
getFutureTimeoutprotected long getFutureTimeout()The default future timeout is 5 minutes.
getFutureTimeoutUnitprotected TimeUnit getFutureTimeoutUnit()The default future timeout unit is MINUTES.
- See Also: