mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Improve the display resolution of LoadMonitor samples
This commit is contained in:
@@ -108,6 +108,13 @@ void LoadMonitor::addLatency (int latency)
|
||||
mLatencyMSPeak = latencyPeak;
|
||||
}
|
||||
|
||||
std::string LoadMonitor::printElapsed (double seconds)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << (std::size_t (seconds * 1000 + 0.5)) << " ms";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void LoadMonitor::addLoadSample (LoadEvent const& sample)
|
||||
{
|
||||
std::string const& name (sample.name());
|
||||
@@ -116,8 +123,8 @@ void LoadMonitor::addLoadSample (LoadEvent const& sample)
|
||||
if (latency.inSeconds() > 0.5)
|
||||
{
|
||||
WriteLog ((latency.inSeconds() > 1.0) ? lsWARNING : lsINFO, LoadMonitor)
|
||||
<< "Job: " << name << " ExecutionTime: " << RelativeTime (sample.getSecondsRunning()) <<
|
||||
" WaitingTime: " << RelativeTime (sample.getSecondsWaiting());
|
||||
<< "Job: " << name << " ExecutionTime: " << printElapsed (sample.getSecondsRunning()) <<
|
||||
" WaitingTime: " << printElapsed (sample.getSecondsWaiting());
|
||||
}
|
||||
|
||||
// VFALCO NOTE Why does 1 become 0?
|
||||
|
||||
Reference in New Issue
Block a user