@loadstrike/loadstrike-sdk 1.0.30401 → 1.0.31601

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,7 @@
1
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 { type ReportHistoryMeasurement, type ReportHistoryScenario } from "./report-history.js";
4
5
  import { LoadEngineV2ExecutionBudget, type LoadEngineV2DistributionRecord, type LoadStrikeHistogramV1Sidecar } from "./load-engine-v2.js";
5
6
  import { type LoadStrikeIterationObservationBatchV1, type LoadStrikeIterationObservationStreamCompletionV1, type LoadStrikeIterationStepObservationV1, type LoadStrikeObservationDeliveryStats } from "./iteration-observations.js";
6
7
  declare const LOAD_ENGINE_V2_SCHEDULER_DISTRIBUTIONS: unique symbol;
@@ -570,6 +571,17 @@ declare class MeasurementAccumulator {
570
571
  */
571
572
  build(allRequestCount: number, durationMs: number): LoadStrikeMeasurementStats;
572
573
  buildCombined(other: MeasurementAccumulator, allRequestCount: number, durationMs: number): LoadStrikeMeasurementStats;
574
+ /**
575
+ * Projects only the cumulative fields used by the private HTML-report
576
+ * history. Legacy distributions deliberately omit latency so this cadence
577
+ * path never scans their retained per-request arrays.
578
+ */
579
+ buildReportHistoryMeasurement(): ReportHistoryMeasurement;
580
+ /**
581
+ * Combines only bounded native latency state plus exact counters. It does
582
+ * not materialize status rows or any public measurement DTO.
583
+ */
584
+ buildCombinedReportHistoryMeasurement(other: MeasurementAccumulator): ReportHistoryMeasurement;
573
585
  private histogramSnapshot;
574
586
  }
575
587
  declare class StepStatsAccumulator {
@@ -627,6 +639,11 @@ declare class ScenarioStatsAccumulator {
627
639
  * Use this when the surrounding wrapper type makes this operation the clearest way to express your intent.
628
640
  */
629
641
  recordStep(stepName: string, reply: LoadStrikeStepReply, observedLatencyMs: number, sortIndex?: number): number;
642
+ /**
643
+ * Captures the bounded, private history view without building scenario
644
+ * steps, status rows, plugins, aliases, or any other public result shape.
645
+ */
646
+ buildReportHistorySnapshot(): ReportHistoryScenario;
630
647
  /**
631
648
  * Builds the configured payload or helper object.
632
649
  * Use this when all builder inputs are ready to be materialized.
@@ -2384,6 +2401,8 @@ export declare class LoadStrikeRunner {
2384
2401
  private collectPluginData;
2385
2402
  }
2386
2403
  declare function hasPluginRows(value: LoadStrikePluginData): boolean;
2404
+ declare function boundedReportingIntervalMs(seconds: number): number;
2405
+ declare function resolvedReportHistoryCadenceSeconds(seconds: number): number;
2387
2406
  declare function combineAbortSignals(...signals: AbortSignal[]): AbortSignal;
2388
2407
  declare function delayWithAbort(durationMs: number, signal: AbortSignal): Promise<void>;
2389
2408
  declare function createRuntimeRandom(): LoadStrikeRandom;
@@ -2434,6 +2453,7 @@ declare function normalizeThresholdScope(value: string): "scenario" | "step" | "
2434
2453
  declare function buildThresholdCheckExpression(scope: "scenario" | "step" | "metric", stepName: string, field: string): string;
2435
2454
  declare function detailedToNodeStats(result: LoadStrikeRunResult, metricStats?: LoadStrikeMetricStats): LoadStrikeNodeStats;
2436
2455
  declare function resolveClusterExecutionMode(options: LoadStrikeRunnerOptions): "single" | "local-coordinator" | "nats-coordinator" | "nats-agent";
2456
+ declare function isDistributedReportHistoryExecution(clusterMode: ReturnType<typeof resolveClusterExecutionMode>, options: Pick<LoadStrikeRunnerOptions, "clusterShardCount" | "loadEngineV2SegmentLifecycleOverride">): boolean;
2437
2457
  declare function buildEmptyNodeStats(args: {
2438
2458
  startedUtc: string;
2439
2459
  completedUtc: string;
@@ -2526,6 +2546,7 @@ declare function normalizeRuntimeTrackingPayload(payload: TrackingPayload | null
2526
2546
  declare function readRuntimeTrackingId(payload: TrackingPayload, selector: string): string | null;
2527
2547
  declare function runtimeParseBodyAsObject(body: unknown): Record<string, unknown> | null;
2528
2548
  declare function setRuntimeJsonPathValue(body: unknown, path: string, value: string): unknown;
2549
+ declare function pickTrackingValue(source: Record<string, unknown>, ...keys: string[]): unknown;
2529
2550
  declare function pickOptionalTrackingSelectorString(source: Record<string, unknown>, key: string, altKey: string): string | undefined;
2530
2551
  declare function pickTrackingNumber(source: Record<string, unknown>, keys: string[], fallback: number): number;
2531
2552
  declare function toTrackingStringMap(value: unknown): Record<string, string>;
@@ -2643,6 +2664,8 @@ export declare const __loadstrikeTestExports: {
2643
2664
  buildThresholdCheckExpression: typeof buildThresholdCheckExpression;
2644
2665
  buildTrackingLeaseKey: typeof buildTrackingLeaseKey;
2645
2666
  buildTrackingRunNamespace: typeof buildTrackingRunNamespace;
2667
+ boundedReportingIntervalMs: typeof boundedReportingIntervalMs;
2668
+ resolvedReportHistoryCadenceSeconds: typeof resolvedReportHistoryCadenceSeconds;
2646
2669
  clusterNodeResultToNodeStats: typeof clusterNodeResultToNodeStats;
2647
2670
  combineAbortSignals: typeof combineAbortSignals;
2648
2671
  computeScenarioRequestCount: typeof computeScenarioRequestCount;
@@ -2662,6 +2685,7 @@ export declare const __loadstrikeTestExports: {
2662
2685
  formatUtcReportTimestamp: typeof formatUtcReportTimestamp;
2663
2686
  hasPluginRows: typeof hasPluginRows;
2664
2687
  inferRuntimeLegacyHttpResponseSource: typeof inferRuntimeLegacyHttpResponseSource;
2688
+ isDistributedReportHistoryExecution: typeof isDistributedReportHistoryExecution;
2665
2689
  isComparisonFailed: typeof isComparisonFailed;
2666
2690
  loadJsonObject: typeof loadJsonObject;
2667
2691
  logLevelOrder: typeof logLevelOrder;
@@ -2691,6 +2715,7 @@ export declare const __loadstrikeTestExports: {
2691
2715
  parseStrictBooleanToken: typeof parseStrictBooleanToken;
2692
2716
  percentile: typeof percentile;
2693
2717
  pickOptionalTrackingSelectorString: typeof pickOptionalTrackingSelectorString;
2718
+ pickTrackingValue: typeof pickTrackingValue;
2694
2719
  pickTrackingNumber: typeof pickTrackingNumber;
2695
2720
  produceOrConsumeTrackingPayload: typeof produceOrConsumeTrackingPayload;
2696
2721
  readConfiguredSinkName: typeof readConfiguredSinkName;
@@ -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>;
@@ -849,6 +849,9 @@ declare function createRealtimeStatsEvents(session: SinkSessionMetadata, scenari
849
849
  declare function createFinalStatsEvents(session: SinkSessionMetadata, stats: LoadStrikeNodeStats): ReportingSinkEvent[];
850
850
  declare function createRunResultEvents(session: SinkSessionMetadata, result: LoadStrikeRunResult): ReportingSinkEvent[];
851
851
  declare function createReportingEvent(session: SinkSessionMetadata, occurredUtc: Date, eventType: string, scenarioName: string | null, stepName: string | null, tags: Record<string, string>, fields: Record<string, unknown>): ReportingSinkEvent;
852
+ declare function createIterationObservationEvents(session: SinkSessionMetadata, batch: LoadStrikeIterationObservationBatchV1): ReportingSinkEvent[];
853
+ declare function createIterationCompletionEvents(session: SinkSessionMetadata, completion: LoadStrikeIterationObservationStreamCompletionV1): ReportingSinkEvent[];
854
+ declare function portalEventPayload(event: ReportingSinkEvent, index: number): Record<string, unknown>;
852
855
  declare function toOtelAnyValue(value: unknown): Record<string, unknown>;
853
856
  declare function sinkSessionMetadataFromContext(context: LoadStrikeBaseContext, session?: LoadStrikeSessionStartInfo, options?: {
854
857
  distinctRunIdFallback?: boolean;
@@ -897,6 +900,8 @@ export declare const __loadstrikeTestExports: {
897
900
  cloneScenarioStats: typeof cloneScenarioStats;
898
901
  cloneSessionStartInfo: typeof cloneSessionStartInfo;
899
902
  createFinalStatsEvents: typeof createFinalStatsEvents;
903
+ createIterationCompletionEvents: typeof createIterationCompletionEvents;
904
+ createIterationObservationEvents: typeof createIterationObservationEvents;
900
905
  createRealtimeStatsEvents: typeof createRealtimeStatsEvents;
901
906
  createRunResultEvents: typeof createRunResultEvents;
902
907
  createReportingEvent: typeof createReportingEvent;
@@ -913,6 +918,7 @@ export declare const __loadstrikeTestExports: {
913
918
  normalizeStringMap: typeof normalizeStringMap;
914
919
  optionNumber: typeof optionNumber;
915
920
  optionString: typeof optionString;
921
+ portalEventPayload: typeof portalEventPayload;
916
922
  pickBooleanValue: typeof pickBooleanValue;
917
923
  pickRecordValue: typeof pickRecordValue;
918
924
  postWithTimeout: typeof postWithTimeout;
@@ -1072,6 +1072,8 @@ declare function validateTrackingSelectorPath(expression: string, fieldName: "Tr
1072
1072
  declare function validateHttpEndpoint(endpoint: EndpointDefinition, mode: EndpointMode, hasModeDelegate: boolean): void;
1073
1073
  declare function applyHttpAuthHeaders(headers: Record<string, string>, options: HttpEndpointOptions, resolveOAuthToken: () => Promise<string>): Promise<void>;
1074
1074
  declare function buildHttpRequestBody(body: unknown, bodyType: NonNullable<HttpEndpointOptions["bodyType"]>, contentType: string): unknown;
1075
+ declare function extractJsonPath(value: unknown, arrayPath?: string): unknown;
1076
+ declare function headersToRecord(value: Headers): Record<string, string>;
1075
1077
  declare function partitionFromKey(value: string, partitionCount: number): string;
1076
1078
  declare function attachPayloadHelpers(payload: TrackingPayload): TrackingPayload;
1077
1079
  declare function attachDotNetTrackingPayloadAliases<T extends TrackingPayload>(payload: T): T;
@@ -1142,8 +1144,10 @@ export declare const __loadstrikeTestExports: {
1142
1144
  createNatsHeaders: typeof createNatsHeaders;
1143
1145
  createRedisStreamPayload: typeof createRedisStreamPayload;
1144
1146
  deserializeBrokerPayloadBody: typeof deserializeBrokerPayloadBody;
1147
+ extractJsonPath: typeof extractJsonPath;
1145
1148
  extractTrackingValue: typeof extractTrackingValue;
1146
1149
  fromKafkaHeaders: typeof fromKafkaHeaders;
1150
+ headersToRecord: typeof headersToRecord;
1147
1151
  headerValue: typeof headerValue;
1148
1152
  attachDotNetTrackingPayloadAliases: typeof attachDotNetTrackingPayloadAliases;
1149
1153
  attachPayloadHelpers: typeof attachPayloadHelpers;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loadstrike/loadstrike-sdk",
3
- "version": "1.0.30401",
3
+ "version": "1.0.31601",
4
4
  "description": "TypeScript and JavaScript SDK for in-process load execution, traffic correlation, and reporting.",
5
5
  "keywords": [
6
6
  "load-testing",
@@ -81,7 +81,7 @@
81
81
  "typescript": "^5.9.2"
82
82
  },
83
83
  "overrides": {
84
- "brace-expansion": "5.0.7",
84
+ "brace-expansion": "5.0.8",
85
85
  "tar": "7.5.21"
86
86
  }
87
87
  }