/** * Network fault wiring for `scenarioLoad`. Duplicates the small subset * of `crawler.ts`'s fault-route handling instead of refactoring the * crawler — the load runner has different lifetime semantics (per-context * routes, no SPA recovery dump, no traceparent injection) and forcing a * shared abstraction here would over-couple two evolving callers. */ import type { BrowserContext } from "playwright"; import type { Fault, FaultRule, FaultInjectionStats } from "../types.js"; interface CompiledRule { rule: FaultRule; pattern: RegExp; methods?: string[]; matched: number; injected: number; /** * Wall-clock timestamps (ms) at which this rule actually injected * a fault. Captured so the runner can correlate fault firings with * throughput / error dips in the timeline. Bounded only by `injected` * — at load-run scale (~thousands per rule max) the memory is trivial. */ firings: number[]; } export declare function compileLoadFaultRules(rules: ReadonlyArray | undefined): CompiledRule[]; /** * Install a single `**` route on the context that runs the compiled * fault rules. Rolls probability for each match. Stats are mutated on * the compiled rule objects — drain via `faultStatsFrom` at run end. */ export declare function installFaultRoutes(context: BrowserContext, compiled: ReadonlyArray): Promise; export declare function faultStatsFrom(compiled: ReadonlyArray): FaultInjectionStats[]; /** * Return (ruleName → wall-clock firing timestamps) for every compiled * rule, including rules that never fired (empty array). Used by the * report builder to bucket firings into the timeline. */ export declare function faultFiringsFrom(compiled: ReadonlyArray): Record; export {}; //# sourceMappingURL=fault-routes.d.ts.map