Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
kcenon::monitoring::alert_pipeline Class Reference

Configurable alert processing pipeline. More...

#include <alert_pipeline.h>

Collaboration diagram for kcenon::monitoring::alert_pipeline:
Collaboration graph

Public Member Functions

void add_stage (std::shared_ptr< pipeline_stage > stage)
 Add a processing stage.
 
bool process (alert &a)
 Process an alert through all stages.
 
std::vector< std::string > stage_names () const
 Get stage names.
 

Private Attributes

std::vector< std::shared_ptr< pipeline_stage > > stages_
 

Detailed Description

Configurable alert processing pipeline.

Allows building custom alert processing workflows by chaining multiple processing stages together.

Definition at line 615 of file alert_pipeline.h.

Member Function Documentation

◆ add_stage()

void kcenon::monitoring::alert_pipeline::add_stage ( std::shared_ptr< pipeline_stage > stage)
inline

Add a processing stage.

Examples
/home/runner/work/monitoring_system/monitoring_system/include/kcenon/monitoring/alert/alert_pipeline.h.

Definition at line 620 of file alert_pipeline.h.

620 {
621 stages_.push_back(std::move(stage));
622 }
std::vector< std::shared_ptr< pipeline_stage > > stages_

References stages_.

◆ process()

bool kcenon::monitoring::alert_pipeline::process ( alert & a)
inline

Process an alert through all stages.

Parameters
aAlert to process
Returns
True if alert passed all stages

Definition at line 629 of file alert_pipeline.h.

629 {
630 for (const auto& stage : stages_) {
631 if (!stage->process(a)) {
632 return false;
633 }
634 }
635 return true;
636 }

References stages_.

◆ stage_names()

std::vector< std::string > kcenon::monitoring::alert_pipeline::stage_names ( ) const
inline

Get stage names.

Examples
/home/runner/work/monitoring_system/monitoring_system/include/kcenon/monitoring/alert/alert_pipeline.h.

Definition at line 641 of file alert_pipeline.h.

641 {
642 std::vector<std::string> names;
643 names.reserve(stages_.size());
644 for (const auto& stage : stages_) {
645 names.push_back(stage->name());
646 }
647 return names;
648 }

References stages_.

Member Data Documentation

◆ stages_

std::vector<std::shared_ptr<pipeline_stage> > kcenon::monitoring::alert_pipeline::stages_
private

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