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

ProcFS: minor fixes to overflow handling

parent 84912da1
......@@ -629,7 +629,7 @@ bool SARParser::_readMetrics() {
if (_latestBuffer >= _columnRawReadings[(lineCtr - 1) * DEFAULTMETRICS + colCtr])
_latestValue = _latestBuffer - _columnRawReadings[(lineCtr - 1) * DEFAULTMETRICS + colCtr];
else
return false;
_latestValue = _latestBuffer + (ULLONG_MAX - _columnRawReadings[(lineCtr - 1) * DEFAULTMETRICS + colCtr]);
_columnRawReadings[(lineCtr - 1) * DEFAULTMETRICS + colCtr] = _latestBuffer;
_accumulators[accIdx] += _latestValue;
// Second part of the if: if the line contains node-level CPU metrics (starts with "cpu") and the
......
Markdown is supported
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