average read bandwidth within a team
| 395 | |
| 396 | // average read bandwidth within a team |
| 397 | double 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 | |
| 413 | int64_t TCTeamInfo::getMinAvailableSpace(bool includeInFlight) const { |
| 414 | int64_t minAvailableSpace = std::numeric_limits<int64_t>::max(); |
no test coverage detected