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