A single alert event: a metric crossing (or recovering from) a threshold, with the reading that triggered it.
More...
#include <AlertEvent.h>
|
| | AlertEvent () |
| | Builds an undefined alert event (OK level, sentinel -1 values). More...
|
| |
| | AlertEvent (const std::string &metricName, const EAlertLevel alertLevel, const float currentReadingValue, const float valueThreshold, const std::string &eventSummary) |
| | Builds an alert event from its metric, level, triggering reading, threshold, and summary. More...
|
| |
| virtual | ~AlertEvent ()=default |
| | Defaulted destructor. More...
|
| |
| std::string | ToString () const |
| | Serializes the metric, alert level, triggering reading, threshold, and summary to a string. More...
|
| |
| const std::string & | GetMetricName () const |
| | Gets the metric that triggered the event. More...
|
| |
| EAlertLevel | GetAlertLevel () const |
| | Gets the alert level of the event. More...
|
| |
| float | GetCurrentReadingValue () const |
| | Gets the reading that triggered the event. More...
|
| |
| float | GetValueThreshold () const |
| | Gets the threshold the reading crossed. More...
|
| |
| const std::string & | GetEventSummary () const |
| | Gets the human-readable summary of the event. More...
|
| |
| void | SetMetricName (const std::string &metricName) |
| | Sets the metric that triggered the event. More...
|
| |
| void | SetAlertLevel (const EAlertLevel alertLevel) |
| | Sets the alert level of the event. More...
|
| |
| void | SetCurrentReadingValue (const float currentReadingValue) |
| | Sets the reading that triggered the event. More...
|
| |
| void | SetValueThreshold (const float currentValueThreshold) |
| | Sets the threshold the reading crossed. More...
|
| |
| void | SetEventSummary (const std::string &eventSummary) |
| | Sets the human-readable summary of the event. More...
|
| |
A single alert event: a metric crossing (or recovering from) a threshold, with the reading that triggered it.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
◆ AlertEvent() [1/2]
| RumPi::AlertEvent::AlertEvent |
( |
| ) |
|
Builds an undefined alert event (OK level, sentinel -1 values).
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
AlertEvent()
Builds an undefined alert event (OK level, sentinel -1 values).
Definition: AlertEvent.cpp:15
◆ AlertEvent() [2/2]
| RumPi::AlertEvent::AlertEvent |
( |
const std::string & |
metricName, |
|
|
const EAlertLevel |
alertLevel, |
|
|
const float |
currentReadingValue, |
|
|
const float |
valueThreshold, |
|
|
const std::string & |
eventSummary |
|
) |
| |
Builds an alert event from its metric, level, triggering reading, threshold, and summary.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
@ Alert
The metric has crossed its alert threshold.
Definition: Common.h:97
- Parameters
-
| [in] | metricName | The metric that triggered the event. |
| [in] | alertLevel | The alert level (OK, Warning, or Alert). |
| [in] | currentReadingValue | The reading that triggered the event. |
| [in] | valueThreshold | The threshold it crossed. |
| [in] | eventSummary | A human-readable summary of the event. |
◆ ~AlertEvent()
| virtual RumPi::AlertEvent::~AlertEvent |
( |
| ) |
|
|
virtualdefault |
Defaulted destructor.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
◆ GetAlertLevel()
Gets the alert level of the event.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
EAlertLevel
Severity of a metric relative to its thresholds.
Definition: Common.h:94
- Returns
- The alert level (OK, Warning, or Alert).
◆ GetCurrentReadingValue()
| float RumPi::AlertEvent::GetCurrentReadingValue |
( |
| ) |
const |
Gets the reading that triggered the event.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
float reading = event.GetCurrentReadingValue();
- Returns
- The triggering reading.
◆ GetEventSummary()
| const std::string & RumPi::AlertEvent::GetEventSummary |
( |
| ) |
const |
Gets the human-readable summary of the event.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
std::string summary = event.GetEventSummary();
- Returns
- The event summary.
◆ GetMetricName()
| const std::string & RumPi::AlertEvent::GetMetricName |
( |
| ) |
const |
Gets the metric that triggered the event.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
std::string metric = event.GetMetricName();
- Returns
- The metric name.
◆ GetValueThreshold()
| float RumPi::AlertEvent::GetValueThreshold |
( |
| ) |
const |
Gets the threshold the reading crossed.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
float threshold = event.GetValueThreshold();
- Returns
- The threshold value.
◆ SetAlertLevel()
| void RumPi::AlertEvent::SetAlertLevel |
( |
const EAlertLevel |
alertLevel | ) |
|
Sets the alert level of the event.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
@ Warning
The metric has crossed its warning threshold.
Definition: Common.h:96
- Parameters
-
| [in] | alertLevel | The alert level to set. |
◆ SetCurrentReadingValue()
| void RumPi::AlertEvent::SetCurrentReadingValue |
( |
const float |
currentReadingValue | ) |
|
Sets the reading that triggered the event.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
event.SetCurrentReadingValue(82.0f);
- Parameters
-
| [in] | currentReadingValue | The triggering reading to set. |
◆ SetEventSummary()
| void RumPi::AlertEvent::SetEventSummary |
( |
const std::string & |
eventSummary | ) |
|
Sets the human-readable summary of the event.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
event.SetEventSummary("CPU over temperature.");
- Parameters
-
| [in] | eventSummary | The event summary to set. |
◆ SetMetricName()
| void RumPi::AlertEvent::SetMetricName |
( |
const std::string & |
metricName | ) |
|
Sets the metric that triggered the event.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
event.SetMetricName("SystemTemperature");
- Parameters
-
| [in] | metricName | The metric name to set. |
◆ SetValueThreshold()
| void RumPi::AlertEvent::SetValueThreshold |
( |
const float |
currentValueThreshold | ) |
|
Sets the threshold the reading crossed.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
event.SetValueThreshold(80.0f);
- Parameters
-
| [in] | currentValueThreshold | The threshold value to set. |
◆ ToString()
| std::string RumPi::AlertEvent::ToString |
( |
| ) |
const |
Serializes the metric, alert level, triggering reading, threshold, and summary to a string.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026
std::string data = event.ToString();
- Returns
- A multi-line string describing the alert event.
◆ myAlertLevel
OK (recovered), Warning, or Alert.
◆ myCurrentReadingValue
| float RumPi::AlertEvent::myCurrentReadingValue |
|
protected |
The reading that triggered the event.
◆ myEventSummary
| std::string RumPi::AlertEvent::myEventSummary |
|
protected |
◆ myMetricName
| std::string RumPi::AlertEvent::myMetricName |
|
protected |
The metric that triggered the event, e.g. "SystemTemperature".
◆ myValueThreshold
| float RumPi::AlertEvent::myValueThreshold |
|
protected |
The documentation for this class was generated from the following files: