![]() |
Lumiera 0.pre.04~rc.1
»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.
Classes | |
| struct | Wiring |
Public Types | |
| enum | Capacity { DISPATCH , TENDNEXT , SPINTIME , NEARTIME , WORKTIME , IDLEWAIT } |
| Allocation of capacity to time horizon of expected work. More... | |
Static Public Member Functions | |
| static Capacity | classifyTimeHorizon (Offset off) |
| classification of time horizon for scheduling | |
Public Member Functions | |
| LoadController (Wiring &&wiring) | |
| LoadController () | |
| int64_t | averageLag () const |
| int64_t | setCurrentAverageLag (int64_t lag) |
| double | effectiveLoad () const |
| void | updateState (Time) |
| periodic call to build integrated state indicators | |
| void | markWorkerExit () |
| statistics update on scaling down the WorkForce | |
| void | ensureCapacity (Time startHorizon) |
| Hook to check and possibly scale up WorkForce to handle one additional job. | |
| bool | tendedNext (Time nextHead) const |
| did we already tend for the indicated next relevant head time? | |
| void | tendNext (Time nextHead) |
| Mark the indicated next head time as tended. | |
| Capacity | markOutgoingCapacity (Time head, Time now) |
| decide how this thread's capacity shall be used after it returned from being actively employed | |
| Capacity | markIncomingCapacity (Time head, Time now) |
| decide how this thread's capacity shall be used when returning from idle wait and asking for work | |
| 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. | |
Private Member Functions | |
| void | markLagSample (Time head, Time now) |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
| const Wiring | wiring_ |
| TimeVar | tendedHead_ {Time::ANYTIME} |
| atomic_int64_t | sampledLag_ {0} |
|
inlineexplicit |
Definition at line 157 of file load-controller.hpp.
|
inline |
Definition at line 161 of file load-controller.hpp.
| struct vault::gear::LoadController::Wiring |
| enum Capacity |
Allocation of capacity to time horizon of expected work.
Definition at line 300 of file load-controller.hpp.
evaluate the situation encountered when a worker calls for work.
Definition at line 182 of file load-controller.hpp.
References TimeValue::isRegular(), LoadController::Wiring::maxCapacity, LoadController::sampledLag_, and LoadController::wiring_.
Referenced by LoadController::markIncomingCapacity().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 204 of file load-controller.hpp.
References LoadController::sampledLag_.
Referenced by LoadController::effectiveLoad(), LoadController::ensureCapacity(), and LoadController::updateState().
Here is the caller graph for this function:
|
inline |
(re)set the currently seen average lag.
Definition at line 216 of file load-controller.hpp.
References LoadController::sampledLag_.
|
inline |
Definition at line 229 of file load-controller.hpp.
References LoadController::averageLag(), LoadController::Wiring::currWorkForceSize, LoadController::Wiring::maxCapacity, and LoadController::wiring_.
Referenced by Scheduler::getLoadIndicator().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
periodic call to build integrated state indicators
Definition at line 242 of file load-controller.hpp.
References LoadController::averageLag(), LoadController::Wiring::stepUpWorkForce, and LoadController::wiring_.
Referenced by Scheduler::handleDutyCycle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
statistics update on scaling down the WorkForce
Definition at line 256 of file load-controller.hpp.
Referenced by Scheduler::handleWorkerTermination().
Here is the caller graph for this function:
|
inline |
Hook to check and possibly scale up WorkForce to handle one additional job.
Definition at line 265 of file load-controller.hpp.
References LoadController::averageLag(), LoadController::Wiring::stepUpWorkForce, and LoadController::wiring_.
Referenced by Scheduler::maybeScaleWorkForce().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
did we already tend for the indicated next relevant head time?
Definition at line 278 of file load-controller.hpp.
References TimeValue::isRegular(), and LoadController::tendedHead_.
Referenced by LoadController::markOutgoingCapacity(), SchedulerCommutator::scatteredDelay(), and SchedulerLoadControl_test::tendNextActivity().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Mark the indicated next head time as tended.
Definition at line 292 of file load-controller.hpp.
References LoadController::tendedHead_.
Referenced by SchedulerLoadControl_test::classifyCapacity(), SchedulerCommutator::scatteredDelay(), SchedulerLoadControl_test::scatteredReCheck(), and SchedulerLoadControl_test::tendNextActivity().
Here is the caller graph for this function:classification of time horizon for scheduling
Definition at line 310 of file load-controller.hpp.
References LoadController::DISPATCH, LoadController::IDLEWAIT, LoadController::NEARTIME, LoadController::SPINTIME, LoadController::WORKTIME, and Time::ZERO.
Referenced by SchedulerLoadControl_test::classifyHorizon(), LoadController::markIncomingCapacity(), and LoadController::markOutgoingCapacity().
Here is the caller graph for this function:decide how this thread's capacity shall be used after it returned from being actively employed
Definition at line 323 of file load-controller.hpp.
References LoadController::classifyTimeHorizon(), LoadController::IDLEWAIT, LoadController::SPINTIME, LoadController::tendedNext(), LoadController::TENDNEXT, and LoadController::WORKTIME.
Referenced by SchedulerLoadControl_test::classifyCapacity(), SchedulerCommutator::dispatchCapacity(), and LoadController::markIncomingCapacity().
Here is the call graph for this function:
Here is the caller graph for this function:decide how this thread's capacity shall be used when returning from idle wait and asking for work
Definition at line 335 of file load-controller.hpp.
References LoadController::classifyTimeHorizon(), LoadController::IDLEWAIT, LoadController::markLagSample(), LoadController::markOutgoingCapacity(), and LoadController::NEARTIME.
Referenced by SchedulerLoadControl_test::classifyCapacity(), and SchedulerCommutator::dispatchCapacity().
Here is the call graph for this function:
Here is the caller graph for this function: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.
References LoadController::DISPATCH, vault::gear::hash_value(), LoadController::IDLEWAIT, LoadController::NEARTIME, LoadController::SPINTIME, LoadController::tendedHead_, LoadController::TENDNEXT, LoadController::WORKTIME, Time::ZERO, and Offset::ZERO.
Referenced by SchedulerCommutator::scatteredDelay(), and SchedulerLoadControl_test::scatteredReCheck().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 166 of file load-controller.hpp.
Referenced by LoadController::effectiveLoad(), LoadController::ensureCapacity(), LoadController::markLagSample(), and LoadController::updateState().
|
private |
Definition at line 168 of file load-controller.hpp.
Referenced by LoadController::scatteredDelayTime(), LoadController::tendedNext(), and LoadController::tendNext().
|
private |
Definition at line 171 of file load-controller.hpp.
Referenced by LoadController::averageLag(), LoadController::markLagSample(), and LoadController::setCurrentAverageLag().
Inheritance diagram for LoadController:
Collaboration diagram for LoadController: