next-leak 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -93208,9 +93208,6 @@ async function runLoadPhase(options) {
|
|
|
93208
93208
|
amount: options.amount,
|
|
93209
93209
|
connections: options.connections,
|
|
93210
93210
|
...options.headers !== void 0 && { headers: options.headers },
|
|
93211
|
-
...options.abandonAfterMs !== void 0 && {
|
|
93212
|
-
timeout: Math.max(Math.ceil(options.abandonAfterMs / 1e3), 1)
|
|
93213
|
-
},
|
|
93214
93211
|
...unique && { idReplacement: true }
|
|
93215
93212
|
});
|
|
93216
93213
|
const result = {
|
|
@@ -93221,8 +93218,7 @@ async function runLoadPhase(options) {
|
|
|
93221
93218
|
timeouts: raw.timeouts,
|
|
93222
93219
|
durationSeconds: raw.duration
|
|
93223
93220
|
};
|
|
93224
|
-
const
|
|
93225
|
-
const failures = Math.max(options.amount - result.ok2xx - expected, 0);
|
|
93221
|
+
const failures = Math.max(options.amount - result.ok2xx, 0);
|
|
93226
93222
|
const ratio = options.amount === 0 ? 0 : failures / options.amount;
|
|
93227
93223
|
if (ratio > (options.maxErrorRatio ?? 0.01)) {
|
|
93228
93224
|
const unanswered = failures - result.non2xx - result.errors - result.timeouts;
|
package/dist/cli.js
CHANGED
package/dist/control-client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HeapSample } from "./control-server.js";
|
|
2
|
+
declare function deadlineFor(pathname: string): number;
|
|
2
3
|
declare function request(port: number, pathname: string, deadlineMs?: number): Promise<unknown>;
|
|
3
4
|
/** Forces GC in the measured process and returns a settled memory sample. */
|
|
4
5
|
export declare function requestGc(port: number): Promise<HeapSample>;
|
|
@@ -14,4 +15,11 @@ export declare function requestSnapshot(port: number, name: string): Promise<{
|
|
|
14
15
|
}>;
|
|
15
16
|
/** Test seam: the production deadlines would make a hung-server test take minutes. */
|
|
16
17
|
export declare const requestWithDeadline: typeof request;
|
|
18
|
+
/**
|
|
19
|
+
* Test seam for the deadline table itself. A mutation run showed the mapping
|
|
20
|
+
* could quietly send `/snapshot?name=x` to the 30-second default instead of
|
|
21
|
+
* its 30-minute bound — reinstating, from the inside, the exact ceiling this
|
|
22
|
+
* client exists to remove.
|
|
23
|
+
*/
|
|
24
|
+
export declare const deadlineForOperation: typeof deadlineFor;
|
|
17
25
|
export {};
|
package/dist/index.js
CHANGED
package/dist/load.d.ts
CHANGED
|
@@ -5,12 +5,6 @@ export type LoadPhaseOptions = {
|
|
|
5
5
|
connections: number;
|
|
6
6
|
/** Sent with every request (compression, cookies, auth). */
|
|
7
7
|
headers?: Record<string, string>;
|
|
8
|
-
/**
|
|
9
|
-
* Give up on each request after this many milliseconds, emulating clients
|
|
10
|
-
* that disconnect before the response arrives. Abandoned requests are
|
|
11
|
-
* expected, so they do not count against the error budget.
|
|
12
|
-
*/
|
|
13
|
-
abandonAfterMs?: number;
|
|
14
8
|
/**
|
|
15
9
|
* Maximum tolerated ratio of non-2xx responses plus socket errors before
|
|
16
10
|
* the phase fails. A route that errors under load must fail the run, not
|