Rose
Public Types | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
rose::SystemData Class Reference

Gather system data to transmit on Signal objects. More...

#include <SystemMonitor.h>

Collaboration diagram for rose::SystemData:
Collaboration graph
[legend]

Public Types

using TemperatureSignal = std::array< float, 3 >
 The type used for system temperature signal.
 
using ProcessSignal = std::array< float, 3 >
 The type used for process usage signal.
 
using SystemSignal = std::array< float, 3 >
 The type used for the system usage signal.
 

Public Attributes

std::shared_ptr< Slot< int > > rxTrigger
 The slot to receive interval triggers on.
 
Signal< TemperatureSignaltxTemperature {}
 The Signal object to transmit temperature.
 
Signal< ProcessSignaltxProcess {}
 The Signal object to transmit process usage.
 
Signal< SystemSignaltxSystem {}
 

Protected Member Functions

void readCPUTemperature ()
 Read the CPU temperature from the system.
 
void readProcessUsage ()
 Read processor usage and estimate this process' contribution.
 
void cpuCount ()
 Count the number of CPUs in the system.
 

Protected Attributes

SignalSerialNumber mSignalSerialNumber {}
 
bool mHasTemperatureDevice {true}
 Signal serial number identifying the object. More...
 
std::array< uint64_t, CpuTimeIndex::ARRAY_SIZE > mCpuTime {}
 CPU current times.
 
std::array< uint64_t, CpuTimeIndex::ARRAY_SIZE > mPastCpuTime {}
 CPU past times.
 
int mCpuCount {0}
 The number of CPUs in the system.
 
float mCpuTimeUse {}
 The current CPU time use.
 
float mCpuTotalTime {}
 The total CPU time available.
 
int mProcTimeUse {}
 The current process time use.
 
int mProcTimeStart {}
 The process time use at interval start.
 
float mUsage {0.f}
 The process usage as percent of a CPU.
 
float mTemperature {0.f}
 The cpu temperature.
 

Static Protected Attributes

static constexpr std::string_view ProcSelfStat = "/proc/self/stat"
 The process stats path.
 
static constexpr std::string_view ProcStat = "/proc/stat"
 The system stats apth.
 
static constexpr std::string_view ProcCpuInfo = "/proc/cpuinfo"
 The CPU info path.
 

Detailed Description

Gather system data to transmit on Signal objects.

Member Data Documentation

◆ mHasTemperatureDevice

bool rose::SystemData::mHasTemperatureDevice {true}
protected

Signal serial number identifying the object.

True if temperature data is found.


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