Example #1
0
LoadMonitor::Stats LoadMonitor::getStats ()
{
    Stats stats;

    ScopedLockType sl (mLock, __FILE__, __LINE__);

    update ();

    stats.count = mCounts / 4;

    if (mLatencyEvents == 0)
    {
        stats.latencyAvg = 0;
        stats.latencyPeak = 0;
    }
    else
    {
        stats.latencyAvg = mLatencyMSAvg / (mLatencyEvents * 4);
        stats.latencyPeak = mLatencyMSPeak / (mLatencyEvents * 4);
    }

    stats.isOverloaded = isOverTarget (stats.latencyAvg, stats.latencyPeak);

    return stats;
}
Example #2
0
bool LoadMonitor::isOver ()
{
    ScopedLockType sl (mLock, __FILE__, __LINE__);

    update ();

    if (mLatencyEvents == 0)
        return 0;

    return isOverTarget (mLatencyMSAvg / (mLatencyEvents * 4), mLatencyMSPeak / (mLatencyEvents * 4));
}
Example #3
0
bool LoadMonitor::isOver()
{
	boost::mutex::scoped_lock sl(mLock);

	update();

	if (mLatencyEvents == 0)
		return 0;

	return isOverTarget(mLatencyMSAvg / (mLatencyEvents * 4), mLatencyMSPeak / (mLatencyEvents * 4));
}
Example #4
0
void LoadMonitor::getCountAndLatency(uint64& count, uint64& latencyAvg, uint64& latencyPeak, bool& isOver)
{
	boost::mutex::scoped_lock sl(mLock);

	update();

	count = mCounts / 4;

	if (mLatencyEvents == 0)
	{
		latencyAvg = 0;
		latencyPeak = 0;
	}
	else
	{
		latencyAvg = mLatencyMSAvg / (mLatencyEvents * 4);
		latencyPeak = mLatencyMSPeak / (mLatencyEvents * 4);
	}
	isOver = isOverTarget(latencyAvg, latencyPeak);
}