fix: runLoopBusyness was always zero

This commit is contained in:
Evan Tschannen 2020-08-28 09:29:54 -07:00
parent 947a625968
commit f6f9aea09e
3 changed files with 4 additions and 4 deletions

View File

@ -1401,7 +1401,7 @@ ACTOR Future<GetReadVersionReply> 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");

View File

@ -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");
}

View File

@ -336,7 +336,7 @@ struct NetworkMetrics {
};
std::unordered_map<TaskPriority, struct PriorityStats> activeTrackers;
double lastZeroBusy;
double lastRunLoopBusyness;
std::vector<struct PriorityStats> starvationTrackers;
static const std::vector<int> starvationBins;