Skip to content

Commit

Permalink
#1359: LB: improve printing of lb arg documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nlslatt authored and lifflander committed Sep 28, 2021
1 parent c1d5555 commit 2b59441
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ void LBManager::startLB(PhaseType phase, LBType lb) {
runLB(base_proxy, phase);
}

/*static*/
void LBManager::printLBArgsHelp(LBType lb) {
if (theContext()->getNode() == 0) {
fmt::print("\nLB arguments for {}:\n\n", lb_names_[lb]);
Expand All @@ -284,14 +285,22 @@ void LBManager::printLBArgsHelp(LBType lb) {
case LBType::RandomLB:
help = std::move(lb::RandomLB::getInputKeysWithHelp());
break;
case LBType::NoLB:
// deliberately skip retrieving arguments
break;
default:
fmt::print("Documentation has not been provided for this LB.\n\n");
return;
break;
}

for (auto &arg_help : help) {
fmt::print("Argument: {}\n", arg_help.first);
fmt::print("{}\n", arg_help.second);
if (help.size() > 0) {
for (auto &arg_help : help) {
fmt::print("Argument: {}\n", arg_help.first);
fmt::print("{}\n", arg_help.second);
}
} else {
fmt::print("No LB arguments are supported by this load balancer.\n\n");
}
}
}
Expand Down

0 comments on commit 2b59441

Please sign in to comment.