cpuLoad Class Reference

#include <RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_cpuload.hpp>

Public Member Functions

 cpuLoad ()=delete
 
 cpuLoad (std::string procFileName="/proc/stat")
 constructor More...
 
std::string getCPUName (const std::string &cpuNameFile="/proc/cpuinfo")
 get CPU Description More...
 
std::tuple< uint64_t, uint64_t, uint64_t, uint64_t > getCpuTimes ()
 get Cpu user / nice / system /idle time. More...
 
double getCurrentCpuUsage ()
 get current cpu load in 0-100% More...
 
std::vector< double > getCurrentMultiCoreUsage ()
 get cpu Usage of all cores in percent More...
 
void initCpuUsage ()
 initialize the parsing algo More...
 

Detailed Description

Author
: Daniel Fuchs @contact: fuxey.nosp@m.solu.nosp@m.tions.nosp@m.@gma.nosp@m.il.co.nosp@m.m

distributed under the MIT License (MIT). Copyright (c) Daniel Fuchs

Definition at line 18 of file linux_cpuload.hpp.

Constructor & Destructor Documentation

◆ cpuLoad() [1/2]

cpuLoad ( )
delete

◆ cpuLoad() [2/2]

cpuLoad ( std::string  procFileName = "/proc/stat")
inlineexplicit

constructor

Parameters
procFileName

Definition at line 26 of file linux_cpuload.hpp.

Member Function Documentation

◆ getCPUName()

std::string getCPUName ( const std::string &  cpuNameFile = "/proc/cpuinfo")

get CPU Description

Parameters
cpuNameFile- typical /proc/cpuinfo
Returns
cpu Type string

Definition at line 131 of file linux_cpuload.cpp.

◆ getCpuTimes()

std::tuple<uint64_t , uint64_t, uint64_t, uint64_t> getCpuTimes ( )
inline

get Cpu user / nice / system /idle time.

used for cpu usage per process

Returns
tuple<user,nice,system,idle>

Definition at line 43 of file linux_cpuload.hpp.

◆ getCurrentCpuUsage()

double getCurrentCpuUsage ( )

get current cpu load in 0-100%

Returns
current cpu load

Definition at line 47 of file linux_cpuload.cpp.

◆ getCurrentMultiCoreUsage()

std::vector< double > getCurrentMultiCoreUsage ( )

get cpu Usage of all cores in percent

Returns
vector of cpu load per core 0-100%

Definition at line 53 of file linux_cpuload.cpp.

◆ initCpuUsage()

void initCpuUsage ( )

initialize the parsing algo

Definition at line 29 of file linux_cpuload.cpp.


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