obmon
1.3.1
|
GPU Obmon sensor class. More...
#include <ObSensorGpu.h>
Classes | |
struct | devStat_t |
Structure for device stat simplification. More... | |
Public Types | |
enum | SensorType { NONE, VALUE, SPEED, IGNORE } |
Enums for sensor type. | |
Public Member Functions | |
ObSensorGpu (std::string _name={"gpu"}) | |
virtual | ~ObSensorGpu () override |
bool | init () override |
void | process () override |
Process function. More... | |
void | speed (ObSensor *s1, ObSensor *s2, unsigned int timeout=1000) override |
Calculate time change (speed) More... | |
std::string | json (const std::string name={"static"}) const override |
virtual void | update (unsigned int timeout) final |
std::string | name () const |
Returns name of sensor. | |
void | type (SensorType t) |
Sets sensor type. | |
SensorType | type () const |
Returns sensor type. | |
void | enabled (bool e) |
Sets flag if sensor is enabled. | |
bool | enabled () const |
Returns flag if sensor is enabled. | |
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 = SensorType::NONE |
Sensor type. | |
bool | _enabled |
Is enabled. | |
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 Types | |
typedef struct ObSensorGpu::devStat_t | devStat_t |
Structure for device stat simplification. | |
Private Member Functions | |
std::string | getProcUser (unsigned int) const |
Private Attributes | |
unsigned int | _count = 0 |
Count of NVIDIA devices. | |
std::vector< nvmlDevice_t > | fDevices |
NVML device handles. | |
std::vector< devStat_t > | fStatus |
Device statistics. | |
std::vector< std::vector < nvmlProcessInfo_t > > | fComputeProc |
Compute processes (ex. CUDA Applications) | |
std::vector< std::vector < nvmlProcessInfo_t > > | fGraphicsProc |
Graphics processes (ex. desktop env) | |
GPU Obmon sensor class.
Definition at line 23 of file ObSensorGpu.h.
ObSensorGpu::ObSensorGpu | ( | std::string | _name = {"gpu"} | ) |
|
overridevirtual |
Destructor
Definition at line 8 of file ObSensorGpu.cpp.
|
private |
Get username of user, who started process
Definition at line 195 of file ObSensorGpu.cpp.
Referenced by json().
|
overridevirtual |
Init sensor function
Reimplemented from ObSensor.
Definition at line 15 of file ObSensorGpu.cpp.
References ObSensor::_change, _count, ObSensor::_first, ObSensor::_logger, ObSensor::_second, ObSensor::enabled(), fComputeProc, fDevices, fGraphicsProc, fStatus, ObSensor::init(), ObSensorGpu::devStat_t::name, ObSensorGpu(), and ObSensor::type().
|
overridevirtual |
Returns current sensor representation in json format
Reimplemented from ObSensor.
Definition at line 99 of file ObSensorGpu.cpp.
References _count, ObSensor::_logger, fComputeProc, fGraphicsProc, fStatus, getProcUser(), and ObSensor::type().
|
overridevirtual |
Process function.
Process sensor function
Reimplemented from ObSensor.
Definition at line 64 of file ObSensorGpu.cpp.
References _count, ObSensor::_logger, ObSensor::_name, fComputeProc, fDevices, fGraphicsProc, and fStatus.
Calculate time change (speed)
Calculate change over time (speed)
Reimplemented from ObSensor.
Definition at line 90 of file ObSensorGpu.cpp.
|
finalvirtualinherited |
Update sensor function
Definition at line 33 of file ObSensor.cpp.
References ObSensor::_first, ObSensor::_second, ObSensor::_sensors, ObSensor::enabled(), and ObSensor::type().