NebulaStream
0.6.213
NebulaStream is a data and application management framework for the internet of things
|
This class represents the metrics read from /proc/stat: usr – % CPU usage at the user level nice – % CPU usage for user processes labeled “nice” sys – % CPU usage at the system (Linux kernel) level iowait – % CPU usage idling waiting on a disk read/write irq – % CPU usage handling hardware interrupts soft – % CPU usage handing software interrupts steal – % CPU usage being forced to wait for a hypervisor handling other virtual processors guest – % CPU usage spent running a virtual processor idle – % CPU usage on idle time (no processes, and not waiting on a disk read/write) More...
#include <CpuMetrics.hpp>
Public Member Functions | |
CpuMetrics () | |
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... | |
bool | operator== (const CpuMetrics &rhs) const |
bool | operator!= (const CpuMetrics &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 | timestamp |
uint64_t | coreNum |
uint64_t | user |
uint64_t | nice |
uint64_t | system |
uint64_t | idle |
uint64_t | iowait |
uint64_t | irq |
uint64_t | softirq |
uint64_t | steal |
uint64_t | guest |
uint64_t | guestnice |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CpuMetrics &values) |
Source operator to convert the object to string. More... | |
This class represents the metrics read from /proc/stat: usr – % CPU usage at the user level nice – % CPU usage for user processes labeled “nice” sys – % CPU usage at the system (Linux kernel) level iowait – % CPU usage idling waiting on a disk read/write irq – % CPU usage handling hardware interrupts soft – % CPU usage handing software interrupts steal – % CPU usage being forced to wait for a hypervisor handling other virtual processors guest – % CPU usage spent running a virtual processor idle – % CPU usage on idle time (no processes, and not waiting on a disk read/write)
NES::Monitoring::CpuMetrics::CpuMetrics | ( | ) |
|
static |
Returns the schema of the class with a given prefix.
prefix |
References NES::Schema::createFromSchemaType(), and getSchemaType().
Referenced by readFromBuffer(), NES::Monitoring::CpuMetricsWrapper::readFromBuffer(), NES::TEST_F(), writeToBuffer(), and NES::Monitoring::CpuMetricsWrapper::writeToBuffer().
|
static |
Returns the schema of the class with a given prefix.
prefix |
Referenced by getSchema(), and NES::Monitoring::MetricUtils::getSchemaFromCollectorType().
bool NES::Monitoring::CpuMetrics::operator!= | ( | const CpuMetrics & | rhs | ) | const |
bool NES::Monitoring::CpuMetrics::operator== | ( | const CpuMetrics & | rhs | ) | const |
void NES::Monitoring::CpuMetrics::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 coreNum, NES::Runtime::MemoryLayouts::RowLayout::create(), NES::Runtime::TupleBuffer::getBufferSize(), getSchema(), guest, guestnice, idle, iowait, irq, nice, nodeId, softirq, steal, system, timestamp, and user.
Referenced by NES::Monitoring::readFromBuffer().
nlohmann::json NES::Monitoring::CpuMetrics::toJson | ( | ) | const |
void NES::Monitoring::CpuMetrics::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 coreNum, NES::Runtime::MemoryLayouts::RowLayout::create(), NES::Runtime::TupleBuffer::getBufferSize(), NES::Runtime::TupleBuffer::getNumberOfTuples(), getSchema(), guest, guestnice, idle, iowait, irq, NES_ASSERT, nice, nodeId, NES::Runtime::TupleBuffer::setNumberOfTuples(), softirq, steal, system, timestamp, and user.
Referenced by NES::Monitoring::writeToBuffer(), and NES::Monitoring::CpuMetricsWrapper::writeToBuffer().
|
friend |
Source operator to convert the object to string.
os | |
values |
uint64_t NES::Monitoring::CpuMetrics::coreNum |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::guest |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::guestnice |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::idle |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::iowait |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::irq |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::nice |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().
WorkerId NES::Monitoring::CpuMetrics::nodeId |
Referenced by operator==(), readFromBuffer(), NES::TEST_F(), toJson(), writeToBuffer(), and NES::Monitoring::CpuMetricsWrapper::writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::softirq |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::steal |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::system |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::timestamp |
Referenced by operator==(), readFromBuffer(), toJson(), writeToBuffer(), and NES::Monitoring::CpuMetricsWrapper::writeToBuffer().
uint64_t NES::Monitoring::CpuMetrics::user |
Referenced by operator==(), readFromBuffer(), toJson(), and writeToBuffer().