From f6f9aea09e76c91f94f67e25084ecc98744414da Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 28 Aug 2020 09:29:54 -0700 Subject: [PATCH] fix: runLoopBusyness was always zero --- fdbserver/MasterProxyServer.actor.cpp | 2 +- flow/SystemMonitor.cpp | 4 ++-- flow/network.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fdbserver/MasterProxyServer.actor.cpp b/fdbserver/MasterProxyServer.actor.cpp index 807fab9afb..4830d61970 100644 --- a/fdbserver/MasterProxyServer.actor.cpp +++ b/fdbserver/MasterProxyServer.actor.cpp @@ -1401,7 +1401,7 @@ ACTOR Future getLiveCommittedVersion(ProxyCommitData* commi rep = v; } } - rep.processBusyTime = 1e6 * (g_network->isSimulated() ? deterministicRandom()->random01() : g_network->networkInfo.metrics.lastZeroBusy); + rep.processBusyTime = 1e6 * (g_network->isSimulated() ? deterministicRandom()->random01() : g_network->networkInfo.metrics.lastRunLoopBusyness); if (debugID.present()) { g_traceBatch.addEvent("TransactionDebug", debugID.get().first(), "MasterProxyServer.getLiveCommittedVersion.After"); diff --git a/flow/SystemMonitor.cpp b/flow/SystemMonitor.cpp index 639575daa9..d008e9d92f 100644 --- a/flow/SystemMonitor.cpp +++ b/flow/SystemMonitor.cpp @@ -166,6 +166,8 @@ SystemStatistics customSystemMonitor(std::string eventName, StatisticsState *sta n.detail(format("PriorityBusy%d", itr.first).c_str(), itr.second); } + g_network->networkInfo.metrics.lastRunLoopBusyness = std::min(currentStats.elapsed,g_network->networkInfo.metrics.starvationTrackers[0].duration)/currentStats.elapsed; + for (auto &itr : g_network->networkInfo.metrics.starvationTrackers) { if(itr.active) { itr.duration += now() - itr.windowedTimer; @@ -180,8 +182,6 @@ SystemStatistics customSystemMonitor(std::string eventName, StatisticsState *sta itr.maxDuration = 0; } - g_network->networkInfo.metrics.lastZeroBusy = std::min(currentStats.elapsed,g_network->networkInfo.metrics.starvationTrackers[0].duration)/currentStats.elapsed; - n.trackLatest("NetworkMetrics"); } diff --git a/flow/network.h b/flow/network.h index f2139a7cbd..5aa083185b 100644 --- a/flow/network.h +++ b/flow/network.h @@ -336,7 +336,7 @@ struct NetworkMetrics { }; std::unordered_map activeTrackers; - double lastZeroBusy; + double lastRunLoopBusyness; std::vector starvationTrackers; static const std::vector starvationBins;