5 #include "artdaq-utilities/Plugins/MetricData.hh"
89 std::list<std::unique_ptr<MetricData>>
SendMetrics();
94 unsigned long long user, nice, system, idle, iowait, irq, softirq;
95 unsigned long long totalUsage, total;
97 : user(0), nice(0), system(0), idle(0), iowait(0), irq(0), softirq(0), totalUsage(0), total(0) {}
99 cpustat ReadProcStat_();
103 unsigned long long send_bytes, recv_bytes, send_errs, recv_errs;
104 std::chrono::steady_clock::time_point collectionTime;
106 : send_bytes(0), recv_bytes(0), send_errs(0), recv_errs(0) {}
108 netstat ReadProcNetDev_();
109 void UpdateNetstat_();
112 struct tms lastProcessCPUTimes_;
113 clock_t lastProcessCPUTime_;
114 netstat thisNetStat_;
115 netstat lastNetStat_;
116 bool sendProcessMetrics_;
117 bool sendSystemMetrics_;
unsigned long GetAvailableRAM()
Get the amount of available RAM in the system
unsigned long GetProcessMemUsage()
Get the amount of RAM being used by this process
unsigned long GetNetworkReceiveErrors()
Get the number of network receive errors in the last network collection interval (1.0 s)
unsigned long GetBufferedRAM()
Get the amount of RAM currently being used for cache
std::list< std::unique_ptr< MetricData > > SendMetrics()
Send the configured metrics
unsigned long GetNetworkSendBytes()
Get the amount of data sent to the network in the last network collection interval (1...
Collects metrics from the system, using proc filesystem or kernel API calls
double GetAvailableRAMPercent(bool buffers)
Get the percentage of available RAM
double GetProcessCPUUsagePercent()
Return the current amount of CPU usage for the current process, %
unsigned long GetTotalRAM()
Get the total amount of RAM in the system
SystemMetricCollector(bool processMetrics, bool systemMetrics)
SystemMetricCollector Constructor
double GetProcessMemUsagePercent()
Get the amount of RAM being used by this process
double GetSystemCPUUsagePercent()
Return the current overall system CPU usage in %
unsigned long GetNetworkReceiveBytes()
Get the amount of data received from the network in the last network collection interval (1...
unsigned long GetNetworkSendErrors()
Get the number of network send errors in the last network collection interval (1.0 s) ...