/** * Named fault profiles. Each profile is a small function that returns an * array of FaultRule, expressing operator knowledge ("S3 is bursty", * "the auth service is slow") that would otherwise live as ad-hoc * probability numbers in every consumer's chaos config. * * Profiles are intentionally simple to compose: * * import { chaos, profiles } from "chaosbringer"; * * await chaos({ * baseUrl: "http://localhost:3000", * faultInjection: [ * ...profiles.flakyThirdPartyCdn(/cdn\.example\.com/), * ...profiles.s3FivexxBurst(/s3\.amazonaws\.com/), * ], * }); * * The numeric knobs in each profile are starting points based on what the * lab has seen produce useful failures. Override anything by passing a * second `options` argument; consumers who need a wholly different shape * should compose `faults.*` directly instead. */ import { type FaultHelperOptions } from "@mizchi/playwright-faults"; import type { FaultRule, UrlMatcher } from "@mizchi/playwright-faults"; /** * Third-party CDN that is intermittently slow and occasionally drops a * request. Conservative defaults — a chaos run with this profile should * still let most pages through. */ declare function flakyThirdPartyCdn(urlPattern: UrlMatcher): FaultRule[]; /** * Object-storage 5xx burst (S3-style). Mostly 503 (rate-limit / partition), * occasional 500. Targets the kind of error pattern that causes * exponential-backoff retry storms. */ declare function s3FivexxBurst(urlPattern: UrlMatcher): FaultRule[]; /** * "A region of the dependency graph is partially degraded." Severity 0..1 * scales every knob proportionally — 0.3 is the suggested default. */ declare function regionalDegradation(opts: { urlPattern: UrlMatcher; severity?: number; }): FaultRule[]; /** * Single-dependency latency. Useful for testing that a slow auth * service doesn't block first-paint or stall every page. */ declare function slowAuthService(urlPattern: UrlMatcher, opts?: { ms?: number; rate?: number; }): FaultRule[]; /** * Mix of clean truncated bodies (200 with empty body) and outright errors. * Catches consumers that crash on JSON.parse("") or assume a non-empty * body on 200. */ declare function partialDataLoss(urlPattern: UrlMatcher, opts?: { rate?: number; }): FaultRule[]; export declare const profiles: { flakyThirdPartyCdn: typeof flakyThirdPartyCdn; s3FivexxBurst: typeof s3FivexxBurst; regionalDegradation: typeof regionalDegradation; slowAuthService: typeof slowAuthService; partialDataLoss: typeof partialDataLoss; }; export type { FaultHelperOptions }; //# sourceMappingURL=profiles.d.ts.map