Commit b7e59688 authored by Alessio Netti's avatar Alessio Netti
Browse files

Increased multiplier when computing SAR percentages

- The multiplier used when computing percentages in the SAR ProcFS
parser has been raised to 100000 to reduce accuracy loss
parent 55fbc652
......@@ -588,7 +588,7 @@ bool SARParser::_readMetrics() {
for(auto& l : _lines)
if(!l.skip && l.multi && (!_htAggr || l.cpuID<_htVal)) {
for (colCtr = 0; colCtr < (unsigned)l.columns; colCtr++)
_readings->at(l.dest + colCtr).value = _readings->at(l.dest + colCtr).value * 1000 / _accumulators[l.cpuID + 1];
_readings->at(l.dest + colCtr).value = _readings->at(l.dest + colCtr).value * SAR_MULTIPLIER / _accumulators[l.cpuID + 1];
_accumulators[l.cpuID + 1] = 1;
}
......
......@@ -19,6 +19,8 @@
#include <string.h>
#include <exception>
#define SAR_MULTIPLIER 1000000
/**
* The ProcfsParser class provides an interface to parse metrics (and their values) from files in the /proc filesystem.
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment