mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Improved performance monitoring of NodeStore backends:
* Add multi-sample interface to LoadMonitor * Instrument fetch operations and completions for reporting in server_info
This commit is contained in:
committed by
Vinnie Falco
parent
07d0379edd
commit
34cbb26e47
@@ -122,7 +122,7 @@ void LoadMonitor::addLatency (int latency)
|
||||
mLatencyMSAvg += latency;
|
||||
mLatencyMSPeak += latency;
|
||||
|
||||
// VFALCO NOTE Why are we multiplying by 4?
|
||||
// Units are quarters of a millisecond
|
||||
int const latencyPeak = mLatencyEvents * latency * 4;
|
||||
|
||||
if (mLatencyMSPeak < latencyPeak)
|
||||
@@ -168,6 +168,26 @@ void LoadMonitor::addLoadSample (LoadEvent const& sample)
|
||||
mLatencyMSPeak = latencyPeak;
|
||||
}
|
||||
|
||||
/* Add multiple samples
|
||||
@param count The number of samples to add
|
||||
@param latencyMS The total number of milliseconds
|
||||
*/
|
||||
void LoadMonitor::addSamples (int count, std::chrono::milliseconds latency)
|
||||
{
|
||||
ScopedLockType sl (mLock);
|
||||
|
||||
update ();
|
||||
mCounts += count;
|
||||
mLatencyEvents += count;
|
||||
mLatencyMSAvg += latency.count();
|
||||
mLatencyMSPeak += latency.count();
|
||||
|
||||
int const latencyPeak = mLatencyEvents * latency.count() * 4 / count;
|
||||
|
||||
if (mLatencyMSPeak < latencyPeak)
|
||||
mLatencyMSPeak = latencyPeak;
|
||||
}
|
||||
|
||||
void LoadMonitor::setTargetLatency (std::uint64_t avg, std::uint64_t pk)
|
||||
{
|
||||
mTargetLatencyAvg = avg;
|
||||
|
||||
Reference in New Issue
Block a user