Job queue simplificaiton

This commit is contained in:
JoelKatz
2013-03-06 19:30:08 -08:00
parent dc3d82272e
commit 0007d76923
6 changed files with 18 additions and 23 deletions

View File

@@ -30,12 +30,12 @@ void LoadMonitor::update()
} while (mLastUpdate < now);
}
void LoadMonitor::addCount(int counts)
void LoadMonitor::addCount()
{
boost::mutex::scoped_lock sl(mLock);
update();
mCounts += counts;
++mCounts;
}
void LoadMonitor::addLatency(int latency)
@@ -55,7 +55,7 @@ void LoadMonitor::addLatency(int latency)
mLatencyMSPeak = lp;
}
void LoadMonitor::addCountAndLatency(const std::string& name, int counts, int latency)
void LoadMonitor::addCountAndLatency(const std::string& name, int latency)
{
if (latency > 500)
{
@@ -63,10 +63,11 @@ void LoadMonitor::addCountAndLatency(const std::string& name, int counts, int la
}
if (latency == 1)
latency = 0;
boost::mutex::scoped_lock sl(mLock);
update();
mCounts += counts;
++mCounts;
++mLatencyEvents;
mLatencyMSAvg += latency;
mLatencyMSPeak += latency;