| 4657 | } |
| 4658 | |
| 4659 | void DDTeamCollection::traceTeamCollectionInfo() const { |
| 4660 | int totalHealthyServerCount = calculateHealthyServerCount(); |
| 4661 | int desiredServerTeams = SERVER_KNOBS->DESIRED_TEAMS_PER_SERVER * totalHealthyServerCount; |
| 4662 | int maxServerTeams = SERVER_KNOBS->MAX_TEAMS_PER_SERVER * totalHealthyServerCount; |
| 4663 | |
| 4664 | int totalHealthyMachineCount = calculateHealthyMachineCount(); |
| 4665 | int desiredMachineTeams = SERVER_KNOBS->DESIRED_TEAMS_PER_SERVER * totalHealthyMachineCount; |
| 4666 | int maxMachineTeams = SERVER_KNOBS->MAX_TEAMS_PER_SERVER * totalHealthyMachineCount; |
| 4667 | int healthyMachineTeamCount = getHealthyMachineTeamCount(); |
| 4668 | |
| 4669 | auto [minTeamsOnServer, maxTeamsOnServer] = calculateMinMaxServerTeamsOnServer(); |
| 4670 | auto [minMachineTeamsOnMachine, maxMachineTeamsOnMachine] = calculateMinMaxMachineTeamsOnMachine(); |
| 4671 | |
| 4672 | TraceEvent("TeamCollectionInfo", distributorId) |
| 4673 | .detail("Primary", primary) |
| 4674 | .detail("AddedTeams", 0) |
| 4675 | .detail("TeamsToBuild", 0) |
| 4676 | .detail("CurrentServerTeams", teams.size()) |
| 4677 | .detail("DesiredTeams", desiredServerTeams) |
| 4678 | .detail("MaxTeams", maxServerTeams) |
| 4679 | .detail("StorageTeamSize", configuration.storageTeamSize) |
| 4680 | .detail("CurrentMachineTeams", machineTeams.size()) |
| 4681 | .detail("CurrentHealthyMachineTeams", healthyMachineTeamCount) |
| 4682 | .detail("DesiredMachineTeams", desiredMachineTeams) |
| 4683 | .detail("MaxMachineTeams", maxMachineTeams) |
| 4684 | .detail("TotalHealthyMachines", totalHealthyMachineCount) |
| 4685 | .detail("MinTeamsOnServer", minTeamsOnServer) |
| 4686 | .detail("MaxTeamsOnServer", maxTeamsOnServer) |
| 4687 | .detail("MinMachineTeamsOnMachine", minMachineTeamsOnMachine) |
| 4688 | .detail("MaxMachineTeamsOnMachine", maxMachineTeamsOnMachine) |
| 4689 | .detail("DoBuildTeams", doBuildTeams) |
| 4690 | .trackLatest(teamCollectionInfoEventHolder->trackingKey); |
| 4691 | |
| 4692 | // Advance time so that we will not have multiple TeamCollectionInfo at the same time, otherwise |
| 4693 | // simulation test will randomly pick one TeamCollectionInfo trace, which could be the one before build teams |
| 4694 | // wait(delay(0.01)); |
| 4695 | |
| 4696 | // Debug purpose |
| 4697 | // if (healthyMachineTeamCount > desiredMachineTeams || machineTeams.size() > maxMachineTeams) { |
| 4698 | // // When the number of machine teams is over the limit, print out the current team info. |
| 4699 | // traceAllInfo(true); |
| 4700 | // } |
| 4701 | } |
| 4702 | |
| 4703 | void DDTeamCollection::noHealthyTeams() const { |
| 4704 | std::set<UID> desiredServerSet; |
no test coverage detected