obmon
0.0.0
|
System Obmon sensor class. More...
#include <ObSensorSystem.h>
Public Types | |
enum | SensorType { VALUE, SPEED } |
Enums for sensor type. | |
Public Member Functions | |
ObSensorSystem (std::string name={"sys"}) | |
virtual | ~ObSensorSystem () |
void | init () override |
void | process () override |
Process function. More... | |
void | speed (ObSensor *s1, ObSensor *s2, int timeout=1000) override |
Calculate time change (speed) More... | |
std::string | json (const std::string name={"static"}) const override |
glibtop_cpu | cpu () const |
returns glibtop_cpu | |
glibtop_mem | mem () const |
returns glibtop_mem | |
glibtop_netlist | netlist () const |
returns glibtop_netlist | |
std::vector< glibtop_netload * > | netloads () const |
returns netloads | |
virtual void | update (int timeout) final |
std::string | name () const |
Returns name of sensor. | |
void | type (SensorType t) |
Sets sensor type. | |
SensorType | type () const |
Returns sensor type. | |
std::vector< ObSensor * > & | sensors () |
Return list of sensors. | |
Protected Attributes | |
std::shared_ptr< spdlog::logger > | _logger |
Pointer to spd logger. | |
std::string | _name |
Sensor name. | |
SensorType | _type |
Sensor type. | |
ObSensor * | _first {} |
Pointer to first sensor. | |
ObSensor * | _second {} |
Pointer to second sensor. | |
ObSensor * | _change {} |
Pointer to change sensor. | |
std::vector< ObSensor * > | _sensors {} |
List of subsensors. | |
Private Attributes | |
glibtop_cpu | _cpu {} |
Cpu info from glitop. | |
glibtop_mem | _mem {} |
Mem info from glitop. | |
glibtop_netlist | _netlist {} |
NetList from glitop. | |
std::vector< glibtop_netload * > | _netloads {} |
List of netload. | |
std::vector< std::string > | _netnames {} |
list of network names | |
System Obmon sensor class.
Definition at line 29 of file ObSensorSystem.h.
ObSensorSystem::ObSensorSystem | ( | std::string | name = {"sys"} | ) |
|
virtual |
|
overridevirtual |
Init sensor function
Reimplemented from ObSensor.
Definition at line 29 of file ObSensorSystem.cpp.
References ObSensor::_change, ObSensor::_first, ObSensor::_second, and ObSensorSystem().
|
overridevirtual |
Returns current sensor representation in json format
Reimplemented from ObSensor.
Definition at line 110 of file ObSensorSystem.cpp.
References _cpu, _mem, _netloads, _netnames, and ObSensor::type().
|
overridevirtual |
Process function.
Process sensor function
Reimplemented from ObSensor.
Definition at line 39 of file ObSensorSystem.cpp.
References _cpu, ObSensor::_logger, _mem, _netloads, and _netnames.
Calculate time change (speed)
Calculate change over time (speed)
Reimplemented from ObSensor.
Definition at line 58 of file ObSensorSystem.cpp.
References _cpu, _mem, _netloads, _netnames, cpu(), mem(), and netloads().
|
finalvirtualinherited |
Update sensor function
Definition at line 26 of file ObSensor.cpp.
References ObSensor::_first, ObSensor::_second, ObSensor::_sensors, and ObSensor::type().