Class AlertDefaultMonitor
java.lang.Object
com.kingsrook.qqq.backend.core.alerts.AlertDefaultMonitor
- All Implemented Interfaces:
Serializable
A monitor that an alert type ships with ("seeded"). An alerts
implementation inserts it once; after that it belongs to the admin, who may
tune or disable it. Without an implementation installed it does nothing.
The definition's keys depend on the kind (e.g. HEARTBEAT takes heartbeatKey
or processName, plus expectedEverySeconds and graceSeconds; TABLE_QUERY
takes tableName and filter). Values must be JSON-friendly.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter for definitionGetter for forMinutesgetKind()Getter for kindgetName()Getter for nameGetter for perRecordGetter for scheduleSecondsGetter for severitystatic AlertDefaultMonitorA heartbeat monitor: raise when the key has not beat within the expected interval plus grace.withDefinition(Map<String, Serializable> definition) Fluent setter for definitionwithDefinitionValue(String key, Serializable value) Set one definition value.withForMinutes(Integer forMinutes) Fluent setter for forMinutes (how long a condition must hold before it fires)withKind(AlertMonitorKind kind) Fluent setter for kindFluent setter for namewithPerRecord(Boolean perRecord) Fluent setter for perRecord (one alert per matching record, instead of one aggregate alert)withScheduleSeconds(Integer scheduleSeconds) Fluent setter for scheduleSeconds (how often to evaluate)withSeverity(AlertSeverity severity) Fluent setter for severity (default: the type's severity)
-
Constructor Details
-
AlertDefaultMonitor
public AlertDefaultMonitor()
-
-
Method Details
-
heartbeat
public static AlertDefaultMonitor heartbeat(String name, String heartbeatKey, int expectedEverySeconds, int graceSeconds) A heartbeat monitor: raise when the key has not beat within the expected interval plus grace. -
getName
Getter for name -
withName
Fluent setter for name -
getKind
Getter for kind -
withKind
Fluent setter for kind -
getDefinition
Getter for definition -
withDefinition
Fluent setter for definition -
withDefinitionValue
Set one definition value. -
getPerRecord
Getter for perRecord -
withPerRecord
Fluent setter for perRecord (one alert per matching record, instead of one aggregate alert) -
getSeverity
Getter for severity -
withSeverity
Fluent setter for severity (default: the type's severity) -
getScheduleSeconds
Getter for scheduleSeconds -
withScheduleSeconds
Fluent setter for scheduleSeconds (how often to evaluate) -
getForMinutes
Getter for forMinutes -
withForMinutes
Fluent setter for forMinutes (how long a condition must hold before it fires)
-