clangify includes
This commit is contained in:
11
src/sys.cpp
11
src/sys.cpp
@@ -1,4 +1,5 @@
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <format>
|
||||
#include <string>
|
||||
@@ -35,11 +36,11 @@ void sys::getNetwork(Network* net, std::string device) {
|
||||
uint64_t rx = 0;
|
||||
uint64_t tx = 0;
|
||||
};
|
||||
|
||||
|
||||
static _net prev;
|
||||
_net current;
|
||||
|
||||
current.ts = std::chrono::steady_clock::now();
|
||||
|
||||
current.ts = std::chrono::steady_clock::now();
|
||||
current.rx = std::stoull(readFile("/sys/class/net/" + device + "/statistics/rx_bytes", 32));
|
||||
current.tx = std::stoull(readFile("/sys/class/net/" + device + "/statistics/tx_bytes", 32));
|
||||
float ts_diff = std::chrono::duration_cast<std::chrono::microseconds>(current.ts - prev.ts).count() / 1000000.0f;
|
||||
@@ -48,13 +49,13 @@ void sys::getNetwork(Network* net, std::string device) {
|
||||
prev = current;
|
||||
}
|
||||
|
||||
|
||||
void sys::detectHwmon(sysSensors* s, std::string platform) {
|
||||
s->hwmon = getFirstDir("/sys/devices/platform/" + platform + "/hwmon");
|
||||
}
|
||||
|
||||
void sys::updateSensors(sysSensors* s) {
|
||||
s->fan_speed[0] = std::stol(readFile(s->hwmon + "/fan2_input", 4));
|
||||
s->fan_speed[1] = std::stol(readFile(s->hwmon + "/fan7_input", 4));;
|
||||
s->fan_speed[1] = std::stol(readFile(s->hwmon + "/fan7_input", 4));
|
||||
;
|
||||
s->t_sensor = std::stol(readFile(s->hwmon + "/temp5_input", 2));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user