Lumiera  0.pre.03
»edit your freedom«
SchedulerLoadControl_test Class Reference

Description

Test:
verify behaviour patterns relevant for Scheduler load control.
See also
SchedulerCommutator_test
SchedulerService_test
SchedulerStress_test

Definition at line 57 of file scheduler-load-control-test.cpp.

Private Member Functions

void classifyCapacity ()
 
void classifyHorizon ()
 
void indicateAverageLoad ()
 
virtual void run (Arg)
 
void scatteredReCheck ()
 
void simpleUsage ()
 
void tendNextActivity ()
 

Additional Inherited Members

- Public Member Functions inherited from Test
virtual void run (Arg arg)=0
 

Member Function Documentation

◆ simpleUsage()

void simpleUsage ( )
inlineprivate
Test:
TODO demonstrate a simple usage scenario
Todo:
WIP 10/23 🔁 define ⟶ 🔁 implement

Definition at line 76 of file scheduler-load-control-test.cpp.

◆ classifyHorizon()

void classifyHorizon ( )
inlineprivate
Test:
verify classification of time horizon for scheduling.
  • if the next planned Activity lies beyond the SLEEP_HORIZON, then the current thread can be considered part of the idle capacity
  • in a similar way, WORK_HORIZON delineates the zone of repeated incoming Activities from the zone considered part of current active operation
  • Activities within the NOW_HORIZON can be awaited by yield-spinning
  • and any event from current into the past will be scheduled right away

Definition at line 93 of file scheduler-load-control-test.cpp.

References LoadController::classifyTimeHorizon(), vault::gear::anonymous_namespace{load-controller.hpp}::NEAR_HORIZON, vault::gear::anonymous_namespace{load-controller.hpp}::SLEEP_HORIZON, and vault::gear::anonymous_namespace{load-controller.hpp}::WORK_HORIZON.

+ Here is the call graph for this function:

◆ tendNextActivity()

void tendNextActivity ( )
inlineprivate
Test:
verify the mark for tended next head Activity.

Definition at line 122 of file scheduler-load-control-test.cpp.

References LoadController::tendedNext(), and LoadController::tendNext().

+ Here is the call graph for this function:

◆ classifyCapacity()

void classifyCapacity ( )
inlineprivate
Test:
verify allocation decision for free capacity
  • due and overdue Activities are prioritised
  • keep spinning when next Activity to schedule is very close
  • otherwise, priority is to tend for the next known Activity
  • beyond that, free capacity is redistributed according to horizon
  • for incoming free capacity there is a preference to keep it sleeping, to allow for disposing of excess capacity after extended sleep time

Definition at line 166 of file scheduler-load-control-test.cpp.

References LoadController::markIncomingCapacity(), LoadController::markOutgoingCapacity(), vault::gear::anonymous_namespace{load-controller.hpp}::NEAR_HORIZON, Time::NEVER, vault::gear::anonymous_namespace{load-controller.hpp}::SLEEP_HORIZON, LoadController::tendNext(), and vault::gear::anonymous_namespace{load-controller.hpp}::WORK_HORIZON.

+ Here is the call graph for this function:

◆ scatteredReCheck()

void scatteredReCheck ( )
inlineprivate
Test:
verify the re-distribution of free capacity by targeted delay
  • the implementation uses the next-tended start time as anchor point
  • capacity classes which should be scheduled right away will actually never call this function — yet still a sensible value is returned here
  • capacity targeted at current work will be redistributed behind the next-tended time, and within a time span corresponding to the work realm
  • capacity targeted towards more future work will be distributed within the horizon defined by the sleep-cycle
  • especially for capacity sent to sleep, this redistribution works without being shifted behind the next-tended time, since in that case the goal is to produce a random distribution of the »sleeper« callbacks.

Definition at line 244 of file scheduler-load-control-test.cpp.

References Time::ANYTIME, LoadController::scatteredDelayTime(), vault::gear::anonymous_namespace{load-controller.hpp}::SLEEP_HORIZON, LoadController::tendNext(), and vault::gear::anonymous_namespace{load-controller.hpp}::WORK_HORIZON.

+ Here is the call graph for this function:

◆ indicateAverageLoad()

void indicateAverageLoad ( )
inlineprivate
Test:
verify fusion of sampled observations to guess average scheduler load
  • use a rigged wiring of the load controller to verify calculation based on known values of current concurrency and schedule pressure
  • scheduling on average 200µs behind nominal schedule is considered the regular balanced state and thus defined as 100% schedule pressure
  • if congestion builds up to 1/10 of WORK_HORIZON, 200% overload is indicated
  • on the other hand, if workers appear on average 200µs before the typical balanced state, the resulting headroom is defined to constitute 50% pressure
  • the pressure value is multiplied with the degree of concurrency
  • the pressure is sampled from the lag (distance of current time to the next activity to schedule), which is observed whenever a worker calls in to retrieve more work.

These calls happen randomly.

Definition at line 297 of file scheduler-load-control-test.cpp.

References LoadController::setCurrentAverageLag(), and vault::gear::test::anonymous_namespace{work-force-test.cpp}::setup().

+ Here is the call graph for this function:
+ Inheritance diagram for SchedulerLoadControl_test:
+ Collaboration diagram for SchedulerLoadControl_test:

The documentation for this class was generated from the following file: