|
|
@ -18,10 +18,12 @@
|
|
|
|
* These estimates are incremented on request acceptance and decremented on request completion (either
|
|
|
|
* These estimates are incremented on request acceptance and decremented on request completion (either
|
|
|
|
* success or failure)
|
|
|
|
* success or failure)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ADMISSIONS_CONTROL
|
|
|
|
_Atomic uint64_t admissions_control_admitted;
|
|
|
|
_Atomic uint64_t admissions_control_admitted;
|
|
|
|
uint64_t admissions_control_capacity;
|
|
|
|
uint64_t admissions_control_capacity;
|
|
|
|
|
|
|
|
const double admissions_control_overhead = 0.2;
|
|
|
|
const double admissions_control_overhead = 0.2;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
admissions_control_initialize()
|
|
|
|
admissions_control_initialize()
|
|
|
@ -93,10 +95,12 @@ admissions_control_calculate_estimate_us(uint32_t estimated_execution_us, uint32
|
|
|
|
void
|
|
|
|
void
|
|
|
|
admissions_control_log_decision(uint64_t admissions_estimate, bool admitted)
|
|
|
|
admissions_control_log_decision(uint64_t admissions_estimate, bool admitted)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifdef ADMISSIONS_CONTROL
|
|
|
|
#ifdef LOG_ADMISSIONS_CONTROL
|
|
|
|
#ifdef LOG_ADMISSIONS_CONTROL
|
|
|
|
debuglog("Admitted: %lu, Capacity: %lu, Estimate: %lu, Admitted? %s\n", admissions_control_admitted,
|
|
|
|
debuglog("Admitted: %lu, Capacity: %lu, Estimate: %lu, Admitted? %s\n", admissions_control_admitted,
|
|
|
|
admissions_control_capacity, admissions_estimate, admitted ? "yes" : "no");
|
|
|
|
admissions_control_capacity, admissions_estimate, admitted ? "yes" : "no");
|
|
|
|
#endif /* LOG_ADMISSIONS_CONTROL */
|
|
|
|
#endif /* LOG_ADMISSIONS_CONTROL */
|
|
|
|
|
|
|
|
#endif /* ADMISSIONS_CONTROL */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uint64_t
|
|
|
|
uint64_t
|
|
|
|