Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
AlertManagerRuleTest Class Reference
Inheritance diagram for AlertManagerRuleTest:
Inheritance graph
Collaboration diagram for AlertManagerRuleTest:
Collaboration graph

Protected Member Functions

std::shared_ptr< alert_rulecreate_rule (const std::string &name, const std::string &metric="cpu_usage")
 

Protected Attributes

alert_manager manager_
 

Detailed Description

Definition at line 156 of file test_alert_manager.cpp.

Member Function Documentation

◆ create_rule()

std::shared_ptr< alert_rule > AlertManagerRuleTest::create_rule ( const std::string & name,
const std::string & metric = "cpu_usage" )
inlineprotected

Definition at line 160 of file test_alert_manager.cpp.

161 {
162 auto rule = std::make_shared<alert_rule>(name);
163 rule->set_metric_name(metric)
164 .set_severity(alert_severity::critical)
165 .set_trigger(threshold_trigger::above(80.0))
166 .set_summary("Test rule: " + name);
167 return rule;
168 }
static std::shared_ptr< threshold_trigger > above(double threshold)
Create trigger for value > threshold.
Basic metric structure for interface compatibility.

References kcenon::monitoring::threshold_trigger::above().

Here is the call graph for this function:

Member Data Documentation

◆ manager_

alert_manager AlertManagerRuleTest::manager_
protected

Definition at line 158 of file test_alert_manager.cpp.


The documentation for this class was generated from the following file: