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

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>

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

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...
 

Detailed Description

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)

Constructor & Destructor Documentation

◆ CpuMetrics()

NES::Monitoring::CpuMetrics::CpuMetrics ( )

Member Function Documentation

◆ getSchema()

SchemaPtr NES::Monitoring::CpuMetrics::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 readFromBuffer(), NES::Monitoring::CpuMetricsWrapper::readFromBuffer(), NES::TEST_F(), writeToBuffer(), and NES::Monitoring::CpuMetricsWrapper::writeToBuffer().

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

◆ getSchemaType()

Configurations::SchemaTypePtr NES::Monitoring::CpuMetrics::getSchemaType ( const std::string &  prefix)
static

Returns the schema of the class with a given prefix.

Parameters
prefix
Returns
the schema

Referenced by getSchema(), and NES::Monitoring::MetricUtils::getSchemaFromCollectorType().

Here is the caller graph for this function:

◆ operator!=()

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

◆ operator==()

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

◆ readFromBuffer()

void NES::Monitoring::CpuMetrics::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 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().

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

◆ toJson()

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

Returns the metrics as json.

Returns
Json containing the metrics

References coreNum, guest, guestnice, idle, iowait, irq, nice, nodeId, softirq, steal, system, timestamp, and user.

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

Here is the caller graph for this function:

◆ writeToBuffer()

void NES::Monitoring::CpuMetrics::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 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().

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

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CpuMetrics values 
)
friend

Source operator to convert the object to string.

Parameters
os
values
Returns
the source

Member Data Documentation

◆ coreNum

uint64_t NES::Monitoring::CpuMetrics::coreNum

◆ guest

uint64_t NES::Monitoring::CpuMetrics::guest

◆ guestnice

uint64_t NES::Monitoring::CpuMetrics::guestnice

◆ idle

uint64_t NES::Monitoring::CpuMetrics::idle

◆ iowait

uint64_t NES::Monitoring::CpuMetrics::iowait

◆ irq

uint64_t NES::Monitoring::CpuMetrics::irq

◆ nice

uint64_t NES::Monitoring::CpuMetrics::nice

◆ nodeId

◆ softirq

uint64_t NES::Monitoring::CpuMetrics::softirq

◆ steal

uint64_t NES::Monitoring::CpuMetrics::steal

◆ system

uint64_t NES::Monitoring::CpuMetrics::system

◆ timestamp

uint64_t NES::Monitoring::CpuMetrics::timestamp

◆ user

uint64_t NES::Monitoring::CpuMetrics::user

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