Rework the way load is accounted to be more accurate and more specific.

This commit is contained in:
JoelKatz
2013-03-03 16:24:47 -08:00
parent a3dcc36e05
commit f0c029ef0d
12 changed files with 47 additions and 23 deletions

View File

@@ -1,4 +1,7 @@
#include "LoadMonitor.h"
#include "Log.h"
SETUP_LOG();
void LoadMonitor::update()
{ // call with the mutex
@@ -52,8 +55,10 @@ void LoadMonitor::addLatency(int latency)
mLatencyMSPeak = lp;
}
void LoadMonitor::addCountAndLatency(int counts, int latency)
void LoadMonitor::addCountAndLatency(const std::string& name, int counts, int latency)
{
if (latency > 1000)
cLog(lsWARNING) << "Job: " << name << " Latency: " << latency;
if (latency == 1)
latency = 0;
boost::mutex::scoped_lock sl(mLock);