Commit 6fd370c6 authored by Paal Kvamme's avatar Paal Kvamme
Browse files

In the periodic output of the performance logger, include a timestamp and the...

In the periodic output of the performance logger, include a timestamp and the average latency for this period.
parent 92aadc59
......@@ -21,6 +21,7 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <atomic>
#include <algorithm>
......@@ -189,7 +190,7 @@ PerformanceLogger::dumpThroughput(bool clear)
std::lock_guard<std::mutex> lk(_mutex);
std::stringstream ss;
if (_first) {
ss << "CSV0,ID,mbytes,time,speed,readcount,END\n";
ss << "CSV0,Timestamp,ID,Data(MB),Time(sec),Speed(MB/s),Readcount,Mean latency(ms),END\n";
_first = false;
}
if (_sumtimerbeg < _sumtimerend && _sumbytes > 0) {
......@@ -200,11 +201,16 @@ PerformanceLogger::dumpThroughput(bool clear)
// begin and end to a multiple of interval. And add code
// to output a lot of zeros for intervals with no traffic.
ss << "CSV8"
<< std::setprecision(3) << std::fixed
<< "," << _sumtimerbeg
<< "," << _id
<< "," << bytecount / (1024.0*1024.0)
<< "," << elapsed
<< "," << (bytecount / (1024.0*1024.0)) / elapsed
<< "," << _sumtimer->getCount()
<< "," << std::setprecision(0)
<< (_sumtimer->getCount() == 0 ? 0 :
1000.0 * _sumtimer->getTotal() / _sumtimer->getCount())
<< ",END\n";
}
if (clear) {
......
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