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

#include <RegistrationMetrics.hpp>

Collaboration diagram for NES::Monitoring::RegistrationMetrics:
[legend]

Public Member Functions

 RegistrationMetrics ()
 
 RegistrationMetrics (bool isMoving, bool hasBattery)
 
 RegistrationMetrics (const SerializableRegistrationMetrics &metrics)
 
void writeToBuffer (Runtime::TupleBuffer &buf, uint64_t tupleIndex) const
 Writes a metrics objects to the given TupleBuffer and index. More...
 
void readFromBuffer (Runtime::TupleBuffer &buf, uint64_t tupleIndex)
 Parses a metrics objects from a TupleBuffer.. More...
 
nlohmann::json toJson () const
 Returns the metrics as json. More...
 
SerializableRegistrationMetricsPtr serialize () const
 Converts the object into a grpc protobuf object that can be serialized. More...
 
bool operator== (const RegistrationMetrics &rhs) const
 
bool operator!= (const RegistrationMetrics &rhs) const
 

Static Public Member Functions

static Configurations::SchemaTypePtr getSchemaType (const std::string &prefix="")
 Returns the schema of the class with a given prefix. More...
 
static SchemaPtr getSchema (const std::string &prefix)
 Returns the schema of the class with a given prefix. More...
 

Public Attributes

WorkerId nodeId
 
uint64_t totalMemoryBytes
 
uint64_t cpuCoreNum
 
uint64_t totalCPUJiffies
 
int64_t cpuPeriodUS
 
int64_t cpuQuotaUS
 
bool isMoving
 
bool hasBattery
 

Detailed Description

Class representing the static metrics that are transmitted during node registration in NES. totalMemoryBytes; the total available memory on the node in bytes cpuCoreNum; number of cores totalCPUJiffies; user+idle+system (Note: This value can change everytime it is read via AbstractSystemResourcesReader) Using 1.5 CPUs is equivalent to –cpu-period="100000" and –cpu-quota="150000" cpuPeriodUS; the CPU CFS scheduler period in microseconds cpuQuotaUS; CPU CFS quota in microseconds isMoving; flag to indicate if the node is changing geo-location hasBattery; flag to indicate if the node is running on a battery

Constructor & Destructor Documentation

◆ RegistrationMetrics() [1/3]

NES::Monitoring::RegistrationMetrics::RegistrationMetrics ( )

References NES_DEBUG.

◆ RegistrationMetrics() [2/3]

NES::Monitoring::RegistrationMetrics::RegistrationMetrics ( bool  isMoving,
bool  hasBattery 
)

References hasBattery, isMoving, and NES_DEBUG.

◆ RegistrationMetrics() [3/3]

NES::Monitoring::RegistrationMetrics::RegistrationMetrics ( const SerializableRegistrationMetrics &  metrics)
explicit

Ctor to create a RegistrationMetrics object out of a protobuf message.

Parameters
metricsin protobuf

References NES_DEBUG.

Member Function Documentation

◆ getSchema()

SchemaPtr NES::Monitoring::RegistrationMetrics::getSchema ( const std::string &  prefix)
static

Returns the schema of the class with a given prefix.

Parameters
prefix
Returns
the schema

References NES::Schema::createFromSchemaType(), and getSchemaType().

Referenced by NES::MetricValidator::isValidRegistrationMetrics(), readFromBuffer(), and writeToBuffer().

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

◆ getSchemaType()

Configurations::SchemaTypePtr NES::Monitoring::RegistrationMetrics::getSchemaType ( const std::string &  prefix = "")
static

Returns the schema of the class with a given prefix.

Parameters
prefix
Returns
the schema

Referenced by getSchema().

Here is the caller graph for this function:

◆ operator!=()

bool NES::Monitoring::RegistrationMetrics::operator!= ( const RegistrationMetrics rhs) const

◆ operator==()

bool NES::Monitoring::RegistrationMetrics::operator== ( const RegistrationMetrics rhs) const

◆ readFromBuffer()

void NES::Monitoring::RegistrationMetrics::readFromBuffer ( Runtime::TupleBuffer buf,
uint64_t  tupleIndex 
)

Parses a metrics objects from a TupleBuffer..

Parameters
bufthe tuple buffer
thetuple index indicating the location of the tuple

References cpuCoreNum, cpuPeriodUS, cpuQuotaUS, NES::Runtime::MemoryLayouts::RowLayout::create(), NES::Runtime::TupleBuffer::getBufferSize(), getSchema(), hasBattery, isMoving, nodeId, totalCPUJiffies, and totalMemoryBytes.

Referenced by NES::Monitoring::readFromBuffer().

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

◆ serialize()

SerializableRegistrationMetricsPtr NES::Monitoring::RegistrationMetrics::serialize ( ) const

Converts the object into a grpc protobuf object that can be serialized.

Returns
the serialized object as protobuf

References cpuCoreNum, cpuPeriodUS, cpuQuotaUS, hasBattery, isMoving, totalCPUJiffies, and totalMemoryBytes.

◆ toJson()

nlohmann::json NES::Monitoring::RegistrationMetrics::toJson ( ) const

Returns the metrics as json.

Returns
Json containing the metrics

References cpuCoreNum, cpuPeriodUS, cpuQuotaUS, hasBattery, isMoving, nodeId, totalCPUJiffies, and totalMemoryBytes.

Referenced by NES::Monitoring::asJson().

Here is the caller graph for this function:

◆ writeToBuffer()

void NES::Monitoring::RegistrationMetrics::writeToBuffer ( Runtime::TupleBuffer buf,
uint64_t  tupleIndex 
) const

Writes a metrics objects to the given TupleBuffer and index.

Parameters
bufthe tuple buffer
tupleIndexthe index indication its location in the buffer

References cpuCoreNum, cpuPeriodUS, cpuQuotaUS, NES::Runtime::MemoryLayouts::RowLayout::create(), NES::Runtime::TupleBuffer::getBufferSize(), NES::Runtime::TupleBuffer::getNumberOfTuples(), getSchema(), hasBattery, isMoving, NES_ASSERT, nodeId, NES::Runtime::TupleBuffer::setNumberOfTuples(), totalCPUJiffies, and totalMemoryBytes.

Referenced by NES::Monitoring::writeToBuffer().

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

Member Data Documentation

◆ cpuCoreNum

◆ cpuPeriodUS

◆ cpuQuotaUS

◆ hasBattery

bool NES::Monitoring::RegistrationMetrics::hasBattery

◆ isMoving

bool NES::Monitoring::RegistrationMetrics::isMoving

◆ nodeId

WorkerId NES::Monitoring::RegistrationMetrics::nodeId

◆ totalCPUJiffies

◆ totalMemoryBytes


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