5.4.16. AlertInfo
-
class AlertInfo
Subclassed by eprosima::statistics_backend::NewDataAlertInfo, eprosima::statistics_backend::NoDataAlertInfo
Public Functions
-
AlertInfo() = default
Default constructor.
-
inline AlertInfo(AlertKind alert_kind, std::string name, EntityId domain_id, std::string host_name, std::string user_name, std::string topic_name, AlertComparison cmp, double trigger_threshold, std::chrono::milliseconds time_between_triggers, bool timeout_enabled = false, std::chrono::milliseconds time_to_timeout = std::chrono::milliseconds(0))
Constructor.
-
inline void reset()
Reset the last trigger time to now.
-
inline bool entity_matches(std::string stat_host, std::string stat_user, std::string stat_topic) const
Check if the entity parameters match (empty parameters are wildcards)
-
inline bool value_triggers(double value) const
Check if the value triggers the alert based on the comparison and threshold.
-
inline bool value_triggers(uint64_t value) const
Check if the value triggers the alert based on the comparison and threshold.
-
inline bool time_allows_trigger() const
Check if enough time has passed since the last trigger.
-
inline bool check_trigger_conditions(std::string host, std::string user, std::string topic, double value)
Check trigger conditions for a specific alert that uses a double value.
-
inline bool check_trigger_conditions(std::string host, std::string user, std::string topic, uint64_t value)
Check trigger conditions for a specific alert that uses an integer value.
-
inline bool check_timeout()
Check if a timeout has occurred.
-
inline bool trigger()
Trigger the alert (reset time and return true)
-
inline void set_id(AlertId alert_id)
Set the alert ID.
-
inline AlertId get_alert_id() const
Get the alert ID.
-
inline AlertKind get_alert_kind() const
Get the alert kind.
-
inline std::string get_alert_name() const
Get the alert name.
-
inline std::string get_host_name() const
Get the host name.
-
inline std::string get_user_name() const
Get the user name.
-
inline std::string get_topic_name() const
Get the topic name.
-
inline double get_trigger_threshold() const
Get the trigger threshold.
-
inline std::chrono::milliseconds get_time_between_triggers() const
Get the minimum time between triggers.
-
inline void add_notifier(NotifierId notifier_id)
Add a notifier to the alert.
-
inline void remove_notifier(NotifierId notifier_id)
Remove a notifier from the alert.
-
inline const std::vector<NotifierId> &get_notifiers() const
Get the list of notifiers.
-
AlertInfo() = default