Merge pull request #5484 from sfc-gh-ajbeamon/network-thread-busyness-include-primary

When using an external client, report the larger of the primary and external network thread busyness
This commit is contained in:
A.J. Beamon 2021-08-31 09:39:46 -07:00 committed by GitHub
commit 82419d086f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -998,12 +998,17 @@ ThreadFuture<Void> MultiVersionDatabase::createSnapshot(const StringRef& uid, co
}
// Get network thread busyness
// Return the busyness for the main thread. When using external clients, take the larger of the local client
// and the external client's busyness.
double MultiVersionDatabase::getMainThreadBusyness() {
ASSERT(g_network);
double localClientBusyness = g_network->networkInfo.metrics.networkBusyness;
if (dbState->db) {
return dbState->db->getMainThreadBusyness();
return std::max(dbState->db->getMainThreadBusyness(), localClientBusyness);
}
return 0;
return localClientBusyness;
}
// Returns the protocol version reported by the coordinator this client is connected to