/** * What the Receiver's regulator passes of a service that a run writes a total * for (config pipelines/run/receive/rate/rate-object-cap.js 226-283, commit * 63d77a7): lines under the per-statement limit and each statement's first * `baselineCount` lines fill the total; past it the service still passes at * most BASELINE_MAX_OVER_TOTAL_DEFAULT sample lines, and then * KEEP_MAX_OVER_TOTAL_DEFAULT keep-count lines of its error statements, per * node per window. A sample line past its bound takes the keep count next. * * The run writes the lines under the limit as the total, so a service keeps * its total plus the floor past it. */ /** One statement of a service, summed over its nodes: units an hour (bytes or lines) and lines an hour. */ export interface PassStatement { rate: number; lines: number; error: boolean; } /** * Each ask's share of at most `max`: every ask in full when they fit or `max` * is 0 (no bound), else shared evenly with no ask given more than it asked. */ export declare function sharePastTotal(asks: readonly number[], max: number): number[]; /** * One service at the per-statement limit `level` (units an hour, all nodes): * the total the run writes and what the service keeps, in units an hour. */ export declare function servicePass(sts: readonly PassStatement[], level: number, o: { windowsPerHour: number; nodes: number; keepCount: number; }): { total: number; kept: number; }; /** The level at which `keptAt` (non-decreasing) equals the allowance; undefined when keptAt(0) exceeds it. */ export declare function levelFor(keptAt: (level: number) => number, allowance: number, hi: number): number | undefined; /** The floor past a service's total, in words, for the run reports. */ export declare function pastTotalWords(keepCount: number): string;