@loadstrike/loadstrike-sdk 1.0.30201 → 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 +122 -12
- 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 +122 -12
- 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/cluster.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { type EndpointAdapter, type EndpointDefinition } from "./transports.js";
|
|
1
2
|
export interface ClusterScenarioDispatch {
|
|
2
3
|
scenarioNames: string[];
|
|
3
4
|
commandId?: string;
|
|
4
5
|
agentRunToken?: string;
|
|
5
6
|
agentIndex?: number;
|
|
6
7
|
agentCount?: number;
|
|
8
|
+
segmentLifecycle?: {
|
|
9
|
+
beforeSegment: (scenarioIndex: number, simulationIndex: number) => Promise<void>;
|
|
10
|
+
afterSegment: (scenarioIndex: number, simulationIndex: number) => Promise<void>;
|
|
11
|
+
};
|
|
7
12
|
}
|
|
8
13
|
export interface ClusterNodeResult {
|
|
9
14
|
nodeId: string;
|
|
@@ -73,6 +78,13 @@ export interface ClusterNodeStatsPayload {
|
|
|
73
78
|
nodeInfo?: Record<string, unknown>;
|
|
74
79
|
testInfo?: Record<string, unknown>;
|
|
75
80
|
logFiles?: string[];
|
|
81
|
+
generatorWarnings?: unknown[];
|
|
82
|
+
observationDeliveryStats?: Record<string, unknown>;
|
|
83
|
+
reportingComplete?: boolean;
|
|
84
|
+
schedulerSegments?: unknown[];
|
|
85
|
+
schedulerStats?: Record<string, unknown>;
|
|
86
|
+
histogramSidecars?: unknown[];
|
|
87
|
+
histogramArtifactBase64?: string;
|
|
76
88
|
}
|
|
77
89
|
export interface ClusterRunResultMessage {
|
|
78
90
|
commandId: string;
|
|
@@ -81,6 +93,328 @@ export interface ClusterRunResultMessage {
|
|
|
81
93
|
errorMessage?: string;
|
|
82
94
|
stats?: ClusterNodeStatsPayload;
|
|
83
95
|
}
|
|
96
|
+
export declare const LOAD_ENGINE_V2_CLUSTER_CAPABILITIES: Readonly<{
|
|
97
|
+
schedulerVersions: string[];
|
|
98
|
+
histogramVersions: string[];
|
|
99
|
+
shardingVersions: string[];
|
|
100
|
+
resultChunkVersions: string[];
|
|
101
|
+
iterationObservationSchemas: string[];
|
|
102
|
+
correlationSetVersions: string[];
|
|
103
|
+
planHashVersions: string[];
|
|
104
|
+
callbackExecutionModes: string[];
|
|
105
|
+
maximumResultChunkBytes: number;
|
|
106
|
+
}>;
|
|
107
|
+
export interface LoadEngineV2Registration {
|
|
108
|
+
runId: string;
|
|
109
|
+
sessionId: string;
|
|
110
|
+
coordinatorNonce: string;
|
|
111
|
+
agentId: string;
|
|
112
|
+
targetSubject: string;
|
|
113
|
+
processInstanceId: string;
|
|
114
|
+
schedulerVisibleProcessorCount: number;
|
|
115
|
+
sdkLanguage: string;
|
|
116
|
+
sdkPackageVersion: string;
|
|
117
|
+
runtimeVersion: string;
|
|
118
|
+
registrationSequence64: string;
|
|
119
|
+
leaseIssuedUtcNs64: string;
|
|
120
|
+
leaseExpiresUtcNs64: string;
|
|
121
|
+
schedulerVersions: string[];
|
|
122
|
+
histogramVersions: string[];
|
|
123
|
+
shardingVersions: string[];
|
|
124
|
+
resultChunkVersions: string[];
|
|
125
|
+
iterationObservationSchemas: string[];
|
|
126
|
+
correlationSetVersions: string[];
|
|
127
|
+
planHashVersions: string[];
|
|
128
|
+
callbackExecutionModes: string[];
|
|
129
|
+
maximumResultChunkBytes: number;
|
|
130
|
+
registrationBindingHash: string;
|
|
131
|
+
}
|
|
132
|
+
export interface LoadEngineV2RegistrationInput {
|
|
133
|
+
runId: string;
|
|
134
|
+
sessionId: string;
|
|
135
|
+
coordinatorNonce: string;
|
|
136
|
+
agentId: string;
|
|
137
|
+
targetSubject: string;
|
|
138
|
+
processInstanceId?: string;
|
|
139
|
+
schedulerVisibleProcessorCount?: number;
|
|
140
|
+
sdkLanguage?: string;
|
|
141
|
+
sdkPackageVersion?: string;
|
|
142
|
+
runtimeVersion?: string;
|
|
143
|
+
registrationSequence64: string;
|
|
144
|
+
leaseIssuedUtcNs64: string;
|
|
145
|
+
leaseExpiresUtcNs64: string;
|
|
146
|
+
capabilities?: Partial<typeof LOAD_ENGINE_V2_CLUSTER_CAPABILITIES>;
|
|
147
|
+
}
|
|
148
|
+
export declare function createLoadEngineV2Registration(input: LoadEngineV2RegistrationInput): LoadEngineV2Registration;
|
|
149
|
+
export declare function negotiateLoadEngineV2Registrations(runId: string, sessionId: string, coordinatorNonce: string, expectedAgentIds: readonly string[], registrations: readonly LoadEngineV2Registration[], nowUtcNs64: string): LoadEngineV2Registration[];
|
|
150
|
+
export interface LoadEngineV2CoordinatorHello {
|
|
151
|
+
runId: string;
|
|
152
|
+
sessionId: string;
|
|
153
|
+
coordinatorNonce: string;
|
|
154
|
+
registrationSubject: string;
|
|
155
|
+
expiresUtcNs64: string;
|
|
156
|
+
expectedAgentIds: string[];
|
|
157
|
+
bindingHash: string;
|
|
158
|
+
}
|
|
159
|
+
export declare function buildLoadEngineV2ScopedRegistrationSubject(runId: string, sessionId: string, coordinatorNonce: string): string;
|
|
160
|
+
export declare function buildLoadEngineV2ScopedTargetSubject(runId: string, sessionId: string, coordinatorNonce: string, agentId: string): string;
|
|
161
|
+
export declare function buildLoadEngineV2GlobalInvocationId(runId: string, scenarioIndex: number | bigint, simulationIndex: number | bigint, identityKind: string, primaryOrdinal: string | number | bigint, secondaryOrdinal: string | number | bigint): string;
|
|
162
|
+
export declare function createLoadEngineV2CoordinatorHello(input: Omit<LoadEngineV2CoordinatorHello, "bindingHash" | "expectedAgentIds"> & {
|
|
163
|
+
expectedAgentIds: string[];
|
|
164
|
+
}): LoadEngineV2CoordinatorHello;
|
|
165
|
+
export declare function validateLoadEngineV2CoordinatorHello(hello: LoadEngineV2CoordinatorHello, expectedSessionId: string, expectedAgentId: string, nowUtcNs64: string): void;
|
|
166
|
+
export interface LoadEngineV2PlanSimulationInput {
|
|
167
|
+
simulationIndex64: string;
|
|
168
|
+
kind: string;
|
|
169
|
+
rate64: string;
|
|
170
|
+
minRate64: string;
|
|
171
|
+
maxRate64: string;
|
|
172
|
+
copies64: string;
|
|
173
|
+
iterations64: string;
|
|
174
|
+
intervalNs64: string;
|
|
175
|
+
durationNs64: string;
|
|
176
|
+
}
|
|
177
|
+
export interface LoadEngineV2PlanScenarioInput {
|
|
178
|
+
scenarioIndex64: string;
|
|
179
|
+
scenarioName: string;
|
|
180
|
+
target: "agent" | "coordinator";
|
|
181
|
+
callbackExecutionMode?: "async" | "blocking";
|
|
182
|
+
declaredStepNames?: string[];
|
|
183
|
+
simulations: LoadEngineV2PlanSimulationInput[];
|
|
184
|
+
}
|
|
185
|
+
export interface LoadEngineV2PlanInput {
|
|
186
|
+
runId: string;
|
|
187
|
+
sessionId: string;
|
|
188
|
+
registrationNonce: string;
|
|
189
|
+
maxInFlight64: string;
|
|
190
|
+
reportingIntervalNs64: string;
|
|
191
|
+
schedulerSeed64?: string;
|
|
192
|
+
schedulerVisibleProcessorCount64?: string;
|
|
193
|
+
maxStatisticsStateBytes64?: string;
|
|
194
|
+
maxDistributionSeries64?: string;
|
|
195
|
+
maxCorrelationGroups64?: string;
|
|
196
|
+
maxStatusGroupsPerSeries64?: string;
|
|
197
|
+
maxPortalRunDistributionBytes64?: string;
|
|
198
|
+
expectedAgentIds: string[];
|
|
199
|
+
scenarios: LoadEngineV2PlanScenarioInput[];
|
|
200
|
+
}
|
|
201
|
+
export interface LoadEngineV2PortalSeriesRecord {
|
|
202
|
+
seriesKeyHex: string;
|
|
203
|
+
unit: "microseconds" | "bytes";
|
|
204
|
+
outcome: "ok" | "fail" | "all" | "none";
|
|
205
|
+
}
|
|
206
|
+
export interface LoadEngineV2Plan {
|
|
207
|
+
bytes: Buffer;
|
|
208
|
+
hash: string;
|
|
209
|
+
expectedAgentIds: string[];
|
|
210
|
+
portalSeries: LoadEngineV2PortalSeriesRecord[];
|
|
211
|
+
}
|
|
212
|
+
export declare function buildLoadEngineV2Plan(input: LoadEngineV2PlanInput): LoadEngineV2Plan;
|
|
213
|
+
/** Canonical LoadStrikeIdentityKeyV1 scenario bytes. */
|
|
214
|
+
export declare function buildLoadEngineV2ScenarioIdentityKey(scenarioIndex64: string): Buffer;
|
|
215
|
+
/** Canonical LoadStrikeIdentityKeyV1 reserved step-other bytes. */
|
|
216
|
+
export declare function buildLoadEngineV2ReservedStepOtherIdentityKey(scenarioIndex64: string): Buffer;
|
|
217
|
+
export declare function buildLoadEngineV2StepIdentityKey(scenarioIndex64: string, stepName: string): {
|
|
218
|
+
identity: Buffer;
|
|
219
|
+
display: string;
|
|
220
|
+
};
|
|
221
|
+
/** Resolves a runtime step to its frozen signed identity or the reserved `<other>` bucket. */
|
|
222
|
+
export declare function resolveLoadEngineV2StepIdentityKey(scenarioIndex64: string, stepName: string, declaredStepNames: readonly string[]): {
|
|
223
|
+
identity: Buffer;
|
|
224
|
+
display: string;
|
|
225
|
+
routedToOther: boolean;
|
|
226
|
+
};
|
|
227
|
+
export declare function buildLoadEngineV2SchedulerIdentityKey(kind: "decision" | "start", scenarioIndex64: string, simulationIndex64: string): Buffer;
|
|
228
|
+
export declare function buildLoadEngineV2StatusIdentityKey(status: string, message: string): {
|
|
229
|
+
identity: Buffer;
|
|
230
|
+
display: string;
|
|
231
|
+
} | undefined;
|
|
232
|
+
/** Canonical LoadStrikePortalSeriesKeyV1 bytes. */
|
|
233
|
+
export declare function buildLoadEngineV2PortalSeriesKey(identity: Uint8Array, unit: "microseconds" | "bytes", outcome: "ok" | "fail" | "all" | "none"): Buffer;
|
|
234
|
+
export interface LoadEngineV2BarrierAssignmentInput {
|
|
235
|
+
scenarioIndex64: string;
|
|
236
|
+
simulationIndex64: string;
|
|
237
|
+
trafficMixId?: string;
|
|
238
|
+
trafficMixLaneIndex64?: string;
|
|
239
|
+
trafficMixPhaseIndex64?: string;
|
|
240
|
+
agentId: string;
|
|
241
|
+
shardIndex64: string;
|
|
242
|
+
shardCount64: string;
|
|
243
|
+
}
|
|
244
|
+
export declare function buildLoadEngineV2BarrierScopeId(planHash: string, scope: {
|
|
245
|
+
kind: "scenario";
|
|
246
|
+
scenarioIndex64: string;
|
|
247
|
+
simulationIndex64: string;
|
|
248
|
+
} | {
|
|
249
|
+
kind: "traffic-mix";
|
|
250
|
+
trafficMixId: string;
|
|
251
|
+
trafficMixPhaseIndex64: string;
|
|
252
|
+
}): string;
|
|
253
|
+
export declare function buildLoadEngineV2AssignmentHash(barrierScopeId: string, assignments: readonly LoadEngineV2BarrierAssignmentInput[]): string;
|
|
254
|
+
export interface LoadEngineV2BarrierAck {
|
|
255
|
+
phase: string;
|
|
256
|
+
agentId: string;
|
|
257
|
+
accepted: boolean;
|
|
258
|
+
planHash: string;
|
|
259
|
+
barrierScopeId?: string;
|
|
260
|
+
assignmentHash: string;
|
|
261
|
+
barrierEpoch64: string;
|
|
262
|
+
deadlineUtcNs64: string;
|
|
263
|
+
acknowledgedUtcNs64: string;
|
|
264
|
+
}
|
|
265
|
+
export interface LoadEngineV2ClockProbeSample {
|
|
266
|
+
probeIndex: number;
|
|
267
|
+
coordinatorSendUtcNs64: string;
|
|
268
|
+
agentReceiveUtcNs64: string;
|
|
269
|
+
agentSendUtcNs64: string;
|
|
270
|
+
coordinatorReceiveUtcNs64: string;
|
|
271
|
+
coordinatorClockResolutionNs64: string;
|
|
272
|
+
agentClockResolutionNs64: string;
|
|
273
|
+
}
|
|
274
|
+
export interface LoadEngineV2ClockProbeResult extends LoadEngineV2ClockProbeSample {
|
|
275
|
+
roundTripNs64: string;
|
|
276
|
+
offsetAgentMinusCoordinatorNs64: string;
|
|
277
|
+
uncertaintyNs64: string;
|
|
278
|
+
}
|
|
279
|
+
export declare function evaluateLoadEngineV2ClockProbe(sample: LoadEngineV2ClockProbeSample): LoadEngineV2ClockProbeResult;
|
|
280
|
+
export declare function selectLoadEngineV2ClockProbe(samples: readonly LoadEngineV2ClockProbeSample[], latenessToleranceNs64?: string): LoadEngineV2ClockProbeResult;
|
|
281
|
+
export declare function validateLoadEngineV2BarrierAcks(phase: string, expectedAgentIds: readonly string[], acknowledgements: readonly LoadEngineV2BarrierAck[], planHash: string, assignmentHash: string, barrierEpoch64: string, nowUtcNs64: string, barrierScopeId?: string): void;
|
|
282
|
+
export interface LoadEngineV2ResultArtifact {
|
|
283
|
+
kind: string;
|
|
284
|
+
artifactId: string;
|
|
285
|
+
schema: string;
|
|
286
|
+
applicability: "present" | "empty" | "not-applicable";
|
|
287
|
+
payload: Buffer;
|
|
288
|
+
}
|
|
289
|
+
export interface LoadEngineV2ResultManifestEntry {
|
|
290
|
+
kind: string;
|
|
291
|
+
artifactId: string;
|
|
292
|
+
schema: string;
|
|
293
|
+
applicability: "present" | "empty" | "not-applicable";
|
|
294
|
+
uncompressedLength64: string;
|
|
295
|
+
chunkCount: number;
|
|
296
|
+
artifactSha256: string;
|
|
297
|
+
}
|
|
298
|
+
export interface LoadEngineV2ResultManifest {
|
|
299
|
+
runId: string;
|
|
300
|
+
sessionId: string;
|
|
301
|
+
resultOwnerId: string;
|
|
302
|
+
snapshotSequence64: string;
|
|
303
|
+
planHash: string;
|
|
304
|
+
isFinal: boolean;
|
|
305
|
+
correlationDetailPartCount: number;
|
|
306
|
+
entries: LoadEngineV2ResultManifestEntry[];
|
|
307
|
+
bytes: Buffer;
|
|
308
|
+
hash: string;
|
|
309
|
+
}
|
|
310
|
+
export interface LoadEngineV2CanonicalResultChunk {
|
|
311
|
+
runId: string;
|
|
312
|
+
sessionId: string;
|
|
313
|
+
resultOwnerId: string;
|
|
314
|
+
snapshotSequence64: string;
|
|
315
|
+
manifestSha256: string;
|
|
316
|
+
kind: string;
|
|
317
|
+
artifactId: string;
|
|
318
|
+
schema: string;
|
|
319
|
+
artifactSha256: string;
|
|
320
|
+
chunkIndex: number;
|
|
321
|
+
chunkCount: number;
|
|
322
|
+
uncompressedTotalLength64: string;
|
|
323
|
+
payload: Buffer;
|
|
324
|
+
chunkSha256: string;
|
|
325
|
+
bytes: Buffer;
|
|
326
|
+
}
|
|
327
|
+
export interface LoadEngineV2ResultCommit {
|
|
328
|
+
runId: string;
|
|
329
|
+
sessionId: string;
|
|
330
|
+
resultOwnerId: string;
|
|
331
|
+
snapshotSequence64: string;
|
|
332
|
+
planHash: string;
|
|
333
|
+
manifestLength: number;
|
|
334
|
+
manifestSha256: string;
|
|
335
|
+
entryCount: number;
|
|
336
|
+
totalNonDetailBytes64: string;
|
|
337
|
+
totalDetailBytes64: string;
|
|
338
|
+
bytes: Buffer;
|
|
339
|
+
}
|
|
340
|
+
export interface LoadEngineV2ResultSnapshot {
|
|
341
|
+
manifest: LoadEngineV2ResultManifest;
|
|
342
|
+
chunks: LoadEngineV2CanonicalResultChunk[];
|
|
343
|
+
commit: LoadEngineV2ResultCommit;
|
|
344
|
+
}
|
|
345
|
+
export declare function loadEngineV2PresentArtifact(kind: string, artifactId: string, schema: string, payload: Uint8Array): LoadEngineV2ResultArtifact;
|
|
346
|
+
export declare function loadEngineV2EmptyArtifact(kind: string, artifactId: string, schema: string): LoadEngineV2ResultArtifact;
|
|
347
|
+
export declare function loadEngineV2NotApplicableArtifact(kind: string, artifactId: string): LoadEngineV2ResultArtifact;
|
|
348
|
+
export declare function createLoadEngineV2ResultSnapshot(runId: string, sessionId: string, resultOwnerId: string, snapshotSequence64: string, planHash: string, isFinal: boolean, chunkBytes: number, artifacts: readonly LoadEngineV2ResultArtifact[]): LoadEngineV2ResultSnapshot;
|
|
349
|
+
export declare function decodeLoadEngineV2ResultManifest(bytesValue: Uint8Array): LoadEngineV2ResultManifest;
|
|
350
|
+
export declare function decodeLoadEngineV2ResultChunk(bytesValue: Uint8Array, maximumChunkBytes: number): LoadEngineV2CanonicalResultChunk;
|
|
351
|
+
export declare function decodeLoadEngineV2ResultCommit(bytesValue: Uint8Array): LoadEngineV2ResultCommit;
|
|
352
|
+
export declare class LoadEngineV2ResultSnapshotReceiver {
|
|
353
|
+
private readonly runId;
|
|
354
|
+
private readonly sessionId;
|
|
355
|
+
private readonly resultOwnerId;
|
|
356
|
+
private readonly planHash;
|
|
357
|
+
private readonly chunkBytes;
|
|
358
|
+
private readonly maximumResultBytes;
|
|
359
|
+
private lastSequence;
|
|
360
|
+
private lastManifestHash;
|
|
361
|
+
private lastCommitBytes;
|
|
362
|
+
private lastArtifacts;
|
|
363
|
+
private pending?;
|
|
364
|
+
private ownerLost;
|
|
365
|
+
constructor(runId: string, sessionId: string, resultOwnerId: string, planHash: string, chunkBytes: number, maximumResultBytes: number);
|
|
366
|
+
begin(manifest: LoadEngineV2ResultManifest): void;
|
|
367
|
+
add(chunk: LoadEngineV2CanonicalResultChunk): void;
|
|
368
|
+
get hasCompleteSnapshot(): boolean;
|
|
369
|
+
commitSnapshot(commit: LoadEngineV2ResultCommit): Map<string, Buffer>;
|
|
370
|
+
sealOwnerLost(): void;
|
|
371
|
+
}
|
|
372
|
+
export interface LoadEngineV2ResultChunk {
|
|
373
|
+
commandId: string;
|
|
374
|
+
agentId: string;
|
|
375
|
+
chunkIndex: number;
|
|
376
|
+
chunkCount: number;
|
|
377
|
+
totalLength64: string;
|
|
378
|
+
payloadSha256: string;
|
|
379
|
+
chunkSha256: string;
|
|
380
|
+
dataBase64: string;
|
|
381
|
+
}
|
|
382
|
+
export declare function createLoadEngineV2ResultChunks(result: ClusterRunResultMessage | Record<string, unknown>, chunkBytes?: number): LoadEngineV2ResultChunk[];
|
|
383
|
+
export declare class LoadEngineV2ResultChunkAccumulator {
|
|
384
|
+
private readonly maximumResultBytes;
|
|
385
|
+
private manifest;
|
|
386
|
+
private readonly chunks;
|
|
387
|
+
private complete;
|
|
388
|
+
constructor(maximumResultBytes?: number);
|
|
389
|
+
add(message: LoadEngineV2ResultChunk): ClusterRunResultMessage | Record<string, unknown> | undefined;
|
|
390
|
+
}
|
|
391
|
+
export interface LoadEngineV2OwnerLossInput {
|
|
392
|
+
missingAgentIds: string[];
|
|
393
|
+
assignments: Array<{
|
|
394
|
+
agentId: string;
|
|
395
|
+
shardIndex64: string;
|
|
396
|
+
shardCount64: string;
|
|
397
|
+
scenarios: Array<{
|
|
398
|
+
scenarioName: string;
|
|
399
|
+
scenarioIndex64: string;
|
|
400
|
+
simulations: Array<{
|
|
401
|
+
simulationIndex64: string;
|
|
402
|
+
kind: string;
|
|
403
|
+
plannedIterations64: string;
|
|
404
|
+
}>;
|
|
405
|
+
}>;
|
|
406
|
+
}>;
|
|
407
|
+
}
|
|
408
|
+
export declare function buildLoadEngineV2OwnerLoss(input: LoadEngineV2OwnerLossInput): {
|
|
409
|
+
reportingComplete: false;
|
|
410
|
+
applicationFailureCount64: "0";
|
|
411
|
+
generatorWarnings: Array<{
|
|
412
|
+
code: string;
|
|
413
|
+
agentId: string;
|
|
414
|
+
count64: string;
|
|
415
|
+
}>;
|
|
416
|
+
schedulerSegments: Array<Record<string, unknown>>;
|
|
417
|
+
};
|
|
84
418
|
export interface DistributedClusterCoordinatorOptions {
|
|
85
419
|
clusterId: string;
|
|
86
420
|
sessionId: string;
|
|
@@ -90,6 +424,15 @@ export interface DistributedClusterCoordinatorOptions {
|
|
|
90
424
|
agentGroup?: string;
|
|
91
425
|
commandTimeoutMs?: number;
|
|
92
426
|
nats?: Record<string, unknown>;
|
|
427
|
+
expectedAgentIds?: string[];
|
|
428
|
+
loadEngineContractVersion?: 1 | 2;
|
|
429
|
+
barrierLeadTimeMs?: number;
|
|
430
|
+
adapterFactory?: ClusterEndpointAdapterFactory;
|
|
431
|
+
/** @internal Clock adapter resolution used by exact protocol harnesses. */
|
|
432
|
+
v2ClockResolutionNs64?: string;
|
|
433
|
+
}
|
|
434
|
+
export interface ClusterEndpointAdapterFactory {
|
|
435
|
+
create(definition: EndpointDefinition): EndpointAdapter;
|
|
93
436
|
}
|
|
94
437
|
export interface DistributedClusterDispatchResult {
|
|
95
438
|
nodeResults: ClusterNodeResult[];
|
|
@@ -100,6 +443,7 @@ export interface DistributedClusterDispatchResult {
|
|
|
100
443
|
missingNodes: number;
|
|
101
444
|
runSubject: string;
|
|
102
445
|
replySubject: string;
|
|
446
|
+
ownerLoss?: ReturnType<typeof buildLoadEngineV2OwnerLoss>;
|
|
103
447
|
}
|
|
104
448
|
export declare class DistributedClusterCoordinator {
|
|
105
449
|
private readonly options;
|
|
@@ -109,8 +453,11 @@ export declare class DistributedClusterCoordinator {
|
|
|
109
453
|
*/
|
|
110
454
|
constructor(options: DistributedClusterCoordinatorOptions);
|
|
111
455
|
dispatch(assignments: string[][], buildAgentRunToken?: (command: ClusterRunCommandMessage) => Promise<string>): Promise<DistributedClusterDispatchResult>;
|
|
456
|
+
/** Runs the native V2 capability, targeted-command, barrier, and chunk-result protocol. */
|
|
457
|
+
dispatchV2(assignments: string[][], planInput: LoadEngineV2PlanInput, buildAgentRunToken?: (command: ClusterRunCommandMessage) => Promise<string>): Promise<DistributedClusterDispatchResult>;
|
|
112
458
|
private buildRunSubject;
|
|
113
459
|
private buildReplySubject;
|
|
460
|
+
private createAdapter;
|
|
114
461
|
private natsEndpoint;
|
|
115
462
|
}
|
|
116
463
|
export interface DistributedClusterAgentOptions {
|
|
@@ -119,10 +466,28 @@ export interface DistributedClusterAgentOptions {
|
|
|
119
466
|
agentId: string;
|
|
120
467
|
agentGroup?: string;
|
|
121
468
|
nats?: Record<string, unknown>;
|
|
469
|
+
loadEngineContractVersion?: 1 | 2;
|
|
470
|
+
adapterFactory?: ClusterEndpointAdapterFactory;
|
|
471
|
+
/** @internal Validates received signed descriptors against immutable local declarations. */
|
|
472
|
+
validateV2Plan?: (planInput: LoadEngineV2PlanInput) => void;
|
|
473
|
+
/** @internal Exact conformance harness capability override. */
|
|
474
|
+
v2Capabilities?: Partial<typeof LOAD_ENGINE_V2_CLUSTER_CAPABILITIES>;
|
|
475
|
+
/** @internal Clock adapter resolution used by exact protocol harnesses. */
|
|
476
|
+
v2ClockResolutionNs64?: string;
|
|
122
477
|
}
|
|
123
478
|
export declare class DistributedClusterAgent {
|
|
124
479
|
private readonly options;
|
|
125
480
|
private commandConsumer;
|
|
481
|
+
private v2HelloConsumer;
|
|
482
|
+
private v2CommandConsumer;
|
|
483
|
+
private v2RegistrationProducer;
|
|
484
|
+
private v2LastRegistrationMs;
|
|
485
|
+
private v2Hello;
|
|
486
|
+
private v2CurrentRegistration;
|
|
487
|
+
private v2RegistrationSequence;
|
|
488
|
+
private v2RenewalTimer;
|
|
489
|
+
private v2RenewalError;
|
|
490
|
+
private v2Prepared;
|
|
126
491
|
/**
|
|
127
492
|
* Exposes the public constructor operation.
|
|
128
493
|
* Use this when the surrounding wrapper type makes this operation the clearest way to express your intent.
|
|
@@ -130,9 +495,22 @@ export declare class DistributedClusterAgent {
|
|
|
130
495
|
constructor(options: DistributedClusterAgentOptions);
|
|
131
496
|
dispose(): Promise<void>;
|
|
132
497
|
pollAndExecuteOnce(execute: (dispatch: ClusterScenarioDispatch) => Promise<ClusterNodeResult> | ClusterNodeResult): Promise<boolean>;
|
|
498
|
+
/** Polls one targeted V2 message. A callback can run only after a matching commit. */
|
|
499
|
+
pollAndExecuteV2Once(execute: (dispatch: ClusterScenarioDispatch) => Promise<ClusterNodeResult> | ClusterNodeResult): Promise<boolean>;
|
|
500
|
+
private publishV2CanonicalResult;
|
|
501
|
+
private publishV2ClockProbe;
|
|
502
|
+
private acceptV2Prepare;
|
|
503
|
+
private acceptV2Commit;
|
|
504
|
+
private ensureV2Registration;
|
|
505
|
+
private ensureV2CommandConsumer;
|
|
506
|
+
private publishV2Registration;
|
|
507
|
+
private matchesV2Scope;
|
|
508
|
+
private publishV2Ack;
|
|
509
|
+
private endpoint;
|
|
510
|
+
private createAdapter;
|
|
133
511
|
}
|
|
134
512
|
declare function parseRunCommand(value: Record<string, unknown>): ClusterRunCommandMessage;
|
|
135
|
-
declare function parseRunResult(value: Record<string, unknown
|
|
513
|
+
declare function parseRunResult(value: Record<string, unknown>, requireHistogramArtifact?: boolean): ClusterRunResultMessage;
|
|
136
514
|
declare function convertRunResult(result: ClusterRunResultMessage): ClusterNodeResult;
|
|
137
515
|
declare function sanitizeToken(value: string): string;
|
|
138
516
|
declare function buildWeightedCycle(weights: number[]): number[];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export { LoadStrikeAutopilot, LoadStrikeAutopilotResult } from "./autopilot.js";
|
|
|
3
3
|
export type { LoadStrikeAutopilotEndpoint, LoadStrikeAutopilotEndpointBinding, LoadStrikeAutopilotLoadSimulationSuggestion, LoadStrikeAutopilotMessageSample, LoadStrikeAutopilotOptions, LoadStrikeAutopilotPlan, LoadStrikeAutopilotPreviewReport, LoadStrikeAutopilotReadinessFailure, LoadStrikeAutopilotRedaction, LoadStrikeAutopilotRequest, LoadStrikeAutopilotResultShape, LoadStrikeAutopilotScenarioPlan, LoadStrikeAutopilotSecretBinding, LoadStrikeAutopilotThresholdSuggestion, LoadStrikeAutopilotTrackingSelectorSuggestion } from "./autopilot-contracts.js";
|
|
4
4
|
export { LoadStrikeAutopilotReadiness } from "./autopilot-contracts.js";
|
|
5
5
|
export { CrossPlatformScenarioConfigurator, ScenarioTrackingExtensions, LoadStrikeContext, LoadStrikeAccessibility, LoadStrikeAccessibilityAdapters, LoadStrikeAccessibilityBaseline, LoadStrikeAccessibilityCiGate, LoadStrikeAccessibilityScanner, LoadStrikeBrowserWebVitals, LoadStrikeBrowserWebVitalsCollector, LoadStrikePluginData, LoadStrikePluginDataTable, LoadStrikeNodeType, LoadStrikeReportFormat, LoadStrikeResponse, LoadStrikeLogLevel, LoadStrikeScenarioOperation, LoadStrikeOperationType, LoadStrikeRunner, LoadStrikeScenario, LoadStrikeScenarioShare, LoadStrikeSimulation, LoadStrikeTrafficMix, CrossPlatformTrackingConfiguration, LoadStrikeMetric, LoadStrikeCounter, LoadStrikeGauge, LoadStrikeStep, LoadStrikeThreshold } from "./runtime.js";
|
|
6
|
-
export type { ILoadStrikeReportingSink, ILoadStrikeWorkerPlugin, LoadStrikeRunResult, LoadStrikeReportingSink, LoadStrikeRuntimePolicy, LoadStrikeRunnerOptions, LoadStrikeRunContext as LoadStrikeRuntimeContext, LoadStrikeRunContext, LoadStrikeAccessibilityOptions, LoadStrikeAccessibilityBaselineOutcome, LoadStrikeAccessibilityCiGateOutcome, LoadStrikeAccessibilityViolation, LoadStrikeKeyboardFocusResult, LoadStrikeAccessibilityResult, LoadStrikeAccessibilityCheckContext, LoadStrikeBrowserWebVitalsOptions, LoadStrikeBrowserWebVitalsResult, LoadStrikeBrowserWebVitalsContext, LoadStrikeBaseContext, LoadStrikeCounterStats, LoadStrikeDataTransferStats, LoadStrikeGaugeStats, LoadStrikeLogger, LoadStrikeLoadSimulationStats, LoadStrikeMeasurementStats, LoadStrikeMetricStats, LoadStrikeNodeInfo, LoadStrikeMetricValue, LoadStrikeRandom, LoadStrikeReply, LoadStrikeLatencyCount, LoadStrikeLatencyStats, LoadStrikeLoadSimulation, LoadStrikeScenarioInfo, LoadStrikeScenarioInitContext, LoadStrikeScenarioPartition, LoadStrikeScenarioStartInfo, LoadStrikeScenarioContext, LoadStrikeScenarioStats, LoadStrikeTestInfo, LoadStrikeScenarioRuntime, LoadStrikeSessionStartInfo, LoadStrikeSinkSession, LoadStrikeSinkError, LoadStrikeStatusCodeStats, LoadStrikeThresholdResult, LoadStrikeThresholdPredicateContext, LoadStrikeStepReply, LoadStrikeStepStats, LoadStrikeStepRuntime, LoadStrikeThresholdOptions, LoadStrikeRequestStats, LoadStrikeWorkerPlugin } from "./runtime.js";
|
|
6
|
+
export type { ILoadStrikeReportingSink, ILoadStrikeWorkerPlugin, LoadStrikeRunResult, LoadStrikeGeneratorWarning, LoadStrikeSchedulerSegmentStats, LoadStrikeSchedulerStats, LoadStrikeReportingSink, LoadStrikeRuntimePolicy, LoadStrikeRunnerOptions, LoadStrikeRunContext as LoadStrikeRuntimeContext, LoadStrikeRunContext, LoadStrikeAccessibilityOptions, LoadStrikeAccessibilityBaselineOutcome, LoadStrikeAccessibilityCiGateOutcome, LoadStrikeAccessibilityViolation, LoadStrikeKeyboardFocusResult, LoadStrikeAccessibilityResult, LoadStrikeAccessibilityCheckContext, LoadStrikeBrowserWebVitalsOptions, LoadStrikeBrowserWebVitalsResult, LoadStrikeBrowserWebVitalsContext, LoadStrikeBaseContext, LoadStrikeCounterStats, LoadStrikeDataTransferStats, LoadStrikeGaugeStats, LoadStrikeLogger, LoadStrikeLoadSimulationStats, LoadStrikeMeasurementStats, LoadStrikeMetricStats, LoadStrikeNodeInfo, LoadStrikeMetricValue, LoadStrikeRandom, LoadStrikeReply, LoadStrikeLatencyCount, LoadStrikeLatencyStats, LoadStrikeLoadSimulation, LoadStrikeScenarioInfo, LoadStrikeScenarioInitContext, LoadStrikeScenarioPartition, LoadStrikeScenarioStartInfo, LoadStrikeScenarioContext, LoadStrikeScenarioStats, LoadStrikeTestInfo, LoadStrikeScenarioRuntime, LoadStrikeSessionStartInfo, LoadStrikeSinkSession, LoadStrikeSinkError, LoadStrikeStatusCodeStats, LoadStrikeThresholdResult, LoadStrikeThresholdPredicateContext, LoadStrikeStepReply, LoadStrikeStepStats, LoadStrikeStepRuntime, LoadStrikeThresholdOptions, LoadStrikeRequestStats, LoadStrikeWorkerPlugin } from "./runtime.js";
|
|
7
|
+
export { DEFAULT_ITERATION_OBSERVATION_SETTINGS, ITERATION_OBSERVATION_BATCH_SCHEMA_VERSION, ITERATION_OBSERVATION_SCHEMA_VERSION, ITERATION_OBSERVATION_STREAM_COMPLETION_SCHEMA_VERSION, createIterationObservation, createIterationStepObservation, deriveIterationBatchId, deriveIterationId, deriveObservationId, serializeIterationObservationBatchGzipJson } from "./iteration-observations.js";
|
|
8
|
+
export type { CreateIterationObservationInput, CreateIterationStepObservationInput, IterationObservationSettings, LoadStrikeIterationObservationBatchV1, LoadStrikeIterationObservationStreamCompletionV1, LoadStrikeIterationObservationV1, LoadStrikeIterationStepObservationV1, LoadStrikeObservationDeliveryStats } from "./iteration-observations.js";
|
|
7
9
|
export { CorrelationStoreConfiguration, CrossPlatformTrackingRuntime, InMemoryCorrelationStore, RedisCorrelationStoreOptions, RedisCorrelationStore, TrackingPayloadBuilder, TrackingFieldSelector } from "./correlation.js";
|
|
8
10
|
export type { CorrelationEntry, DestinationConsumeResult, GatheredRow, CorrelationStoreKind, CorrelationRuntimeOptions, CorrelationRuntimePlugin, CorrelationRuntimeStats, CorrelationStore, SourceProduceResult, TrackingFieldLocation, TrackingPayload } from "./correlation.js";
|
|
9
11
|
export { LOADSTRIKE_TRACE_ID_HEADER, LOADSTRIKE_TRACE_ID_TRACKING_FIELD, TrafficEndpointDefinition, HttpEndpointDefinition, KafkaEndpointDefinition, KafkaSaslOptions, RabbitMqEndpointDefinition, NatsEndpointDefinition, RedisStreamsEndpointDefinition, AzureEventHubsEndpointDefinition, SqsEndpointDefinition, DelegateStreamEndpointDefinition, PushDiffusionEndpointDefinition, GrpcEndpointDefinition, GrpcMethodTypes, GrpcNativeClientOptions, GrpcStatusMapper, ProtocolMetricSnapshot, WebSocketEndpointDefinition, WebSocketExpectedMessage, WebSocketMessageSpec, WebSocketNativeClientOptions, WebSocketReconnectPolicy, HttpOAuth2ClientCredentialsOptions, HttpAuthOptions } from "./transports.js";
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
export declare const ITERATION_OBSERVATION_SCHEMA_VERSION = "loadstrike.iteration-observation/1";
|
|
2
|
+
export declare const ITERATION_OBSERVATION_BATCH_SCHEMA_VERSION = "loadstrike.iteration-batch/1";
|
|
3
|
+
export declare const ITERATION_OBSERVATION_STREAM_COMPLETION_SCHEMA_VERSION = "loadstrike.iteration-stream-completion/1";
|
|
4
|
+
export interface LoadStrikeIterationStepObservationV1 {
|
|
5
|
+
stepName: string;
|
|
6
|
+
sortIndex: number;
|
|
7
|
+
startedUtcNs: string;
|
|
8
|
+
completedUtcNs: string;
|
|
9
|
+
observedLatencyUs64: string;
|
|
10
|
+
reportedLatencyUs64: string;
|
|
11
|
+
isSuccess: boolean;
|
|
12
|
+
statusCode: string;
|
|
13
|
+
sizeBytes64: string;
|
|
14
|
+
}
|
|
15
|
+
export interface LoadStrikeIterationObservationV1 {
|
|
16
|
+
schemaVersion: typeof ITERATION_OBSERVATION_SCHEMA_VERSION;
|
|
17
|
+
observationId: string;
|
|
18
|
+
runId: string;
|
|
19
|
+
sessionId: string;
|
|
20
|
+
resultOwnerId: string;
|
|
21
|
+
processGroup: number;
|
|
22
|
+
scenarioName: string;
|
|
23
|
+
scenarioIndex: number;
|
|
24
|
+
simulationIndex: number;
|
|
25
|
+
simulationKind: string;
|
|
26
|
+
phase: "warmup" | "bombing";
|
|
27
|
+
globalOrdinal64: string;
|
|
28
|
+
globalSecondaryOrdinal64: string;
|
|
29
|
+
shardIndex: number;
|
|
30
|
+
shardCount: number;
|
|
31
|
+
iterationId: string;
|
|
32
|
+
attemptIndex: number;
|
|
33
|
+
isFinalAttempt: boolean;
|
|
34
|
+
startedUtcNs: string;
|
|
35
|
+
completedUtcNs: string;
|
|
36
|
+
observedLatencyUs64: string;
|
|
37
|
+
reportedLatencyUs64: string;
|
|
38
|
+
isSuccess: boolean;
|
|
39
|
+
statusCode: string;
|
|
40
|
+
sizeBytes64: string;
|
|
41
|
+
steps: LoadStrikeIterationStepObservationV1[];
|
|
42
|
+
}
|
|
43
|
+
export interface LoadStrikeIterationObservationBatchV1 {
|
|
44
|
+
schemaVersion: typeof ITERATION_OBSERVATION_BATCH_SCHEMA_VERSION;
|
|
45
|
+
batchId: string;
|
|
46
|
+
runId: string;
|
|
47
|
+
sessionId: string;
|
|
48
|
+
resultOwnerId: string;
|
|
49
|
+
processGroup: number;
|
|
50
|
+
batchSequence64: string;
|
|
51
|
+
createdUtcNs: string;
|
|
52
|
+
firstObservationUtcNs: string;
|
|
53
|
+
lastObservationUtcNs: string;
|
|
54
|
+
observations: LoadStrikeIterationObservationV1[];
|
|
55
|
+
capturedCount64: string;
|
|
56
|
+
droppedBeforeBatch64: string;
|
|
57
|
+
compression: "gzip-json";
|
|
58
|
+
}
|
|
59
|
+
export interface LoadStrikeIterationObservationStreamCompletionV1 {
|
|
60
|
+
schemaVersion: typeof ITERATION_OBSERVATION_STREAM_COMPLETION_SCHEMA_VERSION;
|
|
61
|
+
runId: string;
|
|
62
|
+
sessionId: string;
|
|
63
|
+
resultOwnerId: string;
|
|
64
|
+
/** Additive in schema v1. Readers must treat an absent value as "1". */
|
|
65
|
+
expectedResultOwnerCount64?: string;
|
|
66
|
+
processGroup: number;
|
|
67
|
+
lastBatchSequence64: string;
|
|
68
|
+
capturedCount64: string;
|
|
69
|
+
deliveredCount64: string;
|
|
70
|
+
droppedBufferCount64: string;
|
|
71
|
+
droppedSinkCount64: string;
|
|
72
|
+
reportingComplete: boolean;
|
|
73
|
+
completedUtcNs: string;
|
|
74
|
+
}
|
|
75
|
+
export interface LoadStrikeObservationDeliveryStats {
|
|
76
|
+
lastBatchSequence64: string;
|
|
77
|
+
capturedCount64: string;
|
|
78
|
+
deliveredCount64: string;
|
|
79
|
+
droppedBufferCount64: string;
|
|
80
|
+
droppedSinkCount64: string;
|
|
81
|
+
readonly LastBatchSequence64?: string;
|
|
82
|
+
readonly CapturedCount64?: string;
|
|
83
|
+
readonly DeliveredCount64?: string;
|
|
84
|
+
readonly DroppedBufferCount64?: string;
|
|
85
|
+
readonly DroppedSinkCount64?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface IterationObservationDeliveryResult extends LoadStrikeObservationDeliveryStats {
|
|
88
|
+
reportingComplete: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface IterationObservationGeneratorWarning {
|
|
91
|
+
code: string;
|
|
92
|
+
sinkName?: string;
|
|
93
|
+
scenarioName: string;
|
|
94
|
+
scenarioIndex: number;
|
|
95
|
+
simulationIndex: number;
|
|
96
|
+
simulationKind: string;
|
|
97
|
+
count64: string;
|
|
98
|
+
message: string;
|
|
99
|
+
firstObservedUtcNs: string;
|
|
100
|
+
lastObservedUtcNs: string;
|
|
101
|
+
}
|
|
102
|
+
export interface IterationObservationSettings {
|
|
103
|
+
flushIntervalMs: number;
|
|
104
|
+
maxBufferBytes: number;
|
|
105
|
+
maxObservationsPerBatch: number;
|
|
106
|
+
maxBatchBytes: number;
|
|
107
|
+
sinkQueueDepth: number;
|
|
108
|
+
sinkParallelism: number;
|
|
109
|
+
drainTimeoutMs: number;
|
|
110
|
+
}
|
|
111
|
+
export declare const DEFAULT_ITERATION_OBSERVATION_SETTINGS: Readonly<IterationObservationSettings>;
|
|
112
|
+
export interface IterationObservationClock {
|
|
113
|
+
nowUtcNs(): bigint;
|
|
114
|
+
setInterval(callback: () => void, intervalMs: number): unknown;
|
|
115
|
+
clearInterval(handle: unknown): void;
|
|
116
|
+
}
|
|
117
|
+
export interface IterationObservationSinkTarget {
|
|
118
|
+
name: string;
|
|
119
|
+
iterationObservationPortalSink?: boolean;
|
|
120
|
+
iterationObservationShapeLimited?: boolean;
|
|
121
|
+
saveIterationBatch?: (batch: LoadStrikeIterationObservationBatchV1) => Promise<void> | void;
|
|
122
|
+
completeIterationObservationStream?: (completion: LoadStrikeIterationObservationStreamCompletionV1) => Promise<void> | void;
|
|
123
|
+
}
|
|
124
|
+
export interface CreateIterationStepObservationInput {
|
|
125
|
+
stepName: string;
|
|
126
|
+
sortIndex: number;
|
|
127
|
+
startedUtcNs: string | bigint | number;
|
|
128
|
+
completedUtcNs: string | bigint | number;
|
|
129
|
+
observedLatencyUs64: string | bigint | number;
|
|
130
|
+
reportedLatencyUs64: string | bigint | number;
|
|
131
|
+
isSuccess: boolean;
|
|
132
|
+
statusCode: string;
|
|
133
|
+
sizeBytes64: string | bigint | number;
|
|
134
|
+
}
|
|
135
|
+
export interface CreateIterationObservationInput {
|
|
136
|
+
runId: string;
|
|
137
|
+
sessionId: string;
|
|
138
|
+
resultOwnerId: string;
|
|
139
|
+
processGroup: number;
|
|
140
|
+
scenarioName: string;
|
|
141
|
+
scenarioIndex: number;
|
|
142
|
+
simulationIndex: number;
|
|
143
|
+
simulationKind: string;
|
|
144
|
+
phase: "warmup" | "bombing";
|
|
145
|
+
globalOrdinal64: string | bigint | number;
|
|
146
|
+
globalSecondaryOrdinal64?: string | bigint | number;
|
|
147
|
+
iterationId?: string;
|
|
148
|
+
shardIndex: number;
|
|
149
|
+
shardCount: number;
|
|
150
|
+
attemptIndex: number;
|
|
151
|
+
isFinalAttempt: boolean;
|
|
152
|
+
startedUtcNs: string | bigint | number;
|
|
153
|
+
completedUtcNs: string | bigint | number;
|
|
154
|
+
observedLatencyUs64: string | bigint | number;
|
|
155
|
+
reportedLatencyUs64: string | bigint | number;
|
|
156
|
+
isSuccess: boolean;
|
|
157
|
+
statusCode: string;
|
|
158
|
+
sizeBytes64: string | bigint | number;
|
|
159
|
+
steps: LoadStrikeIterationStepObservationV1[];
|
|
160
|
+
}
|
|
161
|
+
interface BufferedObservation {
|
|
162
|
+
observation: LoadStrikeIterationObservationV1;
|
|
163
|
+
jsonBytes: number;
|
|
164
|
+
}
|
|
165
|
+
export declare function utcNowNs(): bigint;
|
|
166
|
+
export declare function deriveIterationId(runId: string, resultOwnerId: string, scenarioName: string, simulationIndex: number, globalOrdinal64: string | bigint | number): string;
|
|
167
|
+
export declare function deriveObservationId(iterationId: string, attemptIndex: number): string;
|
|
168
|
+
export declare function deriveIterationBatchId(runId: string, resultOwnerId: string, batchSequence64: string | bigint | number): string;
|
|
169
|
+
export declare function createIterationStepObservation(input: CreateIterationStepObservationInput): LoadStrikeIterationStepObservationV1;
|
|
170
|
+
export declare function createIterationObservation(input: CreateIterationObservationInput): LoadStrikeIterationObservationV1;
|
|
171
|
+
export declare function serializeIterationObservationBatchGzipJson(value: unknown): Buffer;
|
|
172
|
+
export declare class ProcessIterationObservationBuffer {
|
|
173
|
+
private readonly streams;
|
|
174
|
+
private readonly streamLimits;
|
|
175
|
+
private totalBytes;
|
|
176
|
+
get byteLength(): number;
|
|
177
|
+
register(streamKey: symbol, maxBufferBytes: number): void;
|
|
178
|
+
offer(streamKey: symbol, observation: LoadStrikeIterationObservationV1, maxBufferBytes: number, encodedBytes?: number): boolean;
|
|
179
|
+
drain(streamKey: symbol): BufferedObservation[];
|
|
180
|
+
release(streamKey: symbol): void;
|
|
181
|
+
unregister(streamKey: symbol): void;
|
|
182
|
+
private effectiveLimit;
|
|
183
|
+
}
|
|
184
|
+
export interface IterationObservationReporterOptions {
|
|
185
|
+
runId: string;
|
|
186
|
+
sessionId: string;
|
|
187
|
+
resultOwnerId: string;
|
|
188
|
+
expectedResultOwnerCount64?: string | bigint | number;
|
|
189
|
+
processGroup: number;
|
|
190
|
+
sinks: IterationObservationSinkTarget[];
|
|
191
|
+
settings?: Partial<IterationObservationSettings>;
|
|
192
|
+
buffer?: ProcessIterationObservationBuffer;
|
|
193
|
+
clock?: IterationObservationClock;
|
|
194
|
+
skipValidation?: boolean;
|
|
195
|
+
}
|
|
196
|
+
export declare class IterationObservationReporter {
|
|
197
|
+
private readonly options;
|
|
198
|
+
private readonly streamKey;
|
|
199
|
+
private readonly settings;
|
|
200
|
+
private readonly buffer;
|
|
201
|
+
private readonly clock;
|
|
202
|
+
private readonly dispatchers;
|
|
203
|
+
private readonly warnings;
|
|
204
|
+
private readonly timer;
|
|
205
|
+
private readonly batchEnvelopeBytes;
|
|
206
|
+
private sequence;
|
|
207
|
+
private captured;
|
|
208
|
+
private droppedBuffer;
|
|
209
|
+
private unsupportedSinkCount;
|
|
210
|
+
private sealed;
|
|
211
|
+
private finalResult;
|
|
212
|
+
private readonly expectedResultOwnerCount64;
|
|
213
|
+
constructor(options: IterationObservationReporterOptions);
|
|
214
|
+
get enabled(): boolean;
|
|
215
|
+
capture(observation: LoadStrikeIterationObservationV1): boolean;
|
|
216
|
+
flushNow(): void;
|
|
217
|
+
sealAndDrain(): Promise<IterationObservationDeliveryResult>;
|
|
218
|
+
buildWarnings(): IterationObservationGeneratorWarning[];
|
|
219
|
+
private createBatch;
|
|
220
|
+
private createCompletion;
|
|
221
|
+
private recordSinkDrop;
|
|
222
|
+
private recordWarning;
|
|
223
|
+
}
|
|
224
|
+
export declare function validateIterationObservationSettings(settings: IterationObservationSettings): void;
|
|
225
|
+
export {};
|