![]() |
Project
|
#include <ComputingQuotaEvaluator.h>
Public Member Functions | |
ComputingQuotaEvaluator (ServiceRegistryRef ref) | |
bool | selectOffer (int task, ComputingQuotaRequest const &request, uint64_t now) |
void | consume (int taskId, ComputingQuotaConsumer &consumed, std::function< void(ComputingQuotaOffer const &accumulatedConsumed, ComputingQuotaStats &)> &reportConsumedOffer) |
void | dispose (int taskId) |
Dispose offers for a given taskId. | |
void | handleExpired (std::function< void(ComputingQuotaOffer const &, ComputingQuotaStats const &)> reportExpired) |
void | updateOffers (std::vector< ComputingQuotaOffer > &offers, uint64_t now) |
now the time (e.g. uv_now) when invoked. | |
Public Attributes | |
std::array< ComputingQuotaOffer, MAX_INFLIGHT_OFFERS > | mOffers |
All the available offerts. | |
std::vector< ComputingQuotaOfferRef > | mExpiredOffers |
The offers which expired and need to be given back. | |
std::array< ComputingQuotaInfo, MAX_INFLIGHT_OFFERS > | mInfos |
Information about a given computing offer (e.g. when it was started to be used) | |
ComputingQuotaStats | mStats |
ServiceRegistryRef | mRef |
uv_timer_t * | mTimer |
Static Public Attributes | |
static constexpr int | MAX_INFLIGHT_OFFERS = 16 |
Definition at line 31 of file ComputingQuotaEvaluator.h.
o2::framework::ComputingQuotaEvaluator::ComputingQuotaEvaluator | ( | ServiceRegistryRef | ref | ) |
Definition at line 31 of file ComputingQuotaEvaluator.cxx.
void o2::framework::ComputingQuotaEvaluator::consume | ( | int | taskId, |
ComputingQuotaConsumer & | consumed, | ||
std::function< void(ComputingQuotaOffer const &accumulatedConsumed, ComputingQuotaStats &)> & | reportConsumedOffer | ||
) |
Consume offers for a given taskId reportConsumedOffer callback which reports back that an offer has been consumed.
Definition at line 190 of file ComputingQuotaEvaluator.cxx.
Dispose offers for a given taskId.
An offer with index 0 is always there. All the others are reset.
Definition at line 198 of file ComputingQuotaEvaluator.cxx.
void o2::framework::ComputingQuotaEvaluator::handleExpired | ( | std::function< void(ComputingQuotaOffer const &, ComputingQuotaStats const &)> | reportExpired | ) |
Handle all the offers which have timed out giving them back to the driver. expirator callback with expired offers
Whenever an offer is expired, we give back the resources to the driver.
Definition at line 242 of file ComputingQuotaEvaluator.cxx.
bool o2::framework::ComputingQuotaEvaluator::selectOffer | ( | int | task, |
ComputingQuotaRequest const & | request, | ||
uint64_t | now | ||
) |
task the task which needs some quota request the resource request the task needs now the time (e.g. uv_now) when invoked.
We then check if the offer is suitable
Definition at line 65 of file ComputingQuotaEvaluator.cxx.
void o2::framework::ComputingQuotaEvaluator::updateOffers | ( | std::vector< ComputingQuotaOffer > & | offers, |
uint64_t | now | ||
) |
now the time (e.g. uv_now) when invoked.
Move offers from the pending list to the actual available offers.
Definition at line 223 of file ComputingQuotaEvaluator.cxx.
|
staticconstexpr |
Definition at line 35 of file ComputingQuotaEvaluator.h.
std::vector<ComputingQuotaOfferRef> o2::framework::ComputingQuotaEvaluator::mExpiredOffers |
The offers which expired and need to be given back.
Definition at line 58 of file ComputingQuotaEvaluator.h.
std::array<ComputingQuotaInfo, MAX_INFLIGHT_OFFERS> o2::framework::ComputingQuotaEvaluator::mInfos |
Information about a given computing offer (e.g. when it was started to be used)
Definition at line 60 of file ComputingQuotaEvaluator.h.
std::array<ComputingQuotaOffer, MAX_INFLIGHT_OFFERS> o2::framework::ComputingQuotaEvaluator::mOffers |
All the available offerts.
Definition at line 56 of file ComputingQuotaEvaluator.h.
ServiceRegistryRef o2::framework::ComputingQuotaEvaluator::mRef |
Definition at line 62 of file ComputingQuotaEvaluator.h.
ComputingQuotaStats o2::framework::ComputingQuotaEvaluator::mStats |
Definition at line 61 of file ComputingQuotaEvaluator.h.
uv_timer_t* o2::framework::ComputingQuotaEvaluator::mTimer |
Definition at line 63 of file ComputingQuotaEvaluator.h.