forked from alexfernandez/loadtest
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
45 lines (41 loc) · 1.21 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
declare namespace loadtest {
export function loadTest(options: LoadTestOptions, err: Function): Operation;
export interface Operation {
completedRequests: number
}
export interface LoadTestOptions {
url: string;
concurrency?: number;
maxRequests?: number;
maxSeconds?: number;
timeout?: number;
cookies?: string[];
headers?: { [headerName: string]: string };
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
body?: string | Object;
contentType?: string;
requestsPerSecond?: number;
requestGenerator?(params: any, options: any, client: any, callback: Function): any;
agentKeepAlive?: boolean;
quiet?: boolean;
indexParam?: boolean;
insecure?: boolean;
secureProtocol?: string;
statusCallback?(error: Error, result: any, latency: LoadTestResult): void;
contentInspector?(result: any): void;
indexParamCallback?(): string;
}
export interface LoadTestResult {
totalErrors: number,
totalRequests: number,
totalTimeSeconds: number,
percentiles: { [percentile: number]: number }
rps: number,
meanLatencyMs: number,
minLatencyMs: number,
maxLatencyMs: number,
errorCodes: { [statusCode: string]: number }
}
}
export = loadtest;
export as namespace loadtest;