MCPcopy Create free account
hub / github.com/apple/foundationdb / getLoadReadBandwidth

Method getLoadReadBandwidth

fdbserver/TCInfo.actor.cpp:397–411  ·  view source on GitHub ↗

average read bandwidth within a team

Source from the content-addressed store, hash-verified

395
396// average read bandwidth within a team
397double TCTeamInfo::getLoadReadBandwidth(bool includeInFlight, double inflightPenalty) const {
398 // FIXME: consider team load variance
399 double sum = 0;
400 int size = 0;
401 for (const auto& server : servers) {
402 if (server->metricsPresent()) {
403 auto& replyValue = server->getMetrics();
404 ASSERT(replyValue.load.bytesReadPerKSecond >= 0);
405 sum += replyValue.load.bytesReadPerKSecond;
406 size += 1;
407 }
408 }
409 return (size == 0 ? 0 : sum / size) +
410 (includeInFlight ? inflightPenalty * getReadInFlightToTeam() / servers.size() : 0);
411}
412
413int64_t TCTeamInfo::getMinAvailableSpace(bool includeInFlight) const {
414 int64_t minAvailableSpace = std::numeric_limits<int64_t>::max();

Callers 2

greaterReadLoadMethod · 0.45
lessReadLoadMethod · 0.45

Calls 3

metricsPresentMethod · 0.80
getMetricsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected