Commit fc2c10a0 authored by Frank Kautz's avatar Frank Kautz

admon: fix time selection during write throuput sum calculation

the bug leads to wrong log messages and to flipping graphs
related to ticket #362

(cherry picked from commit bcdf05ea544e707511dd4db92c5fde2bb1e03794)
parent e8155818
......@@ -501,12 +501,17 @@ void NodeStoreStorageEx::diskPerfWriteSum(uint timespanM, UInt64List *outListTim
stats.incVals.diskWriteBytes = UnitTk::mebibyteToByte(content.diskWritePerSec);
highResData.push_back(stats);
}
dataSets.push_back(highResData);
}
}
// now add up the values for each time
// timestamps will never be exactly the same => take about 1 second or 5 seconds, add
// them and divide it by the span of the first and the last time
// do as long until all lists are empty
while(!dataSets.empty() )
while(!dataSets.empty() ) // no lists remaining => stop
{
int elementCount = dataSets.size();
......@@ -519,6 +524,7 @@ void NodeStoreStorageEx::diskPerfWriteSum(uint timespanM, UInt64List *outListTim
while(!validTimeFound)
{
masterTime = dataSets[0].front().rawVals.statsTimeMS;
if(masterTime < startTimestampMS)
{
dataSets[0].pop_front();
......@@ -563,6 +569,7 @@ void NodeStoreStorageEx::diskPerfWriteSum(uint timespanM, UInt64List *outListTim
// next list as master
dataSets.erase(dataSets.begin());
}
// calculate averages, it's important to use same order values here,
// otherwise the chart will be screwed
statshelper::floatingAverage(outListWritePerSec, outListTime, outListAverageWritePerSec,
......@@ -616,7 +623,6 @@ void NodeStoreStorageEx::diskPerfReadSum(uint timespanM, UInt64List *outListTime
StorageNodeDataContent content = *contIter;
HighResolutionStats stats;
stats.rawVals.statsTimeMS = content.time * 1000;
// db stores in MiB
stats.incVals.diskReadBytes = UnitTk::mebibyteToByte(content.diskReadPerSec);
highResData.push_back(stats);
}
......@@ -629,7 +635,7 @@ void NodeStoreStorageEx::diskPerfReadSum(uint timespanM, UInt64List *outListTime
// timestamps will never be exactly the same => take about 1 second or 5 seconds, add
// them and divide it by the span of the first and the last time
// do as long until all lists are emptys
// do as long until all lists are empty
while(!dataSets.empty() ) // no lists remaining => stop
{
int elementCount = dataSets.size();
......@@ -689,6 +695,8 @@ void NodeStoreStorageEx::diskPerfReadSum(uint timespanM, UInt64List *outListTime
dataSets.erase(dataSets.begin());
}
// calculate averages, it's important to use same order values here,
// otherwise the chart will be screwed
statshelper::floatingAverage(outListReadPerSec, outListTime, outListAverageReadPerSec,
outListAverageTime, DISPLAY_FLOATING_AVERAGE_ORDER);
}
......
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