16 enum CpuTimeIndex : std::size_t {
17 USER = 0, NICE, SYSTEM, IDLE, IOWAIT, IRQ, SOFTIRQ, STEAL, GUEST, GUEST_NICE, ARRAY_SIZE
26 SignalSerialNumber mSignalSerialNumber{};
45 std::array<uint64_t,CpuTimeIndex::ARRAY_SIZE>
mCpuTime{};
57 static constexpr std::string_view
ProcSelfStat =
"/proc/self/stat";
58 static constexpr std::string_view
ProcStat =
"/proc/stat";
59 static constexpr std::string_view
ProcCpuInfo =
"/proc/cpuinfo";
109 SecondTickPtr mSecondTick{};
113 static constexpr std::string_view
ProcStat =
"/proc/stat";
116 void initializeComposite()
override;
Signal< ProcessSignal > txProcess
The Signal object to transmit process usage.
Definition: SystemMonitor.h:71
static constexpr std::string_view ProcSelfStat
The process stats path.
Definition: SystemMonitor.h:57
color::RGBA mCPUAlert
CPU temperature alert color.
Definition: SystemMonitor.h:99
void cpuCount()
Count the number of CPUs in the system.
Definition: SystemMonitor.cpp:255
Red Green Blue Alpha representation of a color.
Definition: Color.h:64
static constexpr std::string_view ProcCpuInfo
The CPU info path.
Definition: SystemMonitor.h:59
int mProcTimeStart
The process time use at interval start.
Definition: SystemMonitor.h:52
std::array< uint64_t, CpuTimeIndex::ARRAY_SIZE > mCpuTime
CPU current times.
Definition: SystemMonitor.h:45
std::shared_ptr< Slot< int > > rxTrigger
The slot to receive interval triggers on.
Definition: SystemMonitor.h:65
std::shared_ptr< Label > mTemperature
The Label to display temperature.
Definition: SystemMonitor.h:101
std::array< float, 3 > SystemSignal
The type used for the system usage signal.
Definition: SystemMonitor.h:73
std::shared_ptr< Slot< int > > rxTrigger
The slot to receive interval triggers on.
Definition: SystemMonitor.h:118
float mUsage
The process usage as percent of a CPU.
Definition: SystemMonitor.h:54
int mCpuCount
The number of CPUs in the system.
Definition: SystemMonitor.h:48
float mCpuTimeUse
The current CPU time use.
Definition: SystemMonitor.h:49
std::array< float, 3 > ProcessSignal
The type used for process usage signal.
Definition: SystemMonitor.h:70
bool mHasTemperatureDevice
Signal serial number identifying the object.
Definition: SystemMonitor.h:28
std::array< float, 3 > TemperatureSignal
The type used for system temperature signal.
Definition: SystemMonitor.h:67
void readCPUTemperature()
Read the CPU temperature from the system.
Definition: SystemMonitor.cpp:155
void readProcessUsage()
Read processor usage and estimate this process' contribution.
Definition: SystemMonitor.cpp:180
float mTemperature
The cpu temperature.
Definition: SystemMonitor.h:55
float mCpuTotalTime
The total CPU time available.
Definition: SystemMonitor.h:50
Gather system data to transmit on Signal objects.
Definition: SystemMonitor.h:24
color::RGBA mCPUWarning
CPU temperature warning color.
Definition: SystemMonitor.h:98
ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Wid...
Definition: CelestialOverlay.cpp:13
std::shared_ptr< Label > mUsage
The Label to display usage.
Definition: SystemMonitor.h:102
static constexpr std::string_view ProcStat
The system stats apth.
Definition: SystemMonitor.h:58
std::array< uint64_t, CpuTimeIndex::ARRAY_SIZE > mPastCpuTime
CPU past times.
Definition: SystemMonitor.h:46
int mProcTimeUse
The current process time use.
Definition: SystemMonitor.h:51
Establish an intra-application signaling protocol.
A widget to display some system values to be monitored.
Definition: SystemMonitor.h:81
Signal< TemperatureSignal > txTemperature
The Signal object to transmit temperature.
Definition: SystemMonitor.h:68