5 #include "artdaq-utilities/Plugins/MetricData.hh"
13 double GetSystemCPUUsagePercent();
14 double GetProcessCPUUsagePercent();
16 unsigned long GetAvailableRAM();
17 unsigned long GetBufferedRAM();
18 unsigned long GetTotalRAM();
19 double GetAvailableRAMPercent(
bool buffers);
20 unsigned long GetProcessMemUsage();
21 double GetProcessMemUsagePercent();
23 unsigned long GetNetworkReceiveBytes();
24 unsigned long GetNetworkSendBytes();
25 unsigned long GetNetworkReceiveErrors();
26 unsigned long GetNetworkSendErrors();
28 std::list<std::unique_ptr<MetricData>> SendMetrics();
33 unsigned long long user, nice, system, idle, iowait, irq, softirq;
34 unsigned long long totalUsage, total;
36 : user(0), nice(0), system(0), idle(0), iowait(0), irq(0), softirq(0), totalUsage(0), total(0) {}
38 cpustat ReadProcStat_();
42 unsigned long long send_bytes, recv_bytes, send_errs, recv_errs;
43 std::chrono::steady_clock::time_point collectionTime;
45 : send_bytes(0), recv_bytes(0), send_errs(0), recv_errs(0) {}
47 netstat ReadProcNetDev_();
48 void UpdateNetstat_();
51 struct tms lastProcessCPUTimes_;
52 clock_t lastProcessCPUTime_;
55 bool sendProcessMetrics_;
56 bool sendSystemMetrics_;