@loadstrike/loadstrike-sdk 1.0.30001 → 1.0.30401
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/README.md +24 -0
- package/dist/cjs/cluster.js +2417 -7
- package/dist/cjs/index.js +13 -2
- package/dist/cjs/iteration-observations.js +711 -0
- package/dist/cjs/load-engine-v2.js +966 -0
- package/dist/cjs/local.js +73 -20
- package/dist/cjs/reporting.js +123 -13
- package/dist/cjs/runtime.js +2368 -129
- package/dist/cjs/sinks.js +471 -17
- package/dist/cjs/transports.js +84 -146
- package/dist/esm/cluster.js +2386 -7
- package/dist/esm/index.js +1 -0
- package/dist/esm/iteration-observations.js +698 -0
- package/dist/esm/load-engine-v2.js +942 -0
- package/dist/esm/local.js +73 -20
- package/dist/esm/reporting.js +123 -13
- package/dist/esm/runtime.js +2369 -130
- package/dist/esm/sinks.js +471 -17
- package/dist/esm/transports.js +84 -146
- package/dist/types/cluster.d.ts +379 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/iteration-observations.d.ts +225 -0
- package/dist/types/load-engine-v2.d.ts +147 -0
- package/dist/types/runtime.d.ts +214 -8
- package/dist/types/sinks.d.ts +67 -0
- package/dist/types/transports.d.ts +2 -8
- package/package.json +3 -4
package/dist/types/runtime.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { type ClusterNodeResult } from "./cluster.js";
|
|
1
|
+
import { type ClusterNodeResult, type LoadEngineV2PlanInput } from "./cluster.js";
|
|
2
2
|
import { RedisCorrelationStore, RedisCorrelationStoreOptions, TrackingFieldSelector, type TrackingPayload } from "./correlation.js";
|
|
3
3
|
import { type EndpointAdapter, type EndpointDefinition } from "./transports.js";
|
|
4
|
+
import { LoadEngineV2ExecutionBudget, type LoadEngineV2DistributionRecord, type LoadStrikeHistogramV1Sidecar } from "./load-engine-v2.js";
|
|
5
|
+
import { type LoadStrikeIterationObservationBatchV1, type LoadStrikeIterationObservationStreamCompletionV1, type LoadStrikeIterationStepObservationV1, type LoadStrikeObservationDeliveryStats } from "./iteration-observations.js";
|
|
6
|
+
declare const LOAD_ENGINE_V2_SCHEDULER_DISTRIBUTIONS: unique symbol;
|
|
4
7
|
export declare const LoadStrikeNodeType: {
|
|
5
8
|
readonly SingleNode: "SingleNode";
|
|
6
9
|
readonly Coordinator: "Coordinator";
|
|
@@ -154,6 +157,7 @@ export interface LoadStrikeRequestStats {
|
|
|
154
157
|
}
|
|
155
158
|
export interface LoadStrikeDataTransferStats {
|
|
156
159
|
allBytes: number;
|
|
160
|
+
allBytes64?: string;
|
|
157
161
|
maxBytes: number;
|
|
158
162
|
meanBytes: number;
|
|
159
163
|
minBytes: number;
|
|
@@ -161,8 +165,10 @@ export interface LoadStrikeDataTransferStats {
|
|
|
161
165
|
percent75: number;
|
|
162
166
|
percent95: number;
|
|
163
167
|
percent99: number;
|
|
168
|
+
percent100?: number;
|
|
164
169
|
stdDev: number;
|
|
165
170
|
readonly AllBytes?: number;
|
|
171
|
+
readonly AllBytes64?: string;
|
|
166
172
|
readonly MaxBytes?: number;
|
|
167
173
|
readonly MeanBytes?: number;
|
|
168
174
|
readonly MinBytes?: number;
|
|
@@ -170,6 +176,7 @@ export interface LoadStrikeDataTransferStats {
|
|
|
170
176
|
readonly Percent75?: number;
|
|
171
177
|
readonly Percent95?: number;
|
|
172
178
|
readonly Percent99?: number;
|
|
179
|
+
readonly Percent100?: number;
|
|
173
180
|
readonly StdDev?: number;
|
|
174
181
|
}
|
|
175
182
|
export interface LoadStrikeLatencyCount {
|
|
@@ -189,6 +196,7 @@ export interface LoadStrikeLatencyStats {
|
|
|
189
196
|
percent75: number;
|
|
190
197
|
percent95: number;
|
|
191
198
|
percent99: number;
|
|
199
|
+
percent100?: number;
|
|
192
200
|
stdDev: number;
|
|
193
201
|
readonly LatencyCount?: LoadStrikeLatencyCount;
|
|
194
202
|
readonly MaxMs?: number;
|
|
@@ -198,6 +206,7 @@ export interface LoadStrikeLatencyStats {
|
|
|
198
206
|
readonly Percent75?: number;
|
|
199
207
|
readonly Percent95?: number;
|
|
200
208
|
readonly Percent99?: number;
|
|
209
|
+
readonly Percent100?: number;
|
|
201
210
|
readonly StdDev?: number;
|
|
202
211
|
}
|
|
203
212
|
export interface LoadStrikeStatusCodeStats {
|
|
@@ -213,11 +222,26 @@ export interface LoadStrikeStatusCodeStats {
|
|
|
213
222
|
readonly StatusCode?: string;
|
|
214
223
|
}
|
|
215
224
|
export interface LoadStrikeMeasurementStats {
|
|
225
|
+
count64?: string;
|
|
226
|
+
distributionMode?: "exact-normalized" | "quantized-v1" | string;
|
|
227
|
+
maxRelativeError?: number;
|
|
228
|
+
/** @internal Mergeable V2 distribution state used by cluster result owners. */
|
|
229
|
+
histogramSidecar?: {
|
|
230
|
+
latency: LoadStrikeHistogramV1Sidecar;
|
|
231
|
+
size: LoadStrikeHistogramV1Sidecar;
|
|
232
|
+
allBytes64: string;
|
|
233
|
+
lessOrEq80064: string;
|
|
234
|
+
more800Less120064: string;
|
|
235
|
+
moreOrEq120064: string;
|
|
236
|
+
};
|
|
216
237
|
dataTransfer: LoadStrikeDataTransferStats;
|
|
217
238
|
latency: LoadStrikeLatencyStats;
|
|
218
239
|
request: LoadStrikeRequestStats;
|
|
219
240
|
statusCodes: LoadStrikeStatusCodeStats[];
|
|
220
241
|
readonly DataTransfer?: LoadStrikeDataTransferStats;
|
|
242
|
+
readonly Count64?: string;
|
|
243
|
+
readonly DistributionMode?: string;
|
|
244
|
+
readonly MaxRelativeError?: number;
|
|
221
245
|
readonly Latency?: LoadStrikeLatencyStats;
|
|
222
246
|
readonly Request?: LoadStrikeRequestStats;
|
|
223
247
|
readonly StatusCodes?: LoadStrikeStatusCodeStats[];
|
|
@@ -290,6 +314,55 @@ export declare class LoadStrikePluginData {
|
|
|
290
314
|
get Hints(): string[];
|
|
291
315
|
get Tables(): LoadStrikePluginDataTable[];
|
|
292
316
|
}
|
|
317
|
+
export interface LoadStrikeGeneratorWarning {
|
|
318
|
+
code: string;
|
|
319
|
+
sinkName?: string;
|
|
320
|
+
scenarioName: string;
|
|
321
|
+
scenarioIndex?: number;
|
|
322
|
+
simulationIndex: number;
|
|
323
|
+
simulationKind?: string;
|
|
324
|
+
count64: string;
|
|
325
|
+
message: string;
|
|
326
|
+
firstObservedUtcNs: string;
|
|
327
|
+
lastObservedUtcNs: string;
|
|
328
|
+
readonly Code?: string;
|
|
329
|
+
readonly SinkName?: string;
|
|
330
|
+
readonly ScenarioName?: string;
|
|
331
|
+
readonly ScenarioIndex?: number;
|
|
332
|
+
readonly SimulationIndex?: number;
|
|
333
|
+
readonly SimulationKind?: string;
|
|
334
|
+
readonly Count64?: string;
|
|
335
|
+
readonly Message?: string;
|
|
336
|
+
readonly FirstObservedUtcNs?: string;
|
|
337
|
+
readonly LastObservedUtcNs?: string;
|
|
338
|
+
}
|
|
339
|
+
export interface LoadStrikeSchedulerSegmentStats {
|
|
340
|
+
scenarioName: string;
|
|
341
|
+
scenarioIndex: number;
|
|
342
|
+
simulationIndex: number;
|
|
343
|
+
kind: string;
|
|
344
|
+
shardIndex: number;
|
|
345
|
+
shardCount: number;
|
|
346
|
+
plannedIterations64: string;
|
|
347
|
+
dueIterations64: string;
|
|
348
|
+
startedIterations64: string;
|
|
349
|
+
completedIterations64: string;
|
|
350
|
+
droppedIterations64: string;
|
|
351
|
+
unreachedIterations64: string;
|
|
352
|
+
requestedWorkerSlots64: string;
|
|
353
|
+
startedWorkerSlots64: string;
|
|
354
|
+
unavailableWorkerSlots64: string;
|
|
355
|
+
dropReasons: Record<string, string>;
|
|
356
|
+
unavailableWorkerReasons: Record<string, string>;
|
|
357
|
+
deliveryPercent: number;
|
|
358
|
+
accountingComplete: boolean;
|
|
359
|
+
}
|
|
360
|
+
export interface LoadStrikeSchedulerStats {
|
|
361
|
+
configuredMaxInFlight: number;
|
|
362
|
+
maxInFlightObserved: number;
|
|
363
|
+
currentInFlight: number;
|
|
364
|
+
segments: LoadStrikeSchedulerSegmentStats[];
|
|
365
|
+
}
|
|
293
366
|
export interface LoadStrikeRunResult {
|
|
294
367
|
startedUtc: string;
|
|
295
368
|
completedUtc: string;
|
|
@@ -316,6 +389,12 @@ export interface LoadStrikeRunResult {
|
|
|
316
389
|
logFiles: string[];
|
|
317
390
|
correlationRows: Array<Record<string, unknown>>;
|
|
318
391
|
failedCorrelationRows: Array<Record<string, unknown>>;
|
|
392
|
+
generatorWarnings?: LoadStrikeGeneratorWarning[];
|
|
393
|
+
schedulerSegments?: LoadStrikeSchedulerSegmentStats[];
|
|
394
|
+
schedulerStats?: LoadStrikeSchedulerStats;
|
|
395
|
+
observationDeliveryStats?: LoadStrikeObservationDeliveryStats;
|
|
396
|
+
reportingComplete?: boolean;
|
|
397
|
+
[LOAD_ENGINE_V2_SCHEDULER_DISTRIBUTIONS]?: LoadEngineV2DistributionRecord[];
|
|
319
398
|
findScenarioStats?: (scenarioName: string) => LoadStrikeScenarioStats | undefined;
|
|
320
399
|
getScenarioStats?: (scenarioName: string) => LoadStrikeScenarioStats;
|
|
321
400
|
FindScenarioStats?: (scenarioName: string) => LoadStrikeScenarioStats | undefined;
|
|
@@ -346,8 +425,14 @@ export interface LoadStrikeRunResult {
|
|
|
346
425
|
readonly LogFiles?: string[];
|
|
347
426
|
readonly CorrelationRows?: Array<Record<string, unknown>>;
|
|
348
427
|
readonly FailedCorrelationRows?: Array<Record<string, unknown>>;
|
|
428
|
+
readonly GeneratorWarnings?: LoadStrikeGeneratorWarning[];
|
|
429
|
+
readonly SchedulerSegments?: LoadStrikeSchedulerSegmentStats[];
|
|
430
|
+
readonly SchedulerStats?: LoadStrikeSchedulerStats;
|
|
431
|
+
readonly ObservationDeliveryStats?: LoadStrikeObservationDeliveryStats;
|
|
432
|
+
readonly ReportingComplete?: boolean;
|
|
349
433
|
}
|
|
350
434
|
export interface LoadStrikeStepStats extends LoadStrikeStepRuntime {
|
|
435
|
+
allMeasurement?: LoadStrikeMeasurementStats;
|
|
351
436
|
ok: LoadStrikeMeasurementStats;
|
|
352
437
|
fail: LoadStrikeMeasurementStats;
|
|
353
438
|
sortIndex: number;
|
|
@@ -364,9 +449,11 @@ export interface LoadStrikeStepStats extends LoadStrikeStepRuntime {
|
|
|
364
449
|
readonly StatusCodes?: Record<string, number>;
|
|
365
450
|
readonly Ok?: LoadStrikeMeasurementStats;
|
|
366
451
|
readonly Fail?: LoadStrikeMeasurementStats;
|
|
452
|
+
readonly AllMeasurement?: LoadStrikeMeasurementStats;
|
|
367
453
|
readonly SortIndex?: number;
|
|
368
454
|
}
|
|
369
455
|
export interface LoadStrikeScenarioStats extends LoadStrikeScenarioRuntime {
|
|
456
|
+
allMeasurement?: LoadStrikeMeasurementStats;
|
|
370
457
|
allBytes: number;
|
|
371
458
|
currentOperation: "None" | "Init" | "WarmUp" | "Bombing" | "Stop" | "Complete" | "Error";
|
|
372
459
|
durationMs: number;
|
|
@@ -395,6 +482,7 @@ export interface LoadStrikeScenarioStats extends LoadStrikeScenarioRuntime {
|
|
|
395
482
|
readonly Duration?: number;
|
|
396
483
|
readonly Ok?: LoadStrikeMeasurementStats;
|
|
397
484
|
readonly Fail?: LoadStrikeMeasurementStats;
|
|
485
|
+
readonly AllMeasurement?: LoadStrikeMeasurementStats;
|
|
398
486
|
readonly LoadSimulationStats?: LoadStrikeLoadSimulationStats;
|
|
399
487
|
readonly SortIndex?: number;
|
|
400
488
|
readonly StepStats?: LoadStrikeStepStats[];
|
|
@@ -421,6 +509,12 @@ interface LoadStrikeNodeStats {
|
|
|
421
509
|
sinkErrors: LoadStrikeSinkError[];
|
|
422
510
|
reportFiles: string[];
|
|
423
511
|
logFiles: string[];
|
|
512
|
+
generatorWarnings: LoadStrikeGeneratorWarning[];
|
|
513
|
+
schedulerSegments?: LoadStrikeSchedulerSegmentStats[];
|
|
514
|
+
schedulerStats?: LoadStrikeSchedulerStats;
|
|
515
|
+
observationDeliveryStats: LoadStrikeObservationDeliveryStats;
|
|
516
|
+
reportingComplete: boolean;
|
|
517
|
+
[LOAD_ENGINE_V2_SCHEDULER_DISTRIBUTIONS]?: LoadEngineV2DistributionRecord[];
|
|
424
518
|
findScenarioStats: (scenarioName: string) => LoadStrikeScenarioStats | undefined;
|
|
425
519
|
getScenarioStats: (scenarioName: string) => LoadStrikeScenarioStats;
|
|
426
520
|
FindScenarioStats: (scenarioName: string) => LoadStrikeScenarioStats | undefined;
|
|
@@ -447,13 +541,23 @@ interface LoadStrikeNodeStats {
|
|
|
447
541
|
readonly SinkErrors?: LoadStrikeSinkError[];
|
|
448
542
|
readonly ReportFiles?: string[];
|
|
449
543
|
readonly LogFiles?: string[];
|
|
544
|
+
readonly GeneratorWarnings?: LoadStrikeGeneratorWarning[];
|
|
545
|
+
readonly ObservationDeliveryStats?: LoadStrikeObservationDeliveryStats;
|
|
546
|
+
readonly ReportingComplete?: boolean;
|
|
450
547
|
}
|
|
451
548
|
declare class MeasurementAccumulator {
|
|
549
|
+
private readonly useHistogram;
|
|
452
550
|
private count;
|
|
453
551
|
private allBytes;
|
|
454
552
|
private readonly latenciesMs;
|
|
455
553
|
private readonly sizesBytes;
|
|
554
|
+
private readonly latencyHistogram?;
|
|
555
|
+
private readonly sizeHistogram?;
|
|
556
|
+
private latencyLessOrEq800;
|
|
557
|
+
private latencyMore800Less1200;
|
|
558
|
+
private latencyMoreOrEq1200;
|
|
456
559
|
private readonly statusCodes;
|
|
560
|
+
constructor(useHistogram?: boolean);
|
|
457
561
|
get Count(): number;
|
|
458
562
|
/**
|
|
459
563
|
* Exposes the public record operation.
|
|
@@ -465,14 +569,17 @@ declare class MeasurementAccumulator {
|
|
|
465
569
|
* Use this when all builder inputs are ready to be materialized.
|
|
466
570
|
*/
|
|
467
571
|
build(allRequestCount: number, durationMs: number): LoadStrikeMeasurementStats;
|
|
572
|
+
buildCombined(other: MeasurementAccumulator, allRequestCount: number, durationMs: number): LoadStrikeMeasurementStats;
|
|
573
|
+
private histogramSnapshot;
|
|
468
574
|
}
|
|
469
575
|
declare class StepStatsAccumulator {
|
|
470
576
|
readonly scenarioName: string;
|
|
471
577
|
readonly stepName: string;
|
|
472
578
|
readonly sortIndex: number;
|
|
579
|
+
private readonly useHistogram;
|
|
473
580
|
readonly ok: MeasurementAccumulator;
|
|
474
581
|
readonly fail: MeasurementAccumulator;
|
|
475
|
-
constructor(scenarioName: string, stepName: string, sortIndex: number);
|
|
582
|
+
constructor(scenarioName: string, stepName: string, sortIndex: number, useHistogram?: boolean);
|
|
476
583
|
/**
|
|
477
584
|
* Exposes the public record operation.
|
|
478
585
|
* Use this when the surrounding wrapper type makes this operation the clearest way to express your intent.
|
|
@@ -487,13 +594,14 @@ declare class StepStatsAccumulator {
|
|
|
487
594
|
declare class ScenarioStatsAccumulator {
|
|
488
595
|
readonly scenarioName: string;
|
|
489
596
|
readonly sortIndex: number;
|
|
597
|
+
private readonly useHistogram;
|
|
490
598
|
readonly ok: MeasurementAccumulator;
|
|
491
599
|
readonly fail: MeasurementAccumulator;
|
|
492
600
|
private readonly steps;
|
|
493
601
|
private nextStepSortIndex;
|
|
494
602
|
private loadSimulationStats;
|
|
495
603
|
private currentOperation;
|
|
496
|
-
constructor(scenarioName: string, sortIndex: number);
|
|
604
|
+
constructor(scenarioName: string, sortIndex: number, useHistogram?: boolean);
|
|
497
605
|
/**
|
|
498
606
|
* Exposes the public setLoadSimulation operation.
|
|
499
607
|
* Use this when the surrounding wrapper type makes this operation the clearest way to express your intent.
|
|
@@ -518,7 +626,7 @@ declare class ScenarioStatsAccumulator {
|
|
|
518
626
|
* Exposes the public recordStep operation.
|
|
519
627
|
* Use this when the surrounding wrapper type makes this operation the clearest way to express your intent.
|
|
520
628
|
*/
|
|
521
|
-
recordStep(stepName: string, reply: LoadStrikeStepReply, observedLatencyMs: number):
|
|
629
|
+
recordStep(stepName: string, reply: LoadStrikeStepReply, observedLatencyMs: number, sortIndex?: number): number;
|
|
522
630
|
/**
|
|
523
631
|
* Builds the configured payload or helper object.
|
|
524
632
|
* Use this when all builder inputs are ready to be materialized.
|
|
@@ -602,6 +710,10 @@ export interface LoadStrikeReportingSink {
|
|
|
602
710
|
SaveRealtimeMetrics?: (metrics: LoadStrikeMetricStats) => Promise<void> | void;
|
|
603
711
|
saveRunResult?: (result: LoadStrikeRunResult) => Promise<void> | void;
|
|
604
712
|
SaveRunResult?: (result: LoadStrikeRunResult) => Promise<void> | void;
|
|
713
|
+
saveIterationBatch?: (batch: LoadStrikeIterationObservationBatchV1) => Promise<void> | void;
|
|
714
|
+
SaveIterationBatch?: (batch: LoadStrikeIterationObservationBatchV1) => Promise<void> | void;
|
|
715
|
+
completeIterationObservationStream?: (completion: LoadStrikeIterationObservationStreamCompletionV1) => Promise<void> | void;
|
|
716
|
+
CompleteIterationObservationStream?: (completion: LoadStrikeIterationObservationStreamCompletionV1) => Promise<void> | void;
|
|
605
717
|
stop?: () => Promise<void> | void;
|
|
606
718
|
Stop?: () => Promise<void> | void;
|
|
607
719
|
dispose?: () => Promise<void> | void;
|
|
@@ -633,11 +745,17 @@ export interface LoadStrikeWorkerPlugin {
|
|
|
633
745
|
}
|
|
634
746
|
export type ILoadStrikeWorkerPlugin = RequireAtLeastOne<LoadStrikeWorkerPlugin, "pluginName" | "PluginName">;
|
|
635
747
|
export interface LoadStrikeRunnerOptions {
|
|
748
|
+
loadEngineContractVersion?: 1 | 2;
|
|
749
|
+
maxInFlight?: number;
|
|
636
750
|
displayConsoleMetrics?: boolean;
|
|
637
751
|
nodeType?: LoadStrikeNodeTypeInput;
|
|
638
752
|
localDevClusterEnabled?: boolean;
|
|
639
753
|
agentGroup?: string;
|
|
640
754
|
agentsCount?: number;
|
|
755
|
+
/** Stable V2 identity required by remote agents. */
|
|
756
|
+
agentId?: string;
|
|
757
|
+
/** Exact stable V2 participant set required by remote coordinators. */
|
|
758
|
+
expectedAgentIds?: string[];
|
|
641
759
|
targetScenarios?: string[];
|
|
642
760
|
agentTargetScenarios?: string[];
|
|
643
761
|
coordinatorTargetScenarios?: string[];
|
|
@@ -656,6 +774,13 @@ export interface LoadStrikeRunnerOptions {
|
|
|
656
774
|
reportFileName?: string;
|
|
657
775
|
reportFormats?: Array<LoadStrikeReportFormat>;
|
|
658
776
|
reportingIntervalSeconds?: number;
|
|
777
|
+
iterationObservationFlushIntervalSeconds?: number;
|
|
778
|
+
maxIterationObservationBufferBytes?: number;
|
|
779
|
+
maxIterationObservationsPerBatch?: number;
|
|
780
|
+
maxIterationObservationBatchBytes?: number;
|
|
781
|
+
iterationObservationSinkQueueDepth?: number;
|
|
782
|
+
iterationObservationSinkParallelism?: number;
|
|
783
|
+
iterationObservationDrainTimeoutSeconds?: number;
|
|
659
784
|
minimumLogLevel?: LoadStrikeLogLevel | string;
|
|
660
785
|
loggerConfig?: () => LoadStrikeLogger;
|
|
661
786
|
reportingSinks?: ILoadStrikeReportingSink[];
|
|
@@ -672,6 +797,17 @@ export interface LoadStrikeRunnerOptions {
|
|
|
672
797
|
runArgs?: string[];
|
|
673
798
|
agentExecutionToken?: string;
|
|
674
799
|
agentCommandId?: string;
|
|
800
|
+
/** @internal Cluster-owned V2 shard index. */
|
|
801
|
+
clusterShardIndex?: number;
|
|
802
|
+
/** @internal Cluster-owned V2 shard count. */
|
|
803
|
+
clusterShardCount?: number;
|
|
804
|
+
/** @internal Shared by colocated logical agents in one process. */
|
|
805
|
+
loadEngineV2BudgetOverride?: LoadEngineV2ExecutionBudget;
|
|
806
|
+
/** @internal Remote V2 segment barrier/drain bridge. */
|
|
807
|
+
loadEngineV2SegmentLifecycleOverride?: {
|
|
808
|
+
beforeSegment: (scenarioIndex: number, simulationIndex: number) => Promise<void>;
|
|
809
|
+
afterSegment: (scenarioIndex: number, simulationIndex: number) => Promise<void>;
|
|
810
|
+
};
|
|
675
811
|
}
|
|
676
812
|
export interface LoadStrikeThresholdOptions {
|
|
677
813
|
abortWhenErrorCount?: number;
|
|
@@ -860,7 +996,8 @@ export interface LoadStrikeScenarioContext {
|
|
|
860
996
|
}
|
|
861
997
|
interface InternalScenarioContext extends LoadStrikeScenarioContext {
|
|
862
998
|
readonly scenarioName: string;
|
|
863
|
-
readonly recordStep: (stepName: string, reply: LoadStrikeStepReply, observedLatencyMs: number) => void;
|
|
999
|
+
readonly recordStep: (stepName: string, reply: LoadStrikeStepReply, observedLatencyMs: number) => number | void;
|
|
1000
|
+
readonly recordStepObservation?: (observation: LoadStrikeIterationStepObservationV1) => void;
|
|
864
1001
|
readonly shouldStopScenario: () => boolean;
|
|
865
1002
|
readonly shouldStopTest: () => boolean;
|
|
866
1003
|
readonly invokeBeforeStep: (stepName: string) => Promise<void>;
|
|
@@ -1124,6 +1261,8 @@ export declare class ScenarioTrackingExtensions {
|
|
|
1124
1261
|
static WithCrossPlatformTracking(scenario: LoadStrikeScenario, configuration: Record<string, unknown>): LoadStrikeScenario;
|
|
1125
1262
|
}
|
|
1126
1263
|
export interface LoadStrikeRunContext {
|
|
1264
|
+
LoadEngineContractVersion?: 1 | 2;
|
|
1265
|
+
MaxInFlight?: number;
|
|
1127
1266
|
ConsoleMetricsEnabled?: boolean;
|
|
1128
1267
|
LocalDevClusterEnabled?: boolean;
|
|
1129
1268
|
ConfigPath?: string;
|
|
@@ -1131,6 +1270,8 @@ export interface LoadStrikeRunContext {
|
|
|
1131
1270
|
InfraConfig?: Record<string, unknown>;
|
|
1132
1271
|
AgentGroup?: string;
|
|
1133
1272
|
AgentsCount?: number;
|
|
1273
|
+
AgentId?: string;
|
|
1274
|
+
ExpectedAgentIds?: string[];
|
|
1134
1275
|
AgentTargetScenarios?: string[];
|
|
1135
1276
|
ClusterId?: string;
|
|
1136
1277
|
CoordinatorTargetScenarios?: string[];
|
|
@@ -1145,6 +1286,13 @@ export interface LoadStrikeRunContext {
|
|
|
1145
1286
|
ReportFolderPath?: string;
|
|
1146
1287
|
ReportFormats?: LoadStrikeReportFormat[];
|
|
1147
1288
|
ReportingIntervalSeconds?: number;
|
|
1289
|
+
IterationObservationFlushIntervalSeconds?: number;
|
|
1290
|
+
MaxIterationObservationBufferBytes?: number;
|
|
1291
|
+
MaxIterationObservationsPerBatch?: number;
|
|
1292
|
+
MaxIterationObservationBatchBytes?: number;
|
|
1293
|
+
IterationObservationSinkQueueDepth?: number;
|
|
1294
|
+
IterationObservationSinkParallelism?: number;
|
|
1295
|
+
IterationObservationDrainTimeoutSeconds?: number;
|
|
1148
1296
|
ReportingSinks?: ILoadStrikeReportingSink[];
|
|
1149
1297
|
SinkRetryCount?: number;
|
|
1150
1298
|
SinkRetryBackoffMs?: number;
|
|
@@ -1162,6 +1310,10 @@ export interface LoadStrikeRunContext {
|
|
|
1162
1310
|
GlobalCustomSettings?: Record<string, unknown>;
|
|
1163
1311
|
AgentExecutionToken?: string;
|
|
1164
1312
|
AgentCommandId?: string;
|
|
1313
|
+
/** @internal */
|
|
1314
|
+
ClusterShardIndex?: number;
|
|
1315
|
+
/** @internal */
|
|
1316
|
+
ClusterShardCount?: number;
|
|
1165
1317
|
}
|
|
1166
1318
|
export declare class LoadStrikeContext {
|
|
1167
1319
|
private values;
|
|
@@ -1225,6 +1377,10 @@ export declare class LoadStrikeContext {
|
|
|
1225
1377
|
* Use this when a local run or CI log should stream live throughput and latency updates.
|
|
1226
1378
|
*/
|
|
1227
1379
|
DisplayConsoleMetrics(enable: boolean): LoadStrikeContext;
|
|
1380
|
+
useLoadEngineV2(): LoadStrikeContext;
|
|
1381
|
+
UseLoadEngineV2(): LoadStrikeContext;
|
|
1382
|
+
withMaxInFlight(maxInFlight: number): LoadStrikeContext;
|
|
1383
|
+
WithMaxInFlight(maxInFlight: number): LoadStrikeContext;
|
|
1228
1384
|
/**
|
|
1229
1385
|
* Toggles local development cluster mode.
|
|
1230
1386
|
* Use this when you want to simulate coordinator and agent behavior on a single machine.
|
|
@@ -1265,6 +1421,14 @@ export declare class LoadStrikeContext {
|
|
|
1265
1421
|
* Use this when only a subset of agents should pick up a particular workload.
|
|
1266
1422
|
*/
|
|
1267
1423
|
WithAgentGroup(agentGroup: string): LoadStrikeContext;
|
|
1424
|
+
/** Sets the stable identity required by a remote Load Engine V2 agent. */
|
|
1425
|
+
withAgentId(agentId: string): LoadStrikeContext;
|
|
1426
|
+
/** Sets the stable identity required by a remote Load Engine V2 agent. */
|
|
1427
|
+
WithAgentId(agentId: string): LoadStrikeContext;
|
|
1428
|
+
/** Sets the exact remote agent identities required by a Load Engine V2 coordinator. */
|
|
1429
|
+
withExpectedAgentIds(...agentIds: string[]): LoadStrikeContext;
|
|
1430
|
+
/** Sets the exact remote agent identities required by a Load Engine V2 coordinator. */
|
|
1431
|
+
WithExpectedAgentIds(...agentIds: string[]): LoadStrikeContext;
|
|
1268
1432
|
/**
|
|
1269
1433
|
* Sets the requested agent count.
|
|
1270
1434
|
* Use this when a coordinator should fan work out across a specific number of agents.
|
|
@@ -1611,6 +1775,8 @@ export declare class LoadStrikeScenario {
|
|
|
1611
1775
|
private readonly weight;
|
|
1612
1776
|
private readonly restartIterationOnFail;
|
|
1613
1777
|
private readonly internalLicenseFeatures;
|
|
1778
|
+
private readonly declaredStepNames;
|
|
1779
|
+
private trafficMixV2Metadata?;
|
|
1614
1780
|
private constructor();
|
|
1615
1781
|
static create(name: string, runHandler: (context: LoadStrikeScenarioContext) => Promise<LoadStrikeStepReply> | LoadStrikeStepReply): LoadStrikeScenario;
|
|
1616
1782
|
static Create(name: string, runHandler: (context: LoadStrikeScenarioContext) => Promise<LoadStrikeStepReply> | LoadStrikeStepReply): LoadStrikeScenario;
|
|
@@ -1728,6 +1894,12 @@ export declare class LoadStrikeScenario {
|
|
|
1728
1894
|
*/
|
|
1729
1895
|
shouldRestartIterationOnFail(): boolean;
|
|
1730
1896
|
__loadStrikeInternalLicenseFeatures(): string[];
|
|
1897
|
+
/** Freezes the named step identities that may be reported by this scenario. */
|
|
1898
|
+
withDeclaredSteps(...stepNames: string[]): LoadStrikeScenario;
|
|
1899
|
+
/** Returns the immutable declared-step names in declaration order. */
|
|
1900
|
+
getDeclaredSteps(): string[];
|
|
1901
|
+
__loadStrikeSetTrafficMixV2Metadata(metadata: LoadEngineV2TrafficMixMetadata): LoadStrikeScenario;
|
|
1902
|
+
__loadStrikeTrafficMixV2Metadata(): LoadEngineV2TrafficMixMetadata | undefined;
|
|
1731
1903
|
__loadStrikeScenarioSourceAnalysis(): Record<string, unknown>;
|
|
1732
1904
|
__loadStrikeWithInternalLicenseFeatures(...features: string[]): LoadStrikeScenario;
|
|
1733
1905
|
invokeInit(context: LoadStrikeScenarioInitContext): Promise<void>;
|
|
@@ -1763,6 +1935,8 @@ export declare class LoadStrikeScenario {
|
|
|
1763
1935
|
* Use this when load simulations should be set explicitly before the run starts.
|
|
1764
1936
|
*/
|
|
1765
1937
|
WithLoadSimulations(...simulations: Array<Record<string, unknown>>): LoadStrikeScenario;
|
|
1938
|
+
/** Freezes the named step identities that may be reported by this scenario. */
|
|
1939
|
+
WithDeclaredSteps(...stepNames: string[]): LoadStrikeScenario;
|
|
1766
1940
|
/**
|
|
1767
1941
|
* Configures max fail count for this SDK object.
|
|
1768
1942
|
* Use this when max fail count should be set explicitly before the run starts.
|
|
@@ -1853,6 +2027,7 @@ export declare class LoadStrikeRunner {
|
|
|
1853
2027
|
private scenarios;
|
|
1854
2028
|
private options;
|
|
1855
2029
|
private contextConfigurators;
|
|
2030
|
+
private readonly internalOptions;
|
|
1856
2031
|
private constructor();
|
|
1857
2032
|
/**
|
|
1858
2033
|
* Creates a new instance of this public SDK type.
|
|
@@ -1889,6 +2064,8 @@ export declare class LoadStrikeRunner {
|
|
|
1889
2064
|
* Use this when a local run or CI log should stream live throughput and latency updates.
|
|
1890
2065
|
*/
|
|
1891
2066
|
static DisplayConsoleMetrics(context: LoadStrikeContext, enable: boolean): LoadStrikeContext;
|
|
2067
|
+
static UseLoadEngineV2(context: LoadStrikeContext): LoadStrikeContext;
|
|
2068
|
+
static WithMaxInFlight(context: LoadStrikeContext, maxInFlight: number): LoadStrikeContext;
|
|
1892
2069
|
/**
|
|
1893
2070
|
* Toggles local development cluster mode.
|
|
1894
2071
|
* Use this when you want to simulate coordinator and agent behavior on a single machine.
|
|
@@ -1914,6 +2091,8 @@ export declare class LoadStrikeRunner {
|
|
|
1914
2091
|
* Use this when only a subset of agents should pick up a particular workload.
|
|
1915
2092
|
*/
|
|
1916
2093
|
static WithAgentGroup(context: LoadStrikeContext, agentGroup: string): LoadStrikeContext;
|
|
2094
|
+
static WithAgentId(context: LoadStrikeContext, agentId: string): LoadStrikeContext;
|
|
2095
|
+
static WithExpectedAgentIds(context: LoadStrikeContext, ...agentIds: string[]): LoadStrikeContext;
|
|
1917
2096
|
/**
|
|
1918
2097
|
* Sets the requested agent count.
|
|
1919
2098
|
* Use this when a coordinator should fan work out across a specific number of agents.
|
|
@@ -2131,6 +2310,10 @@ export declare class LoadStrikeRunner {
|
|
|
2131
2310
|
* Use this when sinks or dashboards should receive updates at a controlled interval.
|
|
2132
2311
|
*/
|
|
2133
2312
|
WithReportingInterval(intervalSeconds: number): LoadStrikeRunner;
|
|
2313
|
+
useLoadEngineV2(): LoadStrikeRunner;
|
|
2314
|
+
UseLoadEngineV2(): LoadStrikeRunner;
|
|
2315
|
+
withMaxInFlight(maxInFlight: number): LoadStrikeRunner;
|
|
2316
|
+
WithMaxInFlight(maxInFlight: number): LoadStrikeRunner;
|
|
2134
2317
|
withReportingSinks(...sinks: ILoadStrikeReportingSink[]): LoadStrikeRunner;
|
|
2135
2318
|
WithReportingSinks(...sinks: ILoadStrikeReportingSink[]): LoadStrikeRunner;
|
|
2136
2319
|
withPortalReporting(): LoadStrikeRunner;
|
|
@@ -2205,7 +2388,16 @@ declare function combineAbortSignals(...signals: AbortSignal[]): AbortSignal;
|
|
|
2205
2388
|
declare function delayWithAbort(durationMs: number, signal: AbortSignal): Promise<void>;
|
|
2206
2389
|
declare function createRuntimeRandom(): LoadStrikeRandom;
|
|
2207
2390
|
declare function parseAliasDate(value: string | Date | null | undefined): Date | undefined;
|
|
2208
|
-
|
|
2391
|
+
interface LoadEngineV2TrafficMixMetadata {
|
|
2392
|
+
declarationIndex: number;
|
|
2393
|
+
name: string;
|
|
2394
|
+
laneIndex: number;
|
|
2395
|
+
shareWeight: number;
|
|
2396
|
+
shareWeights: number[];
|
|
2397
|
+
seedId: string;
|
|
2398
|
+
originalSimulations: Array<Record<string, unknown>>;
|
|
2399
|
+
}
|
|
2400
|
+
declare function expandTrafficMixScenarios(trafficMix: LoadStrikeTrafficMix, declarationIndex?: number): LoadStrikeScenario[];
|
|
2209
2401
|
declare function attachScenarioStatsAliases(scenario: Omit<LoadStrikeScenarioStats, "FindStepStats" | "GetStepStats"> & Partial<Pick<LoadStrikeScenarioStats, "FindStepStats" | "GetStepStats">>): LoadStrikeScenarioStats;
|
|
2210
2402
|
declare function attachNodeStatsAliases(stats: Omit<LoadStrikeNodeStats, "FindScenarioStats" | "GetScenarioStats"> & Partial<Pick<LoadStrikeNodeStats, "FindScenarioStats" | "GetScenarioStats">>): LoadStrikeNodeStats;
|
|
2211
2403
|
declare function attachRunResultAliases(result: LoadStrikeRunResult): LoadStrikeRunResult;
|
|
@@ -2248,9 +2440,14 @@ declare function buildEmptyNodeStats(args: {
|
|
|
2248
2440
|
nodeInfo: LoadStrikeNodeInfo;
|
|
2249
2441
|
testInfo: LoadStrikeTestInfo;
|
|
2250
2442
|
}): LoadStrikeNodeStats;
|
|
2443
|
+
declare function planRuntimeClusterAssignments(scenarios: LoadStrikeScenario[], agentsCount: number, targetScenarios: string[], agentTargetScenarios: string[], globalV2?: boolean, coordinatorTargetScenarios?: string[]): string[][];
|
|
2444
|
+
declare function buildRuntimeLoadEngineV2Plan(scenarios: LoadStrikeScenario[], options: LoadStrikeRunnerOptions, testInfo: LoadStrikeTestInfo, expectedAgentIds: string[]): LoadEngineV2PlanInput;
|
|
2445
|
+
declare function validateLoadEngineV2ScenarioFeatures(scenarios: LoadStrikeScenario[]): void;
|
|
2446
|
+
declare function buildRuntimeLoadEngineV2HistogramArtifact(result: LoadStrikeNodeStats, scenarioDeclarations?: readonly LoadStrikeScenario[]): Buffer;
|
|
2251
2447
|
declare function toDetailedRunResultFromNodeStats(result: LoadStrikeNodeStats, startedUtc: string, sinkErrors: LoadStrikeSinkError[], policyErrors?: LoadStrikeRuntimePolicyError[]): LoadStrikeRunResult;
|
|
2252
|
-
declare function clusterNodeResultToNodeStats(result: ClusterNodeResult, testInfo: LoadStrikeTestInfo, fallbackNodeInfo: LoadStrikeNodeInfo): LoadStrikeNodeStats;
|
|
2253
|
-
declare function aggregateNodeStats(testInfo: LoadStrikeTestInfo, coordinatorNodeInfo: LoadStrikeNodeInfo, nodes: LoadStrikeNodeStats[]): LoadStrikeNodeStats;
|
|
2448
|
+
declare function clusterNodeResultToNodeStats(result: ClusterNodeResult, testInfo: LoadStrikeTestInfo, fallbackNodeInfo: LoadStrikeNodeInfo, requireHistogramArtifact?: boolean): LoadStrikeNodeStats;
|
|
2449
|
+
declare function aggregateNodeStats(testInfo: LoadStrikeTestInfo, coordinatorNodeInfo: LoadStrikeNodeInfo, nodes: LoadStrikeNodeStats[], requireHistograms?: boolean): LoadStrikeNodeStats;
|
|
2450
|
+
declare function aggregateMeasurementStats(measurements: LoadStrikeMeasurementStats[], allRequestCount: number, durationMs: number, requireHistograms?: boolean): LoadStrikeMeasurementStats;
|
|
2254
2451
|
declare function buildMeasurementPlaceholder(count: number, allCount: number, durationMs: number): LoadStrikeMeasurementStats;
|
|
2255
2452
|
declare function executeTrackedScenarioInvocation(tracking: Record<string, unknown>, context: InternalScenarioContext, originalRun: () => Promise<LoadStrikeStepReply>, operation: "WarmUp" | "Bombing"): Promise<LoadStrikeStepReply>;
|
|
2256
2453
|
interface ManagedTrackingOutcome {
|
|
@@ -2377,6 +2574,8 @@ declare function resolveSinkStart(sink: LoadStrikeReportingSink): ((session: Loa
|
|
|
2377
2574
|
declare function resolveSinkSaveRealtimeStats(sink: LoadStrikeReportingSink): ((scenarioStats: LoadStrikeScenarioStats[]) => Promise<void> | void) | undefined;
|
|
2378
2575
|
declare function resolveSinkSaveRealtimeMetrics(sink: LoadStrikeReportingSink): ((metrics: LoadStrikeMetricStats) => Promise<void> | void) | undefined;
|
|
2379
2576
|
declare function resolveSinkSaveRunResult(sink: LoadStrikeReportingSink): ((result: LoadStrikeRunResult) => Promise<void> | void) | undefined;
|
|
2577
|
+
declare function resolveSinkSaveIterationBatch(sink: LoadStrikeReportingSink): ((batch: LoadStrikeIterationObservationBatchV1) => Promise<void> | void) | undefined;
|
|
2578
|
+
declare function resolveSinkCompleteIterationObservationStream(sink: LoadStrikeReportingSink): ((completion: LoadStrikeIterationObservationStreamCompletionV1) => Promise<void> | void) | undefined;
|
|
2380
2579
|
declare function resolveSinkStop(sink: LoadStrikeReportingSink): (() => Promise<void> | void) | undefined;
|
|
2381
2580
|
declare function resolveSinkDispose(sink: LoadStrikeReportingSink): (() => Promise<void> | void) | undefined;
|
|
2382
2581
|
interface CrossPlatformFailedResponseRow {
|
|
@@ -2427,13 +2626,17 @@ export declare const __loadstrikeTestExports: {
|
|
|
2427
2626
|
ManagedScenarioTrackingRuntime: typeof ManagedScenarioTrackingRuntime;
|
|
2428
2627
|
ScenarioStatsAccumulator: typeof ScenarioStatsAccumulator;
|
|
2429
2628
|
StepStatsAccumulator: typeof StepStatsAccumulator;
|
|
2629
|
+
planRuntimeClusterAssignments: typeof planRuntimeClusterAssignments;
|
|
2430
2630
|
TrackingFieldSelector: typeof TrackingFieldSelector;
|
|
2431
2631
|
addCorrelationRow: typeof addCorrelationRow;
|
|
2432
2632
|
addFailedResponseRow: typeof addFailedResponseRow;
|
|
2433
2633
|
aggregateNodeStats: typeof aggregateNodeStats;
|
|
2634
|
+
aggregateMeasurementStats: typeof aggregateMeasurementStats;
|
|
2434
2635
|
asRecord: typeof asRecord;
|
|
2435
2636
|
assertNoDisableLicenseEnforcementOption: typeof assertNoDisableLicenseEnforcementOption;
|
|
2436
2637
|
buildEmptyNodeStats: typeof buildEmptyNodeStats;
|
|
2638
|
+
buildRuntimeLoadEngineV2HistogramArtifact: typeof buildRuntimeLoadEngineV2HistogramArtifact;
|
|
2639
|
+
buildRuntimeLoadEngineV2Plan: typeof buildRuntimeLoadEngineV2Plan;
|
|
2437
2640
|
buildGroupedCorrelationRows: typeof buildGroupedCorrelationRows;
|
|
2438
2641
|
buildMeasurementPlaceholder: typeof buildMeasurementPlaceholder;
|
|
2439
2642
|
buildRichHtmlReport: typeof buildRichHtmlReport;
|
|
@@ -2506,7 +2709,9 @@ export declare const __loadstrikeTestExports: {
|
|
|
2506
2709
|
resolveSinkName: typeof resolveSinkName;
|
|
2507
2710
|
resolveSinkSaveRealtimeMetrics: typeof resolveSinkSaveRealtimeMetrics;
|
|
2508
2711
|
resolveSinkSaveRealtimeStats: typeof resolveSinkSaveRealtimeStats;
|
|
2712
|
+
resolveSinkSaveIterationBatch: typeof resolveSinkSaveIterationBatch;
|
|
2509
2713
|
resolveSinkSaveRunResult: typeof resolveSinkSaveRunResult;
|
|
2714
|
+
resolveSinkCompleteIterationObservationStream: typeof resolveSinkCompleteIterationObservationStream;
|
|
2510
2715
|
resolveSinkStart: typeof resolveSinkStart;
|
|
2511
2716
|
resolveSinkStop: typeof resolveSinkStop;
|
|
2512
2717
|
resolveWorkerPlugins: typeof resolveWorkerPlugins;
|
|
@@ -2527,6 +2732,7 @@ export declare const __loadstrikeTestExports: {
|
|
|
2527
2732
|
tryParseNodeTypeToken: typeof tryParseNodeTypeToken;
|
|
2528
2733
|
tryReadConfigValue: typeof tryReadConfigValue;
|
|
2529
2734
|
validateNamedReportingSinks: typeof validateNamedReportingSinks;
|
|
2735
|
+
validateLoadEngineV2ScenarioFeatures: typeof validateLoadEngineV2ScenarioFeatures;
|
|
2530
2736
|
validateRegisteredScenarios: typeof validateRegisteredScenarios;
|
|
2531
2737
|
validateRuntimeRedisCorrelationStoreConfiguration: typeof validateRuntimeRedisCorrelationStoreConfiguration;
|
|
2532
2738
|
validateRuntimeTrackingConfiguration: typeof validateRuntimeTrackingConfiguration;
|