feat(seats): a pass's share of the windows by the run's effort, the weekly cutoff at 99 %
The 5-hour share of a running pass was a flat 0.25 points; it follows the run's effort now, as the weekly share already did: 0.5 at max and any other effort, 0.125 at xhigh - the pooled means of 5438 Opus 5.5 passes on 141 seat-runs (2026-10-12..15), rounded up. The weekly cutoff moves from 95 % to 99 %: the weekly window is the budget the lenses run out of, and with the running passes projected against the cutoff the last percent is spent a pass at a time, not in a burst. REVIEW_GATES_LENS_COST_PCT and REVIEW_GATES_LENS_COST_7D_PCT still override every effort.
This commit is contained in:
parent
51bdd6298a
commit
ea4d362a10
8 changed files with 44 additions and 31 deletions
|
|
@ -518,10 +518,10 @@ namespace Crafter::Review::SeatPool {
|
|||
return n && !Dyn::Strip(text).empty() && std::isfinite(*n) && *n >= 0 ? *n : fallback;
|
||||
}
|
||||
|
||||
// A pass's share of the weekly window, as measured: 0.04 at xhigh,
|
||||
// 0.125 at max and for any other effort.
|
||||
// A pass's share of the weekly window: the config's, else the max
|
||||
// figure.
|
||||
double Cost7d(const Json& config) {
|
||||
return Dyn::Has(config, "lensCost7dPct") ? AsDouble(config.at("lensCost7dPct")) : 0.125;
|
||||
return Dyn::Has(config, "lensCost7dPct") ? AsDouble(config.at("lensCost7dPct")) : LensCost7dPct({});
|
||||
}
|
||||
|
||||
// The weekly window with the passes in flight and this one projected
|
||||
|
|
@ -540,8 +540,8 @@ namespace Crafter::Review::SeatPool {
|
|||
|
||||
Json PoolConfig(const std::map<std::string, std::string>& env, std::string_view effort) {
|
||||
Json config = Seats::ConfigFromEnv(env);
|
||||
if (Dyn::Strip(EnvOf(env, "REVIEW_GATES_LENS_COST_PCT")).empty()) config["lensCostPct"] = 0.25;
|
||||
config["lensCost7dPct"] = EnvNumber(env, "REVIEW_GATES_LENS_COST_7D_PCT", effort == "xhigh" ? 0.04 : 0.125);
|
||||
if (Dyn::Strip(EnvOf(env, "REVIEW_GATES_LENS_COST_PCT")).empty()) config["lensCostPct"] = LensCostPct(effort);
|
||||
config["lensCost7dPct"] = EnvNumber(env, "REVIEW_GATES_LENS_COST_7D_PCT", LensCost7dPct(effort));
|
||||
config["oauthConcurrency"] = static_cast<std::int64_t>(EnvNumber(env, "REVIEW_GATES_OAUTH_CONCURRENCY", static_cast<double>(OauthConcurrency)));
|
||||
return config;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue