Skip to content

Commit

Permalink
address missing coverage
Browse files Browse the repository at this point in the history
Signed-off-by: William <wtzhang23@gmail.com>
  • Loading branch information
wtzhang23 committed Feb 20, 2025
1 parent 6ecc2db commit cc819ab
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ class DynamicGradientController : public ConcurrencyController {
};
using DynamicGradientControllerSharedPtr = std::shared_ptr<DynamicGradientController>;

/**
* A concurrency controller similar to `DynamicGradientController`, except minRTT is fixed.
*/
class PinnedGradientController : public ConcurrencyController {
public:
PinnedGradientController(PinnedGradientControllerConfig config, Event::Dispatcher& dispatcher,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,27 @@ min_concurrency: 7
verifyMinRTTValue(min_rtt);
}

TEST_F(GradientControllerTest, PinnedMinRTTSamplePercentileProcessTest) {
const std::string yaml = R"EOF(
sample_aggregate_percentile:
value: 50
concurrency_limit_params:
max_concurrency_limit:
concurrency_update_interval: 0.1s
min_rtt: 0.05s
)EOF";

auto controller = makePinnedController(yaml);

tryForward(*controller, true);
tryForward(*controller, true);
tryForward(*controller, true);
tryForward(*controller, false);
controller->cancelLatencySample();
tryForward(*controller, true);
tryForward(*controller, false);
}

} // namespace
} // namespace Controller
} // namespace AdaptiveConcurrency
Expand Down

0 comments on commit cc819ab

Please sign in to comment.