NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
NES::Monitoring::MonitoringAgent Class Reference

The MonitoringAgent which is responsible for collecting metrics on a local level. More...

#include <MonitoringAgent.hpp>

Public Member Functions

 MonitoringAgent ()
 
 MonitoringAgent (bool enabled)
 
 MonitoringAgent (MonitoringPlanPtr monitoringPlan, MonitoringCatalogPtr catalog, bool enabled)
 
const std::vector< MetricPtrgetMetricsFromPlan () const
 Collect the metrics and store them in to the given output. The collected metrics depend on the monitoring plan. If monitoring is disabled an empty vector will be returned. More...
 
nlohmann::json getMetricsAsJson ()
 Returns all metrics defined by the plan as a unified JSON. More...
 
bool isEnabled () const
 Checks if monitoring is enabled. More...
 
MonitoringPlanPtr getMonitoringPlan () const
 Getter for the MonitoringPlan. More...
 
void setMonitoringPlan (MonitoringPlanPtr monitoringPlan)
 set the monitoring plan More...
 
RegistrationMetrics getRegistrationMetrics ()
 Return the metrics required for node registration. More...
 
bool addMonitoringStreams (const Configurations::WorkerConfigurationPtr workerConfig)
 Adds the monitoring streams based on the monitoring plan to the worker config. More...
 
void setNodeId (WorkerId nodeId)
 Set the node ID of the topology node. More...
 

Static Public Member Functions

static MonitoringAgentPtr create ()
 
static MonitoringAgentPtr create (bool enabled)
 
static MonitoringAgentPtr create (MonitoringPlanPtr monitoringPlan, MonitoringCatalogPtr catalog, bool enabled)
 

Detailed Description

The MonitoringAgent which is responsible for collecting metrics on a local level.

Constructor & Destructor Documentation

◆ MonitoringAgent() [1/3]

NES::Monitoring::MonitoringAgent::MonitoringAgent ( )

◆ MonitoringAgent() [2/3]

NES::Monitoring::MonitoringAgent::MonitoringAgent ( bool  enabled)
explicit

◆ MonitoringAgent() [3/3]

NES::Monitoring::MonitoringAgent::MonitoringAgent ( MonitoringPlanPtr  monitoringPlan,
MonitoringCatalogPtr  catalog,
bool  enabled 
)

References NES_DEBUG.

Member Function Documentation

◆ addMonitoringStreams()

bool NES::Monitoring::MonitoringAgent::addMonitoringStreams ( const Configurations::WorkerConfigurationPtr  workerConfig)

Adds the monitoring streams based on the monitoring plan to the worker config.

Parameters
workerConfig
Returns
true if success, else false

References NES::Monitoring::MetricUtils::createCollectorTypeFromMetricType(), magic_enum::enum_name(), NES_INFO, NES_WARNING, and NES::TestUtils::sourceType().

Here is the call graph for this function:

◆ create() [1/3]

MonitoringAgentPtr NES::Monitoring::MonitoringAgent::create ( )
static

◆ create() [2/3]

MonitoringAgentPtr NES::Monitoring::MonitoringAgent::create ( bool  enabled)
static

◆ create() [3/3]

MonitoringAgentPtr NES::Monitoring::MonitoringAgent::create ( MonitoringPlanPtr  monitoringPlan,
MonitoringCatalogPtr  catalog,
bool  enabled 
)
static

◆ getMetricsAsJson()

nlohmann::json NES::Monitoring::MonitoringAgent::getMetricsAsJson ( )

Returns all metrics defined by the plan as a unified JSON.

Returns
Metrics as JSON.

References NES::Monitoring::asJson(), magic_enum::enum_name(), NES_INFO, and type.

Here is the call graph for this function:

◆ getMetricsFromPlan()

const std::vector< MetricPtr > NES::Monitoring::MonitoringAgent::getMetricsFromPlan ( ) const

Collect the metrics and store them in to the given output. The collected metrics depend on the monitoring plan. If monitoring is disabled an empty vector will be returned.

Returns
the metrics of the monitoring plan

References NES_DEBUG, NES_WARNING, and type.

◆ getMonitoringPlan()

MonitoringPlanPtr NES::Monitoring::MonitoringAgent::getMonitoringPlan ( ) const

Getter for the MonitoringPlan.

Returns
Ptr to the MonitoringPlan

◆ getRegistrationMetrics()

RegistrationMetrics NES::Monitoring::MonitoringAgent::getRegistrationMetrics ( )

Return the metrics required for node registration.

Returns
the metrics

References NES::Monitoring::SystemResourcesReaderFactory::getSystemResourcesReader(), and NES_WARNING.

Here is the call graph for this function:

◆ isEnabled()

bool NES::Monitoring::MonitoringAgent::isEnabled ( ) const

Checks if monitoring is enabled.

Returns
If enabled then true, else false

◆ setMonitoringPlan()

void NES::Monitoring::MonitoringAgent::setMonitoringPlan ( MonitoringPlanPtr  monitoringPlan)

set the monitoring plan

Parameters
monitoringPlan

◆ setNodeId()

void NES::Monitoring::MonitoringAgent::setNodeId ( WorkerId  nodeId)

Set the node ID of the topology node.

Parameters
nodeIdid of the topology node

References nodeId.


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