@durable-streams/client-conformance-tests 0.1.1 → 0.1.2
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.
- package/dist/adapters/typescript-adapter.cjs +588 -0
- package/dist/adapters/typescript-adapter.d.cts +1 -0
- package/dist/benchmark-runner-CLAR9oLd.cjs +1400 -0
- package/dist/chunk-BCwAaXi7.cjs +31 -0
- package/dist/cli.cjs +266 -0
- package/dist/cli.d.cts +1 -0
- package/dist/index.cjs +22 -0
- package/dist/index.d.cts +508 -0
- package/dist/protocol-3cf94Xyb.d.cts +472 -0
- package/dist/protocol-XeAOKBD-.cjs +175 -0
- package/dist/protocol.cjs +11 -0
- package/dist/protocol.d.cts +2 -0
- package/package.json +51 -36
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import { AppendCommand, AppendResult, BenchmarkAppendOp, BenchmarkCommand, BenchmarkCreateOp, BenchmarkOperation, BenchmarkReadOp, BenchmarkResult, BenchmarkRoundtripOp, BenchmarkStats, BenchmarkThroughputAppendOp, BenchmarkThroughputReadOp, ClearDynamicCommand, ClearDynamicResult, ConnectCommand, ConnectResult, CreateCommand, CreateResult, DeleteCommand, DeleteResult, ErrorCode, ErrorCodes, ErrorResult, HeadCommand, HeadResult, InitCommand, InitResult, ReadChunk, ReadCommand, ReadResult, SetDynamicHeaderCommand, SetDynamicHeaderResult, SetDynamicParamCommand, SetDynamicParamResult, ShutdownCommand, ShutdownResult, TestCommand, TestResult, calculateStats, decodeBase64, encodeBase64, formatStats, parseCommand, parseResult, serializeCommand, serializeResult } from "./protocol-3cf94Xyb.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/test-cases.d.ts
|
|
4
|
+
interface TestSuite {
|
|
5
|
+
/** Unique identifier for this suite */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Human-readable name */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Description of what this suite tests */
|
|
10
|
+
description: string;
|
|
11
|
+
/** Category: producer, consumer, or lifecycle */
|
|
12
|
+
category: `producer` | `consumer` | `lifecycle`;
|
|
13
|
+
/** Tags for filtering tests */
|
|
14
|
+
tags?: Array<string>;
|
|
15
|
+
/** Required client features for all tests in this suite */
|
|
16
|
+
requires?: Array<ClientFeature>;
|
|
17
|
+
/** Test cases in this suite */
|
|
18
|
+
tests: Array<TestCase>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A single test case with operations and expectations.
|
|
22
|
+
*/
|
|
23
|
+
interface TestCase {
|
|
24
|
+
/** Unique identifier within the suite */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Human-readable name */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Description of what this test verifies */
|
|
29
|
+
description?: string;
|
|
30
|
+
/** Tags for filtering */
|
|
31
|
+
tags?: Array<string>;
|
|
32
|
+
/** Skip this test (with optional reason) */
|
|
33
|
+
skip?: boolean | string;
|
|
34
|
+
/** Required client features for this test */
|
|
35
|
+
requires?: Array<ClientFeature>;
|
|
36
|
+
/** Setup operations to run before the test */
|
|
37
|
+
setup?: Array<TestOperation>;
|
|
38
|
+
/** Test operations to execute */
|
|
39
|
+
operations: Array<TestOperation>;
|
|
40
|
+
/** Cleanup operations to run after the test */
|
|
41
|
+
cleanup?: Array<TestOperation>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Client features that may be required for certain tests.
|
|
45
|
+
*/
|
|
46
|
+
type ClientFeature = `batching` | `sse` | `long-poll` | `streaming` | `dynamicHeaders`;
|
|
47
|
+
/**
|
|
48
|
+
* Create a stream.
|
|
49
|
+
*/
|
|
50
|
+
interface CreateOperation {
|
|
51
|
+
action: `create`;
|
|
52
|
+
/** Stream path (a unique path will be generated if not specified) */
|
|
53
|
+
path?: string;
|
|
54
|
+
/** Variable name to store the generated path */
|
|
55
|
+
as?: string;
|
|
56
|
+
/** Content type */
|
|
57
|
+
contentType?: string;
|
|
58
|
+
/** TTL in seconds */
|
|
59
|
+
ttlSeconds?: number;
|
|
60
|
+
/** Absolute expiry (ISO 8601) */
|
|
61
|
+
expiresAt?: string;
|
|
62
|
+
/** Custom headers */
|
|
63
|
+
headers?: Record<string, string>;
|
|
64
|
+
/** Expected result */
|
|
65
|
+
expect?: CreateExpectation;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Connect to an existing stream.
|
|
69
|
+
*/
|
|
70
|
+
interface ConnectOperation {
|
|
71
|
+
action: `connect`;
|
|
72
|
+
/** Stream path or variable reference like ${streamPath} */
|
|
73
|
+
path: string;
|
|
74
|
+
headers?: Record<string, string>;
|
|
75
|
+
expect?: ConnectExpectation;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Append data to a stream.
|
|
79
|
+
*/
|
|
80
|
+
interface AppendOperation {
|
|
81
|
+
action: `append`;
|
|
82
|
+
/** Stream path or variable reference */
|
|
83
|
+
path: string;
|
|
84
|
+
/** Data to append (string) */
|
|
85
|
+
data?: string;
|
|
86
|
+
/** Binary data (base64 encoded) */
|
|
87
|
+
binaryData?: string;
|
|
88
|
+
/** Sequence number for ordering */
|
|
89
|
+
seq?: number;
|
|
90
|
+
headers?: Record<string, string>;
|
|
91
|
+
expect?: AppendExpectation;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Append multiple items (tests batching behavior).
|
|
95
|
+
*/
|
|
96
|
+
interface AppendBatchOperation {
|
|
97
|
+
action: `append-batch`;
|
|
98
|
+
path: string;
|
|
99
|
+
/** Items to append concurrently */
|
|
100
|
+
items: Array<{
|
|
101
|
+
data?: string;
|
|
102
|
+
binaryData?: string;
|
|
103
|
+
seq?: number;
|
|
104
|
+
}>;
|
|
105
|
+
headers?: Record<string, string>;
|
|
106
|
+
expect?: AppendBatchExpectation;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Read from a stream.
|
|
110
|
+
*/
|
|
111
|
+
interface ReadOperation {
|
|
112
|
+
action: `read`;
|
|
113
|
+
path: string;
|
|
114
|
+
/** Starting offset or variable reference like ${lastOffset} */
|
|
115
|
+
offset?: string;
|
|
116
|
+
/** Live mode */
|
|
117
|
+
live?: false | `long-poll` | `sse`;
|
|
118
|
+
/** Timeout for long-poll in ms */
|
|
119
|
+
timeoutMs?: number;
|
|
120
|
+
/** Maximum chunks to read */
|
|
121
|
+
maxChunks?: number;
|
|
122
|
+
/** Wait until up-to-date */
|
|
123
|
+
waitForUpToDate?: boolean;
|
|
124
|
+
headers?: Record<string, string>;
|
|
125
|
+
expect?: ReadExpectation;
|
|
126
|
+
/** Run in background (don't wait for completion) */
|
|
127
|
+
background?: boolean;
|
|
128
|
+
/** Store reference for later await (required if background: true) */
|
|
129
|
+
as?: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get stream metadata.
|
|
133
|
+
*/
|
|
134
|
+
interface HeadOperation {
|
|
135
|
+
action: `head`;
|
|
136
|
+
path: string;
|
|
137
|
+
headers?: Record<string, string>;
|
|
138
|
+
expect?: HeadExpectation;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Delete a stream.
|
|
142
|
+
*/
|
|
143
|
+
interface DeleteOperation {
|
|
144
|
+
action: `delete`;
|
|
145
|
+
path: string;
|
|
146
|
+
headers?: Record<string, string>;
|
|
147
|
+
expect?: DeleteExpectation;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Wait for a duration (for timing-sensitive tests).
|
|
151
|
+
*/
|
|
152
|
+
interface WaitOperation {
|
|
153
|
+
action: `wait`;
|
|
154
|
+
/** Duration in milliseconds */
|
|
155
|
+
ms: number;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Store a value in a variable for later use.
|
|
159
|
+
*/
|
|
160
|
+
interface SetOperation {
|
|
161
|
+
action: `set`;
|
|
162
|
+
/** Variable name */
|
|
163
|
+
name: string;
|
|
164
|
+
/** Value (can reference other variables) */
|
|
165
|
+
value: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Assert a condition using structured assertions (no eval).
|
|
169
|
+
*/
|
|
170
|
+
interface AssertOperation {
|
|
171
|
+
action: `assert`;
|
|
172
|
+
/** Check that two values are equal */
|
|
173
|
+
equals?: {
|
|
174
|
+
left: string;
|
|
175
|
+
right: string;
|
|
176
|
+
};
|
|
177
|
+
/** Check that two values are not equal */
|
|
178
|
+
notEquals?: {
|
|
179
|
+
left: string;
|
|
180
|
+
right: string;
|
|
181
|
+
};
|
|
182
|
+
/** Check that a string contains a substring */
|
|
183
|
+
contains?: {
|
|
184
|
+
value: string;
|
|
185
|
+
substring: string;
|
|
186
|
+
};
|
|
187
|
+
/** Check that a value matches a regex pattern */
|
|
188
|
+
matches?: {
|
|
189
|
+
value: string;
|
|
190
|
+
pattern: string;
|
|
191
|
+
};
|
|
192
|
+
/** Message if assertion fails */
|
|
193
|
+
message?: string;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Append to stream via direct server HTTP (bypasses client adapter).
|
|
197
|
+
* Used for concurrent operations when adapter is blocked on a read.
|
|
198
|
+
*/
|
|
199
|
+
interface ServerAppendOperation {
|
|
200
|
+
action: `server-append`;
|
|
201
|
+
path: string;
|
|
202
|
+
data: string;
|
|
203
|
+
headers?: Record<string, string>;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Wait for a background operation to complete.
|
|
207
|
+
*/
|
|
208
|
+
interface AwaitOperation {
|
|
209
|
+
action: `await`;
|
|
210
|
+
/** Reference to the background operation (from 'as' field) */
|
|
211
|
+
ref: string;
|
|
212
|
+
expect?: ReadExpectation;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Inject an error to be returned on the next N requests to a path.
|
|
216
|
+
* Used for testing retry/resilience behavior.
|
|
217
|
+
*/
|
|
218
|
+
interface InjectErrorOperation {
|
|
219
|
+
action: `inject-error`;
|
|
220
|
+
/** Stream path to inject error for */
|
|
221
|
+
path: string;
|
|
222
|
+
/** HTTP status code to return */
|
|
223
|
+
status: number;
|
|
224
|
+
/** Number of times to return this error (default: 1) */
|
|
225
|
+
count?: number;
|
|
226
|
+
/** Optional Retry-After header value (seconds) */
|
|
227
|
+
retryAfter?: number;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Clear all injected errors.
|
|
231
|
+
*/
|
|
232
|
+
interface ClearErrorsOperation {
|
|
233
|
+
action: `clear-errors`;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Set a dynamic header that is evaluated per-request.
|
|
237
|
+
* Useful for testing token refresh scenarios.
|
|
238
|
+
*/
|
|
239
|
+
interface SetDynamicHeaderOperation {
|
|
240
|
+
action: `set-dynamic-header`;
|
|
241
|
+
/** Header name */
|
|
242
|
+
name: string;
|
|
243
|
+
/** Type of dynamic value */
|
|
244
|
+
valueType: `counter` | `timestamp` | `token`;
|
|
245
|
+
/** Initial value (for token type) */
|
|
246
|
+
initialValue?: string;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Set a dynamic URL parameter that is evaluated per-request.
|
|
250
|
+
*/
|
|
251
|
+
interface SetDynamicParamOperation {
|
|
252
|
+
action: `set-dynamic-param`;
|
|
253
|
+
/** Param name */
|
|
254
|
+
name: string;
|
|
255
|
+
/** Type of dynamic value */
|
|
256
|
+
valueType: `counter` | `timestamp`;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Clear all dynamic headers and params.
|
|
260
|
+
*/
|
|
261
|
+
interface ClearDynamicOperation {
|
|
262
|
+
action: `clear-dynamic`;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* All possible test operations.
|
|
266
|
+
*/
|
|
267
|
+
type TestOperation = CreateOperation | ConnectOperation | AppendOperation | AppendBatchOperation | ReadOperation | HeadOperation | DeleteOperation | WaitOperation | SetOperation | AssertOperation | ServerAppendOperation | AwaitOperation | InjectErrorOperation | ClearErrorsOperation | SetDynamicHeaderOperation | SetDynamicParamOperation | ClearDynamicOperation;
|
|
268
|
+
/**
|
|
269
|
+
* Base expectation fields.
|
|
270
|
+
*/
|
|
271
|
+
interface BaseExpectation {
|
|
272
|
+
/** Expected HTTP status code */
|
|
273
|
+
status?: number;
|
|
274
|
+
/** Expected error code (if operation should fail) */
|
|
275
|
+
errorCode?: string;
|
|
276
|
+
/** Store result in variable */
|
|
277
|
+
storeAs?: string;
|
|
278
|
+
}
|
|
279
|
+
interface CreateExpectation extends BaseExpectation {
|
|
280
|
+
/** Status should be 201 for new, 200 for existing */
|
|
281
|
+
status?: 200 | 201 | 409 | number;
|
|
282
|
+
}
|
|
283
|
+
interface ConnectExpectation extends BaseExpectation {
|
|
284
|
+
status?: 200 | 404 | number;
|
|
285
|
+
}
|
|
286
|
+
interface AppendExpectation extends BaseExpectation {
|
|
287
|
+
status?: 200 | 404 | 409 | number;
|
|
288
|
+
/** Store the returned offset */
|
|
289
|
+
storeOffsetAs?: string;
|
|
290
|
+
/** Expected headers that were sent (for dynamic header testing) */
|
|
291
|
+
headersSent?: Record<string, string>;
|
|
292
|
+
/** Expected params that were sent (for dynamic param testing) */
|
|
293
|
+
paramsSent?: Record<string, string>;
|
|
294
|
+
}
|
|
295
|
+
interface AppendBatchExpectation extends BaseExpectation {
|
|
296
|
+
/** All items should succeed */
|
|
297
|
+
allSucceed?: boolean;
|
|
298
|
+
/** Specific items should succeed (by index) */
|
|
299
|
+
succeedIndices?: Array<number>;
|
|
300
|
+
/** Specific items should fail (by index) */
|
|
301
|
+
failIndices?: Array<number>;
|
|
302
|
+
}
|
|
303
|
+
interface ReadExpectation extends BaseExpectation {
|
|
304
|
+
status?: 200 | 204 | 404 | number;
|
|
305
|
+
/** Expected data content (exact match) */
|
|
306
|
+
data?: string;
|
|
307
|
+
/** Expected data to contain (substring) */
|
|
308
|
+
dataContains?: string;
|
|
309
|
+
/** Expected data to contain all of these substrings */
|
|
310
|
+
dataContainsAll?: Array<string>;
|
|
311
|
+
/** Expected number of chunks */
|
|
312
|
+
chunkCount?: number;
|
|
313
|
+
/** Minimum number of chunks */
|
|
314
|
+
minChunks?: number;
|
|
315
|
+
/** Maximum number of chunks */
|
|
316
|
+
maxChunks?: number;
|
|
317
|
+
/** Should be up-to-date after read */
|
|
318
|
+
upToDate?: boolean;
|
|
319
|
+
/** Store final offset */
|
|
320
|
+
storeOffsetAs?: string;
|
|
321
|
+
/** Store all data concatenated */
|
|
322
|
+
storeDataAs?: string;
|
|
323
|
+
/** Expected headers that were sent (for dynamic header testing) */
|
|
324
|
+
headersSent?: Record<string, string>;
|
|
325
|
+
/** Expected params that were sent (for dynamic param testing) */
|
|
326
|
+
paramsSent?: Record<string, string>;
|
|
327
|
+
}
|
|
328
|
+
interface HeadExpectation extends BaseExpectation {
|
|
329
|
+
status?: 200 | 404 | number;
|
|
330
|
+
/** Expected content type */
|
|
331
|
+
contentType?: string;
|
|
332
|
+
/** Should have an offset */
|
|
333
|
+
hasOffset?: boolean;
|
|
334
|
+
}
|
|
335
|
+
interface DeleteExpectation extends BaseExpectation {
|
|
336
|
+
status?: 200 | 204 | 404 | number;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Load all test suites from a directory.
|
|
340
|
+
*/
|
|
341
|
+
declare function loadTestSuites(dir: string): Array<TestSuite>;
|
|
342
|
+
/**
|
|
343
|
+
* Load test suites from the embedded test-cases directory.
|
|
344
|
+
*/
|
|
345
|
+
declare function loadEmbeddedTestSuites(): Array<TestSuite>;
|
|
346
|
+
/**
|
|
347
|
+
* Filter test suites by category.
|
|
348
|
+
*/
|
|
349
|
+
declare function filterByCategory(suites: Array<TestSuite>, category: TestSuite[`category`]): Array<TestSuite>;
|
|
350
|
+
/**
|
|
351
|
+
* Filter test cases by tags.
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Get total test count.
|
|
356
|
+
*/
|
|
357
|
+
declare function countTests(suites: Array<TestSuite>): number; //#endregion
|
|
358
|
+
//#region src/runner.d.ts
|
|
359
|
+
interface RunnerOptions {
|
|
360
|
+
/** Path to client adapter executable, or "ts" for built-in TypeScript adapter */
|
|
361
|
+
clientAdapter: string;
|
|
362
|
+
/** Arguments to pass to client adapter */
|
|
363
|
+
clientArgs?: Array<string>;
|
|
364
|
+
/** Test suites to run (default: all) */
|
|
365
|
+
suites?: Array<`producer` | `consumer` | `lifecycle`>;
|
|
366
|
+
/** Tags to filter tests */
|
|
367
|
+
tags?: Array<string>;
|
|
368
|
+
/** Verbose output */
|
|
369
|
+
verbose?: boolean;
|
|
370
|
+
/** Stop on first failure */
|
|
371
|
+
failFast?: boolean;
|
|
372
|
+
/** Timeout for each test in ms */
|
|
373
|
+
testTimeout?: number;
|
|
374
|
+
/** Port for reference server (0 for random) */
|
|
375
|
+
serverPort?: number;
|
|
376
|
+
}
|
|
377
|
+
interface TestRunResult {
|
|
378
|
+
suite: string;
|
|
379
|
+
test: string;
|
|
380
|
+
passed: boolean;
|
|
381
|
+
duration: number;
|
|
382
|
+
error?: string;
|
|
383
|
+
skipped?: boolean;
|
|
384
|
+
skipReason?: string;
|
|
385
|
+
}
|
|
386
|
+
interface RunSummary {
|
|
387
|
+
total: number;
|
|
388
|
+
passed: number;
|
|
389
|
+
failed: number;
|
|
390
|
+
skipped: number;
|
|
391
|
+
duration: number;
|
|
392
|
+
results: Array<TestRunResult>;
|
|
393
|
+
}
|
|
394
|
+
declare function runConformanceTests(options: RunnerOptions): Promise<RunSummary>;
|
|
395
|
+
|
|
396
|
+
//#endregion
|
|
397
|
+
//#region src/benchmark-scenarios.d.ts
|
|
398
|
+
interface BenchmarkScenario {
|
|
399
|
+
/** Unique scenario ID */
|
|
400
|
+
id: string;
|
|
401
|
+
/** Human-readable name */
|
|
402
|
+
name: string;
|
|
403
|
+
/** Description */
|
|
404
|
+
description: string;
|
|
405
|
+
/** Category for grouping */
|
|
406
|
+
category: `latency` | `throughput` | `streaming`;
|
|
407
|
+
/** Required client features */
|
|
408
|
+
requires?: Array<`batching` | `sse` | `longPoll` | `streaming`>;
|
|
409
|
+
/** Scenario configuration */
|
|
410
|
+
config: BenchmarkScenarioConfig;
|
|
411
|
+
/** Success criteria */
|
|
412
|
+
criteria?: BenchmarkCriteria;
|
|
413
|
+
/** Factory to create benchmark operations for each iteration */
|
|
414
|
+
createOperation: (ctx: ScenarioContext) => BenchmarkOperation;
|
|
415
|
+
/** Optional setup before running iterations */
|
|
416
|
+
setup?: (ctx: ScenarioContext) => Promise<SetupResult>;
|
|
417
|
+
/** Optional cleanup after running iterations */
|
|
418
|
+
cleanup?: (ctx: ScenarioContext) => Promise<void>;
|
|
419
|
+
}
|
|
420
|
+
interface BenchmarkScenarioConfig {
|
|
421
|
+
/** Number of warmup iterations (not measured) */
|
|
422
|
+
warmupIterations: number;
|
|
423
|
+
/** Number of measured iterations */
|
|
424
|
+
measureIterations: number;
|
|
425
|
+
/** Message size in bytes (where applicable) */
|
|
426
|
+
messageSize: number;
|
|
427
|
+
/** Concurrency level (for throughput tests) */
|
|
428
|
+
concurrency?: number;
|
|
429
|
+
}
|
|
430
|
+
interface BenchmarkCriteria {
|
|
431
|
+
/** Maximum acceptable p50 latency in ms */
|
|
432
|
+
maxP50Ms?: number;
|
|
433
|
+
/** Maximum acceptable p99 latency in ms */
|
|
434
|
+
maxP99Ms?: number;
|
|
435
|
+
/** Minimum throughput in operations/second */
|
|
436
|
+
minOpsPerSecond?: number;
|
|
437
|
+
/** Minimum throughput in MB/second */
|
|
438
|
+
minMBPerSecond?: number;
|
|
439
|
+
}
|
|
440
|
+
interface ScenarioContext {
|
|
441
|
+
/** Base path for streams (unique per scenario run) */
|
|
442
|
+
basePath: string;
|
|
443
|
+
/** Current iteration number (0-based) */
|
|
444
|
+
iteration: number;
|
|
445
|
+
/** Stored values from setup */
|
|
446
|
+
setupData: Record<string, unknown>;
|
|
447
|
+
}
|
|
448
|
+
interface SetupResult {
|
|
449
|
+
/** Data to pass to each iteration */
|
|
450
|
+
data?: Record<string, unknown>;
|
|
451
|
+
}
|
|
452
|
+
declare const allScenarios: Array<BenchmarkScenario>;
|
|
453
|
+
declare const scenariosByCategory: Record<`latency` | `throughput` | `streaming`, Array<BenchmarkScenario>>;
|
|
454
|
+
declare function getScenarioById(id: string): BenchmarkScenario | undefined;
|
|
455
|
+
declare function getScenariosByCategory(category: `latency` | `throughput` | `streaming`): Array<BenchmarkScenario>;
|
|
456
|
+
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region src/benchmark-runner.d.ts
|
|
459
|
+
interface BenchmarkRunnerOptions {
|
|
460
|
+
/** Path to client adapter executable, or "ts" for built-in TypeScript adapter */
|
|
461
|
+
clientAdapter: string;
|
|
462
|
+
/** Arguments to pass to client adapter */
|
|
463
|
+
clientArgs?: Array<string>;
|
|
464
|
+
/** Specific scenarios to run (default: all) */
|
|
465
|
+
scenarios?: Array<string>;
|
|
466
|
+
/** Categories to run (default: all) */
|
|
467
|
+
categories?: Array<`latency` | `throughput` | `streaming`>;
|
|
468
|
+
/** Verbose output */
|
|
469
|
+
verbose?: boolean;
|
|
470
|
+
/** Port for reference server (0 for random) */
|
|
471
|
+
serverPort?: number;
|
|
472
|
+
/** Output format */
|
|
473
|
+
format?: `console` | `json` | `markdown`;
|
|
474
|
+
}
|
|
475
|
+
interface ScenarioResult {
|
|
476
|
+
scenario: BenchmarkScenario;
|
|
477
|
+
stats: BenchmarkStats;
|
|
478
|
+
criteriaMet: boolean;
|
|
479
|
+
criteriaDetails: Array<CriteriaResult>;
|
|
480
|
+
skipped: boolean;
|
|
481
|
+
skipReason?: string;
|
|
482
|
+
error?: string;
|
|
483
|
+
/** Computed ops/sec for throughput scenarios */
|
|
484
|
+
opsPerSec?: number;
|
|
485
|
+
/** Computed MB/sec for throughput scenarios */
|
|
486
|
+
mbPerSec?: number;
|
|
487
|
+
}
|
|
488
|
+
interface CriteriaResult {
|
|
489
|
+
criterion: string;
|
|
490
|
+
met: boolean;
|
|
491
|
+
actual: number;
|
|
492
|
+
expected: number;
|
|
493
|
+
}
|
|
494
|
+
interface BenchmarkSummary {
|
|
495
|
+
adapter: string;
|
|
496
|
+
adapterVersion: string;
|
|
497
|
+
serverUrl: string;
|
|
498
|
+
timestamp: string;
|
|
499
|
+
duration: number;
|
|
500
|
+
results: Array<ScenarioResult>;
|
|
501
|
+
passed: number;
|
|
502
|
+
failed: number;
|
|
503
|
+
skipped: number;
|
|
504
|
+
}
|
|
505
|
+
declare function runBenchmarks(options: BenchmarkRunnerOptions): Promise<BenchmarkSummary>;
|
|
506
|
+
|
|
507
|
+
//#endregion
|
|
508
|
+
export { AppendCommand, AppendResult, BenchmarkAppendOp, BenchmarkCommand, BenchmarkCreateOp, BenchmarkCriteria, BenchmarkOperation, BenchmarkReadOp, BenchmarkResult, BenchmarkRoundtripOp, BenchmarkRunnerOptions, BenchmarkScenario, BenchmarkScenarioConfig, BenchmarkStats, BenchmarkSummary, BenchmarkThroughputAppendOp, BenchmarkThroughputReadOp, ClearDynamicCommand, ClearDynamicResult, ClientFeature, ConnectCommand, ConnectResult, CreateCommand, CreateResult, DeleteCommand, DeleteResult, ErrorCode, ErrorCodes, ErrorResult, HeadCommand, HeadResult, InitCommand, InitResult, ReadChunk, ReadCommand, ReadResult, RunSummary, RunnerOptions, ScenarioContext, ScenarioResult, SetDynamicHeaderCommand, SetDynamicHeaderResult, SetDynamicParamCommand, SetDynamicParamResult, ShutdownCommand, ShutdownResult, TestCase, TestCommand, TestOperation, TestResult, TestRunResult, TestSuite, allScenarios, calculateStats, countTests, decodeBase64, encodeBase64, filterByCategory, formatStats, getScenarioById, getScenariosByCategory, loadEmbeddedTestSuites, loadTestSuites, parseCommand, parseResult, runBenchmarks, runConformanceTests, scenariosByCategory, serializeCommand, serializeResult };
|