@loadstrike/loadstrike-sdk 1.0.30201 → 1.0.31001

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.
@@ -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): void;
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
- declare function expandTrafficMixScenarios(trafficMix: LoadStrikeTrafficMix): LoadStrikeScenario[];
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 {
@@ -2329,6 +2526,7 @@ declare function normalizeRuntimeTrackingPayload(payload: TrackingPayload | null
2329
2526
  declare function readRuntimeTrackingId(payload: TrackingPayload, selector: string): string | null;
2330
2527
  declare function runtimeParseBodyAsObject(body: unknown): Record<string, unknown> | null;
2331
2528
  declare function setRuntimeJsonPathValue(body: unknown, path: string, value: string): unknown;
2529
+ declare function pickTrackingValue(source: Record<string, unknown>, ...keys: string[]): unknown;
2332
2530
  declare function pickOptionalTrackingSelectorString(source: Record<string, unknown>, key: string, altKey: string): string | undefined;
2333
2531
  declare function pickTrackingNumber(source: Record<string, unknown>, keys: string[], fallback: number): number;
2334
2532
  declare function toTrackingStringMap(value: unknown): Record<string, string>;
@@ -2377,6 +2575,8 @@ declare function resolveSinkStart(sink: LoadStrikeReportingSink): ((session: Loa
2377
2575
  declare function resolveSinkSaveRealtimeStats(sink: LoadStrikeReportingSink): ((scenarioStats: LoadStrikeScenarioStats[]) => Promise<void> | void) | undefined;
2378
2576
  declare function resolveSinkSaveRealtimeMetrics(sink: LoadStrikeReportingSink): ((metrics: LoadStrikeMetricStats) => Promise<void> | void) | undefined;
2379
2577
  declare function resolveSinkSaveRunResult(sink: LoadStrikeReportingSink): ((result: LoadStrikeRunResult) => Promise<void> | void) | undefined;
2578
+ declare function resolveSinkSaveIterationBatch(sink: LoadStrikeReportingSink): ((batch: LoadStrikeIterationObservationBatchV1) => Promise<void> | void) | undefined;
2579
+ declare function resolveSinkCompleteIterationObservationStream(sink: LoadStrikeReportingSink): ((completion: LoadStrikeIterationObservationStreamCompletionV1) => Promise<void> | void) | undefined;
2380
2580
  declare function resolveSinkStop(sink: LoadStrikeReportingSink): (() => Promise<void> | void) | undefined;
2381
2581
  declare function resolveSinkDispose(sink: LoadStrikeReportingSink): (() => Promise<void> | void) | undefined;
2382
2582
  interface CrossPlatformFailedResponseRow {
@@ -2427,13 +2627,17 @@ export declare const __loadstrikeTestExports: {
2427
2627
  ManagedScenarioTrackingRuntime: typeof ManagedScenarioTrackingRuntime;
2428
2628
  ScenarioStatsAccumulator: typeof ScenarioStatsAccumulator;
2429
2629
  StepStatsAccumulator: typeof StepStatsAccumulator;
2630
+ planRuntimeClusterAssignments: typeof planRuntimeClusterAssignments;
2430
2631
  TrackingFieldSelector: typeof TrackingFieldSelector;
2431
2632
  addCorrelationRow: typeof addCorrelationRow;
2432
2633
  addFailedResponseRow: typeof addFailedResponseRow;
2433
2634
  aggregateNodeStats: typeof aggregateNodeStats;
2635
+ aggregateMeasurementStats: typeof aggregateMeasurementStats;
2434
2636
  asRecord: typeof asRecord;
2435
2637
  assertNoDisableLicenseEnforcementOption: typeof assertNoDisableLicenseEnforcementOption;
2436
2638
  buildEmptyNodeStats: typeof buildEmptyNodeStats;
2639
+ buildRuntimeLoadEngineV2HistogramArtifact: typeof buildRuntimeLoadEngineV2HistogramArtifact;
2640
+ buildRuntimeLoadEngineV2Plan: typeof buildRuntimeLoadEngineV2Plan;
2437
2641
  buildGroupedCorrelationRows: typeof buildGroupedCorrelationRows;
2438
2642
  buildMeasurementPlaceholder: typeof buildMeasurementPlaceholder;
2439
2643
  buildRichHtmlReport: typeof buildRichHtmlReport;
@@ -2488,6 +2692,7 @@ export declare const __loadstrikeTestExports: {
2488
2692
  parseStrictBooleanToken: typeof parseStrictBooleanToken;
2489
2693
  percentile: typeof percentile;
2490
2694
  pickOptionalTrackingSelectorString: typeof pickOptionalTrackingSelectorString;
2695
+ pickTrackingValue: typeof pickTrackingValue;
2491
2696
  pickTrackingNumber: typeof pickTrackingNumber;
2492
2697
  produceOrConsumeTrackingPayload: typeof produceOrConsumeTrackingPayload;
2493
2698
  readConfiguredSinkName: typeof readConfiguredSinkName;
@@ -2506,7 +2711,9 @@ export declare const __loadstrikeTestExports: {
2506
2711
  resolveSinkName: typeof resolveSinkName;
2507
2712
  resolveSinkSaveRealtimeMetrics: typeof resolveSinkSaveRealtimeMetrics;
2508
2713
  resolveSinkSaveRealtimeStats: typeof resolveSinkSaveRealtimeStats;
2714
+ resolveSinkSaveIterationBatch: typeof resolveSinkSaveIterationBatch;
2509
2715
  resolveSinkSaveRunResult: typeof resolveSinkSaveRunResult;
2716
+ resolveSinkCompleteIterationObservationStream: typeof resolveSinkCompleteIterationObservationStream;
2510
2717
  resolveSinkStart: typeof resolveSinkStart;
2511
2718
  resolveSinkStop: typeof resolveSinkStop;
2512
2719
  resolveWorkerPlugins: typeof resolveWorkerPlugins;
@@ -2527,6 +2734,7 @@ export declare const __loadstrikeTestExports: {
2527
2734
  tryParseNodeTypeToken: typeof tryParseNodeTypeToken;
2528
2735
  tryReadConfigValue: typeof tryReadConfigValue;
2529
2736
  validateNamedReportingSinks: typeof validateNamedReportingSinks;
2737
+ validateLoadEngineV2ScenarioFeatures: typeof validateLoadEngineV2ScenarioFeatures;
2530
2738
  validateRegisteredScenarios: typeof validateRegisteredScenarios;
2531
2739
  validateRuntimeRedisCorrelationStoreConfiguration: typeof validateRuntimeRedisCorrelationStoreConfiguration;
2532
2740
  validateRuntimeTrackingConfiguration: typeof validateRuntimeTrackingConfiguration;
@@ -0,0 +1,9 @@
1
+ export declare const DEFAULT_SINK_RETRY_COUNT = 3;
2
+ export declare const DEFAULT_SINK_RETRY_BACKOFF_MS = 250;
3
+ export declare const MAXIMUM_SINK_RETRY_COUNT = 100;
4
+ export declare const MAXIMUM_TIMER_DELAY_MS = 2147483647;
5
+ export declare function normalizeSinkRetryCount(value: number | undefined): number;
6
+ export declare function normalizeSinkRetryBackoffMs(value: number | undefined): number;
7
+ export declare function sinkRetryDelayMs(baseDelayMs: number, retryNumber: number): number;
8
+ export declare function waitForSinkRetryDelay(delayMs: number): Promise<void>;
9
+ export declare function cooperativeSinkRetryYield(): Promise<void>;