Lumiera
0.pre.03
»edit your freedom«
|
#include "vault/gear/load-controller.hpp"
Controller to coordinate resource usage related to the Scheduler.
Definition at line 144 of file load-controller.hpp.
Public Types | |
enum | Capacity { DISPATCH, TENDNEXT, SPINTIME, NEARTIME, WORKTIME, IDLEWAIT } |
Allocation of capacity to time horizon of expected work. More... | |
Public Member Functions | |
LoadController (Wiring &&wiring) | |
int64_t | averageLag () const |
double | effectiveLoad () const |
void | ensureCapacity (Time startHorizon) |
Hook to check and possibly scale up WorkForce to handle one additional job. | |
Capacity | markIncomingCapacity (Time head, Time now) |
decide how this thread's capacity shall be used when returning from idle wait and asking for work | |
Capacity | markOutgoingCapacity (Time head, Time now) |
decide how this thread's capacity shall be used after it returned from being actively employed | |
void | markWorkerExit () |
statistics update on scaling down the WorkForce | |
Offset | scatteredDelayTime (Time now, Capacity capacity) |
Generate a time offset to relocate currently unused capacity to a time range where it's likely to be needed. More... | |
int64_t | setCurrentAverageLag (int64_t lag) |
bool | tendedNext (Time nextHead) const |
did we already tend for the indicated next relevant head time? More... | |
void | tendNext (Time nextHead) |
Mark the indicated next head time as tended. More... | |
void | updateState (Time) |
periodic call to build integrated state indicators | |
Static Public Member Functions | |
static Capacity | classifyTimeHorizon (Offset off) |
classification of time horizon for scheduling | |
Classes | |
struct | Wiring |
Private Member Functions | |
void | markLagSample (Time head, Time now) |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
atomic_int64_t | sampledLag_ {0} |
TimeVar | tendedHead_ {Time::ANYTIME} |
const Wiring | wiring_ |
enum Capacity |
Allocation of capacity to time horizon of expected work.
Definition at line 300 of file load-controller.hpp.
struct vault::gear::LoadController::Wiring |
evaluate the situation encountered when a worker calls for work.
Definition at line 182 of file load-controller.hpp.
References TimeValue::isRegular(), vault::gear::anonymous_namespace{load-controller.hpp}::LAG_SAMPLE_DAMPING, vault::gear::anonymous_namespace{load-controller.hpp}::SLEEP_HORIZON, and vault::gear::anonymous_namespace{load-controller.hpp}::WORK_HORIZON.
Referenced by LoadController::markIncomingCapacity().
|
inline |
Definition at line 204 of file load-controller.hpp.
Referenced by LoadController::effectiveLoad(), LoadController::ensureCapacity(), and LoadController::updateState().
|
inline |
(re)set the currently seen average lag.
Definition at line 216 of file load-controller.hpp.
Referenced by SchedulerLoadControl_test::indicateAverageLoad().
|
inline |
Definition at line 229 of file load-controller.hpp.
References LoadController::averageLag(), vault::gear::anonymous_namespace{load-controller.hpp}::STANDARD_LAG, and vault::gear::anonymous_namespace{load-controller.hpp}::WORK_HORIZON.
Referenced by Scheduler::getLoadIndicator().
|
inline |
did we already tend for the indicated next relevant head time?
Definition at line 278 of file load-controller.hpp.
References TimeValue::isRegular().
Referenced by LoadController::markOutgoingCapacity(), SchedulerCommutator::scatteredDelay(), and SchedulerLoadControl_test::tendNextActivity().
|
inline |
Mark the indicated next head time as tended.
Definition at line 292 of file load-controller.hpp.
Referenced by SchedulerLoadControl_test::classifyCapacity(), SchedulerCommutator::scatteredDelay(), SchedulerLoadControl_test::scatteredReCheck(), and SchedulerLoadControl_test::tendNextActivity().
Generate a time offset to relocate currently unused capacity to a time range where it's likely to be needed.
Assuming the classification is based on the current distance to the next Activity known to the scheduler (the next tended head time).
Definition at line 361 of file load-controller.hpp.
Referenced by SchedulerCommutator::scatteredDelay(), and SchedulerLoadControl_test::scatteredReCheck().