Skip to content

Commit

Permalink
more comments
Browse files Browse the repository at this point in the history
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
  • Loading branch information
adisuissa committed Jan 10, 2024
1 parent 1972625 commit e66b0c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion source/common/upstream/edf_scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ template <class C> class EdfScheduler : public Scheduler<C> {
// Left to do some picks, execute them one after the other.
EDF_TRACE("Emulated {} picks in init step, {} picks remaining for one after the other step",
picks_so_far, picks - picks_so_far);
for (; picks_so_far < picks; ++picks_so_far) {
while (picks_so_far < picks) {
scheduler.pickAndAdd(calculate_weight);
picks_so_far++;
}
return scheduler;
}
Expand Down
6 changes: 3 additions & 3 deletions test/common/upstream/edf_scheduler_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ TEST_F(EdfSchedulerTest, ManyPeekahead) {

// Validates that creating a scheduler using the createWithPicks (with 0 picks)
// is equal to creating an empty scheduler and adding entries one after the other.
TEST_F(EdfSchedulerTest, EqualityAfterCreateEmpty) {
TEST_F(EdfSchedulerTest, SchedulerWithZeroPicksEqualToEmptyWithAddedEntries) {
constexpr uint32_t num_entries = 128;
std::vector<std::shared_ptr<uint32_t>> entries;
entries.reserve(num_entries);
Expand All @@ -193,7 +193,7 @@ TEST_F(EdfSchedulerTest, EqualityAfterCreateEmpty) {
// Validates that creating a scheduler using the createWithPicks (with 5 picks)
// is equal to creating an empty scheduler and adding entries one after the other,
// and then performing some number of picks.
TEST_F(EdfSchedulerTest, EqualityAfterCreateWithPicks) {
TEST_F(EdfSchedulerTest, SchedulerWithSomePicksEqualToEmptyWithAddedEntries) {
constexpr uint32_t num_entries = 128;
// Use double-precision weights from the range [0.01, 100.5].
// Using different weights to avoid a case where entries with the same weight
Expand Down Expand Up @@ -272,7 +272,7 @@ void firstPickTest(const std::vector<double> weights) {
// Validates that after creating schedulers using the createWithPicks (with random picks)
// and then performing a "first-pick", the distribution of the "first-picks" is
// equal to the weights.
TEST_F(EdfSchedulerTest, CreateWithPicksFirstPickDistribution) {
TEST_F(EdfSchedulerTest, SchedulerWithRandomPicksFirstPickDistribution) {
firstPickTest({25.0, 75.0});
firstPickTest({1.0, 99.0});
firstPickTest({50.0, 50.0});
Expand Down

0 comments on commit e66b0c6

Please sign in to comment.