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

Pre-defined metrics used for NES internally. More...

#include <MetricUtils.hpp>

Static Public Member Functions

static bool validateFieldsInSchema (SchemaPtr metricSchema, SchemaPtr bufferSchema, uint64_t schemaIndex)
 
static nlohmann::json toJson (std::vector< MetricPtr > metrics)
 
static nlohmann::json toJson (std::unordered_map< MetricType, std::shared_ptr< Metric >> metrics)
 
static nlohmann::json toJson (StoredNodeMetricsPtr metrics)
 
static MetricCollectorPtr createCollectorFromCollectorType (MetricCollectorType type)
 
static Configurations::SchemaTypePtr getSchemaFromCollectorType (MetricCollectorType type)
 
static MetricPtr createMetricFromCollectorType (MetricCollectorType type)
 Creates a metric from the according collector. More...
 
static MetricCollectorType createCollectorTypeFromMetricType (MetricType type)
 Creates a metric from the according collector. More...
 

Detailed Description

Pre-defined metrics used for NES internally.

Member Function Documentation

◆ createCollectorFromCollectorType()

MetricCollectorPtr NES::Monitoring::MetricUtils::createCollectorFromCollectorType ( MetricCollectorType  type)
static

Creates a metric collector from the corresponding type.

Parameters
type
Returns
the metric collector shared ptr.

References NES::Monitoring::CPU_COLLECTOR, NES::Monitoring::DISK_COLLECTOR, magic_enum::enum_name(), NES::Monitoring::MEMORY_COLLECTOR, NES_FATAL_ERROR, NES::Monitoring::NETWORK_COLLECTOR, and type.

Here is the call graph for this function:

◆ createCollectorTypeFromMetricType()

MetricCollectorType NES::Monitoring::MetricUtils::createCollectorTypeFromMetricType ( MetricType  type)
static

Creates a metric from the according collector.

Parameters
type
Returns
the collector as type

References NES::Monitoring::CPU_COLLECTOR, NES::Monitoring::CpuMetric, NES::Monitoring::DISK_COLLECTOR, NES::Monitoring::DiskMetric, magic_enum::enum_name(), NES::Monitoring::INVALID, NES::Monitoring::MEMORY_COLLECTOR, NES::Monitoring::MemoryMetric, NES_ERROR, NES::Monitoring::NETWORK_COLLECTOR, NES::Monitoring::NetworkMetric, type, NES::Monitoring::WrappedCpuMetrics, and NES::Monitoring::WrappedNetworkMetrics.

Referenced by NES::Monitoring::MonitoringAgent::addMonitoringStreams(), and NES::Monitoring::MonitoringManager::startOrRedeployMonitoringQuery().

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

◆ createMetricFromCollectorType()

MetricPtr NES::Monitoring::MetricUtils::createMetricFromCollectorType ( MetricCollectorType  type)
static

Creates a metric from the according collector.

Parameters
type
Returns
the metric as shared ptr.

References NES::Monitoring::CPU_COLLECTOR, NES::Monitoring::DISK_COLLECTOR, NES::Monitoring::DiskMetric, magic_enum::enum_name(), NES::Monitoring::MEMORY_COLLECTOR, NES::Monitoring::MemoryMetric, NES_FATAL_ERROR, NES::Monitoring::NETWORK_COLLECTOR, type, NES::Monitoring::WrappedCpuMetrics, and NES::Monitoring::WrappedNetworkMetrics.

Referenced by NES::Monitoring::MonitoringManager::registerLogicalMonitoringStreams(), NES::MonitoringQueriesTest::runMetricsQueryTest(), and NES::MonitoringSink::writeData().

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

◆ getSchemaFromCollectorType()

Configurations::SchemaTypePtr NES::Monitoring::MetricUtils::getSchemaFromCollectorType ( MetricCollectorType  type)
static

Retrieves the schema from the according type.

Parameters
type
Returns
the schema ptr

References NES::Monitoring::CPU_COLLECTOR, NES::Monitoring::DISK_COLLECTOR, magic_enum::enum_name(), NES::Monitoring::CpuMetrics::getSchemaType(), NES::Monitoring::DiskMetrics::getSchemaType(), NES::Monitoring::NetworkMetrics::getSchemaType(), NES::Monitoring::MemoryMetrics::getSchemaType(), NES::Monitoring::MEMORY_COLLECTOR, NES_FATAL_ERROR, NES::Monitoring::NETWORK_COLLECTOR, and type.

Referenced by NES::Monitoring::MonitoringManager::registerLogicalMonitoringStreams().

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

◆ toJson() [1/3]

nlohmann::json NES::Monitoring::MetricUtils::toJson ( std::unordered_map< MetricType, std::shared_ptr< Metric >>  metrics)
static

Converts a map of metric types to metrics into json.

Parameters
metrics
Returns
json of metrics

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

Here is the call graph for this function:

◆ toJson() [2/3]

nlohmann::json NES::Monitoring::MetricUtils::toJson ( std::vector< MetricPtr metrics)
static

Converts a vector of metrics into json.

Parameters
metrics
Returns
json of metrics

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

Referenced by NES::MetricValidator::isValid(), NES::MonitoringService::requestMonitoringDataFromAllNodesAsJson(), and NES::MonitoringService::requestNewestMonitoringDataFromMetricStoreAsJson().

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

◆ toJson() [3/3]

nlohmann::json NES::Monitoring::MetricUtils::toJson ( StoredNodeMetricsPtr  metrics)
static

Converts a map of metric types to metrics into json.

Parameters
metrics
Returns
json of metrics

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

Here is the call graph for this function:

◆ validateFieldsInSchema()

bool NES::Monitoring::MetricUtils::validateFieldsInSchema ( SchemaPtr  metricSchema,
SchemaPtr  bufferSchema,
uint64_t  schemaIndex 
)
static
Parameters
metricSchema
bufferSchema
prefix
Returns

References NES::Util::endsWith().

Here is the call graph for this function:

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