NebulaStream
0.6.213
NebulaStream is a data and application management framework for the internet of things
|
#include <RegistrationMetrics.hpp>
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 |
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
NES::Monitoring::RegistrationMetrics::RegistrationMetrics | ( | ) |
References NES_DEBUG.
NES::Monitoring::RegistrationMetrics::RegistrationMetrics | ( | bool | isMoving, |
bool | hasBattery | ||
) |
References hasBattery, isMoving, and NES_DEBUG.
|
explicit |
Ctor to create a RegistrationMetrics object out of a protobuf message.
metrics | in protobuf |
References NES_DEBUG.
|
static |
Returns the schema of the class with a given prefix.
prefix |
References NES::Schema::createFromSchemaType(), and getSchemaType().
Referenced by NES::MetricValidator::isValidRegistrationMetrics(), readFromBuffer(), and writeToBuffer().
|
static |
Returns the schema of the class with a given prefix.
prefix |
Referenced by getSchema().
bool NES::Monitoring::RegistrationMetrics::operator!= | ( | const RegistrationMetrics & | rhs | ) | const |
bool NES::Monitoring::RegistrationMetrics::operator== | ( | const RegistrationMetrics & | rhs | ) | const |
References cpuCoreNum, cpuPeriodUS, cpuQuotaUS, hasBattery, isMoving, nodeId, totalCPUJiffies, and totalMemoryBytes.
void NES::Monitoring::RegistrationMetrics::readFromBuffer | ( | Runtime::TupleBuffer & | buf, |
uint64_t | tupleIndex | ||
) |
Parses a metrics objects from a TupleBuffer..
buf | the tuple buffer |
the | tuple 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().
SerializableRegistrationMetricsPtr NES::Monitoring::RegistrationMetrics::serialize | ( | ) | const |
Converts the object into a grpc protobuf object that can be serialized.
References cpuCoreNum, cpuPeriodUS, cpuQuotaUS, hasBattery, isMoving, totalCPUJiffies, and totalMemoryBytes.
nlohmann::json NES::Monitoring::RegistrationMetrics::toJson | ( | ) | const |
Returns the metrics as json.
References cpuCoreNum, cpuPeriodUS, cpuQuotaUS, hasBattery, isMoving, nodeId, totalCPUJiffies, and totalMemoryBytes.
Referenced by NES::Monitoring::asJson().
void NES::Monitoring::RegistrationMetrics::writeToBuffer | ( | Runtime::TupleBuffer & | buf, |
uint64_t | tupleIndex | ||
) | const |
Writes a metrics objects to the given TupleBuffer and index.
buf | the tuple buffer |
tupleIndex | the 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().
uint64_t NES::Monitoring::RegistrationMetrics::cpuCoreNum |
int64_t NES::Monitoring::RegistrationMetrics::cpuPeriodUS |
int64_t NES::Monitoring::RegistrationMetrics::cpuQuotaUS |
bool NES::Monitoring::RegistrationMetrics::hasBattery |
Referenced by NES::MetricValidator::isValid(), operator==(), readFromBuffer(), RegistrationMetrics(), serialize(), toJson(), and writeToBuffer().
bool NES::Monitoring::RegistrationMetrics::isMoving |
Referenced by NES::MetricValidator::isValid(), operator==(), readFromBuffer(), RegistrationMetrics(), serialize(), toJson(), and writeToBuffer().
WorkerId NES::Monitoring::RegistrationMetrics::nodeId |
Referenced by NES::MetricValidator::checkNodeIds(), operator==(), readFromBuffer(), toJson(), and writeToBuffer().
uint64_t NES::Monitoring::RegistrationMetrics::totalCPUJiffies |
uint64_t NES::Monitoring::RegistrationMetrics::totalMemoryBytes |