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

The MonitoringManager is responsible for managing all global metrics of all nodes in the topology. More...

#include <MonitoringManager.hpp>

Public Member Functions

 MonitoringManager (TopologyPtr topology, RequestHandlerServicePtr requestHandlerService, Catalogs::Query::QueryCatalogPtr queryCatalog, MetricStorePtr metricStore, bool enableMonitoring)
 
 MonitoringManager (TopologyPtr topology, RequestHandlerServicePtr requestHandlerService, Catalogs::Query::QueryCatalogPtr queryCatalog, bool enableMonitoring)
 Ctor to create a MonitoringManger for a given topology. For communication the manager will use the corresponding RPC client. More...
 
 MonitoringManager (TopologyPtr topology, RequestHandlerServicePtr requestHandlerService, Catalogs::Query::QueryCatalogPtr queryCatalog)
 
 MonitoringManager (const MonitoringManager &)=default
 
 MonitoringManager (MonitoringManager &&)=default
 
MonitoringManageroperator= (const MonitoringManager &)=default
 
MonitoringManageroperator= (MonitoringManager &&)=default
 
 ~MonitoringManager ()
 
bool registerRemoteMonitoringPlans (const std::vector< WorkerId > &nodeIds, MonitoringPlanPtr monitoringPlan)
 Register a monitoring plan for given nodes. More...
 
nlohmann::json requestRemoteMonitoringData (WorkerId nodeId)
 Get the monitoring data for a given node. Note: Multiple nodes are not possible, as every node can have a different monitoring plan and TupleBuffer is not supporting different nested schemas. More...
 
StoredNodeMetricsPtr getMonitoringDataFromMetricStore (WorkerId nodeId)
 Requests monitoring data from metric store. More...
 
void addMonitoringData (WorkerId nodeId, MetricPtr metrics)
 Receive arbitrary monitoring data from a given node. More...
 
void removeMonitoringNode (WorkerId nodeId)
 Remove node from monitoring store. More...
 
MonitoringPlanPtr getMonitoringPlan (WorkerId nodeId)
 Get the monitoring plan for a given node ID. If the node exists in the topology but has not a registered plan, MonitoringPlan::Default will be returned. If the node does not exist an NES exception is thrown. More...
 
bool registerLogicalMonitoringStreams (const NES::Configurations::CoordinatorConfigurationPtr config)
 Registers the logical monitoring streams at the coordinator. More...
 
std::unordered_map< std::string, QueryIdstartOrRedeployMonitoringQueries (bool sync)
 Starts or redeploys monitoring queries at the coordinator. More...
 
QueryId startOrRedeployMonitoringQuery (std::string monitoringStream, bool sync)
 Starts or redeploys monitoring queries at the coordinator. More...
 
bool isMonitoringStream (std::string streamName) const
 Checks if the logical stream is a monitoring stream. More...
 
bool stopRunningMonitoringQuery (std::string streamName, bool sync)
 Stops a given running monitoring query;. More...
 
bool stopRunningMonitoringQueries (bool sync)
 Stops all running monitoring queries;. More...
 
MetricStorePtr getMetricStore ()
 
const std::unordered_map< std::string, QueryId > & getDeployedMonitoringQueries () const
 Get the deployed monitoring queries. More...
 

Detailed Description

The MonitoringManager is responsible for managing all global metrics of all nodes in the topology.

Constructor & Destructor Documentation

◆ MonitoringManager() [1/5]

NES::Monitoring::MonitoringManager::MonitoringManager ( TopologyPtr  topology,
RequestHandlerServicePtr  requestHandlerService,
Catalogs::Query::QueryCatalogPtr  queryCatalog,
MetricStorePtr  metricStore,
bool  enableMonitoring 
)

Ctor to create a MonitoringManger for a given topology. For communication the manager will use the corresponding RPC client.

Parameters
topologythe topology
requestHandlerServicerequest handler
queryCatalogthe query catalog
metricStorethe metric store
enableMonitoringflag to indicate if monitoring is enabled or not

References magic_enum::enum_name(), and NES_DEBUG.

Here is the call graph for this function:

◆ MonitoringManager() [2/5]

NES::Monitoring::MonitoringManager::MonitoringManager ( TopologyPtr  topology,
RequestHandlerServicePtr  requestHandlerService,
Catalogs::Query::QueryCatalogPtr  queryCatalog,
bool  enableMonitoring 
)

Ctor to create a MonitoringManger for a given topology. For communication the manager will use the corresponding RPC client.

Parameters
topologythe topology
requestHandlerServicerequest handler
queryCatalogthe query catalog
enableMonitoringflag to indicate if monitoring is enabled or not

◆ MonitoringManager() [3/5]

NES::Monitoring::MonitoringManager::MonitoringManager ( TopologyPtr  topology,
RequestHandlerServicePtr  requestHandlerService,
Catalogs::Query::QueryCatalogPtr  queryCatalog 
)

Ctor to create a MonitoringManger for a given topology. For communication the manager will use the corresponding RPC client.

Parameters
topologythe topology
requestHandlerServicethe query service
queryCatalogthe query catalog

◆ MonitoringManager() [4/5]

NES::Monitoring::MonitoringManager::MonitoringManager ( const MonitoringManager )
default

◆ MonitoringManager() [5/5]

NES::Monitoring::MonitoringManager::MonitoringManager ( MonitoringManager &&  )
default

◆ ~MonitoringManager()

NES::Monitoring::MonitoringManager::~MonitoringManager ( )

References NES_DEBUG.

Member Function Documentation

◆ addMonitoringData()

void NES::Monitoring::MonitoringManager::addMonitoringData ( WorkerId  nodeId,
MetricPtr  metrics 
)

Receive arbitrary monitoring data from a given node.

Parameters
nodeId
GroupedMetricValuesPtrthe grouped metric values

References magic_enum::enum_name(), NES_TRACE, and nodeId.

Here is the call graph for this function:

◆ getDeployedMonitoringQueries()

const std::unordered_map< std::string, QueryId > & NES::Monitoring::MonitoringManager::getDeployedMonitoringQueries ( ) const

Get the deployed monitoring queries.

Returns
A map logicalStreamName -> QueryId

◆ getMetricStore()

MetricStorePtr NES::Monitoring::MonitoringManager::getMetricStore ( )

Getter for the metric store

Returns
the metric store

◆ getMonitoringDataFromMetricStore()

StoredNodeMetricsPtr NES::Monitoring::MonitoringManager::getMonitoringDataFromMetricStore ( WorkerId  nodeId)

Requests monitoring data from metric store.

Parameters
nodeId
Returns
the grouped metric values

◆ getMonitoringPlan()

MonitoringPlanPtr NES::Monitoring::MonitoringManager::getMonitoringPlan ( WorkerId  nodeId)

Get the monitoring plan for a given node ID. If the node exists in the topology but has not a registered plan, MonitoringPlan::Default will be returned. If the node does not exist an NES exception is thrown.

Parameters
nodeId
Returns
The monitoring plan

References NES::Monitoring::MonitoringPlan::defaultPlan(), NES_DEBUG, NES_THROW_RUNTIME_ERROR, and nodeId.

Referenced by requestRemoteMonitoringData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isMonitoringStream()

bool NES::Monitoring::MonitoringManager::isMonitoringStream ( std::string  streamName) const

Checks if the logical stream is a monitoring stream.

Parameters
streamName
Returns
true if monitoring stream, else false

◆ operator=() [1/2]

MonitoringManager& NES::Monitoring::MonitoringManager::operator= ( const MonitoringManager )
default

◆ operator=() [2/2]

MonitoringManager& NES::Monitoring::MonitoringManager::operator= ( MonitoringManager &&  )
default

◆ registerLogicalMonitoringStreams()

bool NES::Monitoring::MonitoringManager::registerLogicalMonitoringStreams ( const NES::Configurations::CoordinatorConfigurationPtr  config)

Registers the logical monitoring streams at the coordinator.

Returns
true if monitoring is disabled or if the streams have been registered successfully, else false

References NES::Monitoring::MetricUtils::createMetricFromCollectorType(), magic_enum::enum_name(), NES::Monitoring::MetricUtils::getSchemaFromCollectorType(), NES::TestUtils::logicalSourceName(), NES_INFO, and NES_WARNING.

Here is the call graph for this function:

◆ registerRemoteMonitoringPlans()

bool NES::Monitoring::MonitoringManager::registerRemoteMonitoringPlans ( const std::vector< WorkerId > &  nodeIds,
MonitoringPlanPtr  monitoringPlan 
)

Register a monitoring plan for given nodes.

Parameters
nodeId
monitoringPlan
Returns
True, if successful, else false

References NES_DEBUG, NES_ERROR, and nodeId.

◆ removeMonitoringNode()

void NES::Monitoring::MonitoringManager::removeMonitoringNode ( WorkerId  nodeId)

Remove node from monitoring store.

Parameters
nodeId

References NES_DEBUG, and nodeId.

◆ requestRemoteMonitoringData()

nlohmann::json NES::Monitoring::MonitoringManager::requestRemoteMonitoringData ( WorkerId  nodeId)

Get the monitoring data for a given node. Note: Multiple nodes are not possible, as every node can have a different monitoring plan and TupleBuffer is not supporting different nested schemas.

Parameters
nodeId
tupleBuffer
Returns
the grouped metric values

References getMonitoringPlan(), NES_DEBUG, NES_ERROR, NES_THROW_RUNTIME_ERROR, and nodeId.

Here is the call graph for this function:

◆ startOrRedeployMonitoringQueries()

std::unordered_map< std::string, QueryId > NES::Monitoring::MonitoringManager::startOrRedeployMonitoringQueries ( bool  sync)

Starts or redeploys monitoring queries at the coordinator.

Returns
true if successful, else false

References NES_ERROR, startOrRedeployMonitoringQuery(), and stopRunningMonitoringQuery().

Here is the call graph for this function:

◆ startOrRedeployMonitoringQuery()

QueryId NES::Monitoring::MonitoringManager::startOrRedeployMonitoringQuery ( std::string  monitoringStream,
bool  sync 
)

Starts or redeploys monitoring queries at the coordinator.

Parameters
thelogical stream name of the monitoring stream
booltrue if it should block, else false
Returns
the QueryID the of the monitoring stream

References NES::Optimizer::BottomUp, NES::Monitoring::MetricUtils::createCollectorTypeFromMetricType(), magic_enum::enum_name(), NES_ERROR, NES_INFO, and stopRunningMonitoringQuery().

Referenced by startOrRedeployMonitoringQueries().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopRunningMonitoringQueries()

bool NES::Monitoring::MonitoringManager::stopRunningMonitoringQueries ( bool  sync)

Stops all running monitoring queries;.

Parameters
syncif to true then block
Returns
true if success

References NES_ERROR, and stopRunningMonitoringQuery().

Here is the call graph for this function:

◆ stopRunningMonitoringQuery()

bool NES::Monitoring::MonitoringManager::stopRunningMonitoringQuery ( std::string  streamName,
bool  sync 
)

Stops a given running monitoring query;.

Parameters
thename of the monitoring stream
syncif it should block or not
Returns
true if success

References NES_ERROR, and NES_INFO.

Referenced by startOrRedeployMonitoringQueries(), startOrRedeployMonitoringQuery(), and stopRunningMonitoringQueries().

Here is the caller graph for this function:

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