@glubean/sdk 0.5.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract-artifacts.d.ts +39 -21
- package/dist/contract-artifacts.d.ts.map +1 -1
- package/dist/contract-artifacts.js +80 -24
- package/dist/contract-artifacts.js.map +1 -1
- package/dist/contract-core.d.ts +10 -21
- package/dist/contract-core.d.ts.map +1 -1
- package/dist/contract-core.js +26 -812
- package/dist/contract-core.js.map +1 -1
- package/dist/contract-http/adapter.d.ts +13 -0
- package/dist/contract-http/adapter.d.ts.map +1 -1
- package/dist/contract-http/adapter.js +191 -23
- package/dist/contract-http/adapter.js.map +1 -1
- package/dist/contract-http/factory.d.ts +2 -2
- package/dist/contract-http/factory.d.ts.map +1 -1
- package/dist/contract-http/factory.js +5 -0
- package/dist/contract-http/factory.js.map +1 -1
- package/dist/contract-http/inbound-match.d.ts +47 -0
- package/dist/contract-http/inbound-match.d.ts.map +1 -0
- package/dist/contract-http/inbound-match.js +136 -0
- package/dist/contract-http/inbound-match.js.map +1 -0
- package/dist/contract-http/inbound-verify.d.ts +46 -0
- package/dist/contract-http/inbound-verify.d.ts.map +1 -0
- package/dist/contract-http/inbound-verify.js +101 -0
- package/dist/contract-http/inbound-verify.js.map +1 -0
- package/dist/contract-http/inbound.d.ts +45 -0
- package/dist/contract-http/inbound.d.ts.map +1 -0
- package/dist/contract-http/inbound.js +89 -0
- package/dist/contract-http/inbound.js.map +1 -0
- package/dist/contract-http/index.d.ts +5 -0
- package/dist/contract-http/index.d.ts.map +1 -1
- package/dist/contract-http/index.js +3 -0
- package/dist/contract-http/index.js.map +1 -1
- package/dist/contract-http/openapi.d.ts +0 -7
- package/dist/contract-http/openapi.d.ts.map +1 -1
- package/dist/contract-http/openapi.js +20 -14
- package/dist/contract-http/openapi.js.map +1 -1
- package/dist/contract-http/types.d.ts +106 -2
- package/dist/contract-http/types.d.ts.map +1 -1
- package/dist/contract-http/types.js +33 -0
- package/dist/contract-http/types.js.map +1 -1
- package/dist/contract-types.d.ts +148 -446
- package/dist/contract-types.d.ts.map +1 -1
- package/dist/data-path.d.ts.map +1 -1
- package/dist/data-path.js +10 -2
- package/dist/data-path.js.map +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +7 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +14 -0
- package/dist/internal.js.map +1 -1
- package/dist/load/artifact.d.ts +376 -0
- package/dist/load/artifact.d.ts.map +1 -0
- package/dist/load/artifact.js +14 -0
- package/dist/load/artifact.js.map +1 -0
- package/dist/load/builder.d.ts +80 -0
- package/dist/load/builder.d.ts.map +1 -0
- package/dist/load/builder.js +262 -0
- package/dist/load/builder.js.map +1 -0
- package/dist/load/context.d.ts +81 -0
- package/dist/load/context.d.ts.map +1 -0
- package/dist/load/context.js +2 -0
- package/dist/load/context.js.map +1 -0
- package/dist/load/duration.d.ts +9 -0
- package/dist/load/duration.d.ts.map +1 -0
- package/dist/load/duration.js +22 -0
- package/dist/load/duration.js.map +1 -0
- package/dist/load/events.d.ts +132 -0
- package/dist/load/events.d.ts.map +1 -0
- package/dist/load/events.js +2 -0
- package/dist/load/events.js.map +1 -0
- package/dist/load/feeder.d.ts +118 -0
- package/dist/load/feeder.d.ts.map +1 -0
- package/dist/load/feeder.js +170 -0
- package/dist/load/feeder.js.map +1 -0
- package/dist/load/index.d.ts +32 -0
- package/dist/load/index.d.ts.map +1 -0
- package/dist/load/index.js +7 -0
- package/dist/load/index.js.map +1 -0
- package/dist/load/progress.d.ts +56 -0
- package/dist/load/progress.d.ts.map +1 -0
- package/dist/load/progress.js +2 -0
- package/dist/load/progress.js.map +1 -0
- package/dist/load/projection.d.ts +36 -0
- package/dist/load/projection.d.ts.map +1 -0
- package/dist/load/projection.js +47 -0
- package/dist/load/projection.js.map +1 -0
- package/dist/load/runner.d.ts +201 -0
- package/dist/load/runner.d.ts.map +1 -0
- package/dist/load/runner.js +78 -0
- package/dist/load/runner.js.map +1 -0
- package/dist/load/scenario.d.ts +130 -0
- package/dist/load/scenario.d.ts.map +1 -0
- package/dist/load/scenario.js +9 -0
- package/dist/load/scenario.js.map +1 -0
- package/dist/load/step.d.ts +42 -0
- package/dist/load/step.d.ts.map +1 -0
- package/dist/load/step.js +2 -0
- package/dist/load/step.js.map +1 -0
- package/dist/{contract-flow-poll.d.ts → poll-primitives.d.ts} +8 -81
- package/dist/poll-primitives.d.ts.map +1 -0
- package/dist/{contract-flow-poll.js → poll-primitives.js} +10 -64
- package/dist/poll-primitives.js.map +1 -0
- package/dist/{contract-flow-condition.d.ts → predicates.d.ts} +34 -71
- package/dist/predicates.d.ts.map +1 -0
- package/dist/{contract-flow-condition.js → predicates.js} +86 -80
- package/dist/predicates.js.map +1 -0
- package/dist/test/builder.js +2 -2
- package/dist/test/builder.js.map +1 -1
- package/dist/test/utils.d.ts +7 -0
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +22 -17
- package/dist/test/utils.js.map +1 -1
- package/dist/types.d.ts +42 -14
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/workflow/builder.d.ts +386 -0
- package/dist/workflow/builder.d.ts.map +1 -0
- package/dist/workflow/builder.js +1150 -0
- package/dist/workflow/builder.js.map +1 -0
- package/dist/workflow/execute.d.ts +277 -0
- package/dist/workflow/execute.d.ts.map +1 -0
- package/dist/workflow/execute.js +1489 -0
- package/dist/workflow/execute.js.map +1 -0
- package/dist/workflow/index.d.ts +11 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +15 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/project.d.ts +18 -0
- package/dist/workflow/project.d.ts.map +1 -0
- package/dist/workflow/project.js +321 -0
- package/dist/workflow/project.js.map +1 -0
- package/dist/workflow/retry.d.ts +13 -0
- package/dist/workflow/retry.d.ts.map +1 -0
- package/dist/workflow/retry.js +15 -0
- package/dist/workflow/retry.js.map +1 -0
- package/dist/workflow/types.d.ts +512 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/types.js +2 -0
- package/dist/workflow/types.js.map +1 -0
- package/package.json +9 -2
- package/dist/contract-flow-condition.d.ts.map +0 -1
- package/dist/contract-flow-condition.js.map +0 -1
- package/dist/contract-flow-poll.d.ts.map +0 -1
- package/dist/contract-flow-poll.js.map +0 -1
- package/dist/contract-http/flow-helpers.d.ts +0 -12
- package/dist/contract-http/flow-helpers.d.ts.map +0 -1
- package/dist/contract-http/flow-helpers.js +0 -34
- package/dist/contract-http/flow-helpers.js.map +0 -1
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `glubean.load.v1` — the versioned load report artifact.
|
|
3
|
+
*
|
|
4
|
+
* This is the stable boundary the CLI / Cloud read. `LoadEvent` (runtime fact
|
|
5
|
+
* stream, M3) and external-engine native files are only inputs that produce a
|
|
6
|
+
* `LoadArtifact`. M1 defines the types; the reducer that emits them lands later.
|
|
7
|
+
*
|
|
8
|
+
* Two business views + a matrix:
|
|
9
|
+
* - scenario / step (which transaction step is slow or failing under load)
|
|
10
|
+
* - endpoint (which endpoint's p95/p99/errorRate degrades)
|
|
11
|
+
* - matrix (which endpoint inside which step)
|
|
12
|
+
*/
|
|
13
|
+
/** Latency / duration percentiles (ms). */
|
|
14
|
+
export interface Percentiles {
|
|
15
|
+
p50: number;
|
|
16
|
+
p90: number;
|
|
17
|
+
p95: number;
|
|
18
|
+
p99: number;
|
|
19
|
+
max: number;
|
|
20
|
+
}
|
|
21
|
+
/** One bucket of a latency distribution: observations in (previous bucket's `leMs`, `leMs`].
|
|
22
|
+
* The buckets use a FIXED ladder so two runs' distributions line up for comparison; the
|
|
23
|
+
* final bucket's `leMs` is the observed max (the tail catch-all past the last boundary). */
|
|
24
|
+
export interface LoadLatencyBucket {
|
|
25
|
+
leMs: number;
|
|
26
|
+
count: number;
|
|
27
|
+
}
|
|
28
|
+
/** How trustworthy a reported dimension is (Glubean-native vs adapter heuristic). */
|
|
29
|
+
export type LoadAttributionQuality = "canonical" | "tagged" | "heuristic" | "aggregate-only" | "unsupported";
|
|
30
|
+
/** Per-dimension attribution quality for an artifact. */
|
|
31
|
+
export interface LoadAttributionReport {
|
|
32
|
+
scenario: LoadAttributionQuality;
|
|
33
|
+
step: LoadAttributionQuality;
|
|
34
|
+
endpoint: LoadAttributionQuality;
|
|
35
|
+
phase: LoadAttributionQuality;
|
|
36
|
+
iteration: LoadAttributionQuality;
|
|
37
|
+
failureTrace: LoadAttributionQuality;
|
|
38
|
+
notes?: string[];
|
|
39
|
+
}
|
|
40
|
+
/** Where an artifact came from. */
|
|
41
|
+
export interface LoadArtifactSource {
|
|
42
|
+
kind: "glubean-local" | "external-adapter" | "imported-result";
|
|
43
|
+
engine: "local" | "k6" | "jmeter" | "custom";
|
|
44
|
+
adapter?: {
|
|
45
|
+
name: string;
|
|
46
|
+
version?: string;
|
|
47
|
+
};
|
|
48
|
+
nativeRunId?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Pointer back to a native engine output for cross-tool debugging. */
|
|
51
|
+
export interface LoadExternalArtifactRef {
|
|
52
|
+
kind: "k6-json" | "k6-summary" | "jmeter-jtl" | "jmeter-dashboard" | "adapter-log" | "custom";
|
|
53
|
+
path?: string;
|
|
54
|
+
url?: string;
|
|
55
|
+
sha256?: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Run-fatal crash summary (process-level, lost reliable iteration attribution). */
|
|
59
|
+
export interface LoadCrashSummary {
|
|
60
|
+
kind: "uncaughtException" | "unhandledRejection" | "runnerCrash" | "adapterCrash";
|
|
61
|
+
message: string;
|
|
62
|
+
stack?: string;
|
|
63
|
+
atMs: number;
|
|
64
|
+
}
|
|
65
|
+
/** Classification of an iteration / step / request failure. */
|
|
66
|
+
export type LoadErrorKind = "assertion" | "http" | "timeout" | "setupError" | "stepError" | "teardownError" | "continuationBacklogFull" | "aborted" | "runnerCrash";
|
|
67
|
+
/** Continuation (bounded-open) subsystem summary (present when producer release is used). */
|
|
68
|
+
export interface LoadContinuationSummary {
|
|
69
|
+
backlog: number;
|
|
70
|
+
maxBacklog: number;
|
|
71
|
+
maxConcurrent: number;
|
|
72
|
+
active: number;
|
|
73
|
+
oldestAgeMs?: number;
|
|
74
|
+
queueWaitMs?: Percentiles;
|
|
75
|
+
backpressureMs?: Percentiles;
|
|
76
|
+
releasedProducerSlots: number;
|
|
77
|
+
primaryBoundaryCoverage: number;
|
|
78
|
+
releaseCoverage: number;
|
|
79
|
+
duplicateReleaseSignals: number;
|
|
80
|
+
rejectedReleaseSignals: number;
|
|
81
|
+
abortedByDrainTimeout: number;
|
|
82
|
+
}
|
|
83
|
+
/** A primary-phase aggregate (producer side). */
|
|
84
|
+
export interface LoadPrimaryPhaseSummary {
|
|
85
|
+
started: number;
|
|
86
|
+
completed: number;
|
|
87
|
+
failedBeforeRelease: number;
|
|
88
|
+
throughputPerSec: number;
|
|
89
|
+
latency: Percentiles;
|
|
90
|
+
}
|
|
91
|
+
/** An end-to-end aggregate (full logical iteration). */
|
|
92
|
+
export interface LoadEndToEndSummary {
|
|
93
|
+
started: number;
|
|
94
|
+
completed: number;
|
|
95
|
+
successful: number;
|
|
96
|
+
failed: number;
|
|
97
|
+
inFlightAtEnd: number;
|
|
98
|
+
errorRate: number;
|
|
99
|
+
throughputPerSec: number;
|
|
100
|
+
latency: Percentiles;
|
|
101
|
+
}
|
|
102
|
+
/** Result of evaluating one threshold expression against a scope/metric. */
|
|
103
|
+
export interface ThresholdEvaluation {
|
|
104
|
+
scope: "transaction" | "primary" | "endToEnd" | "continuation" | "endpoint" | "step";
|
|
105
|
+
target?: string;
|
|
106
|
+
metric: "errorRate" | "p50" | "p90" | "p95" | "p99" | "throughputPerSec" | "backlog" | "backpressureMs";
|
|
107
|
+
expression: string;
|
|
108
|
+
actual: number;
|
|
109
|
+
pass: boolean;
|
|
110
|
+
source?: "glubean" | "engine" | "adapter";
|
|
111
|
+
nativeExpression?: string;
|
|
112
|
+
attributionQuality?: LoadAttributionQuality;
|
|
113
|
+
}
|
|
114
|
+
/** Identity attached to a failure / slow-transaction sample. The feeder `key` is the data-row
|
|
115
|
+
* attribution (which row produced this sample); `strategy` is optional metadata that may not
|
|
116
|
+
* be known at the layer that emits the sample (e.g. a streaming load reducer sees only the
|
|
117
|
+
* per-iteration keys, not each feeder's allocation strategy). */
|
|
118
|
+
export interface LoadSampleIdentity {
|
|
119
|
+
scenarioId: string;
|
|
120
|
+
scenarioRefId?: string;
|
|
121
|
+
producerSlotId: string;
|
|
122
|
+
iterationId: string;
|
|
123
|
+
feeders?: Record<string, {
|
|
124
|
+
key?: string;
|
|
125
|
+
strategy?: string;
|
|
126
|
+
}>;
|
|
127
|
+
}
|
|
128
|
+
/** A bounded observation kept for a failed iteration. */
|
|
129
|
+
export type LoadFailureObservation = {
|
|
130
|
+
type: "request";
|
|
131
|
+
tsOffsetMs: number;
|
|
132
|
+
stepId?: string;
|
|
133
|
+
stepName?: string;
|
|
134
|
+
phase?: "primary" | "continuation";
|
|
135
|
+
method: string;
|
|
136
|
+
routeKey: string;
|
|
137
|
+
status?: number;
|
|
138
|
+
ok: boolean;
|
|
139
|
+
durationMs: number;
|
|
140
|
+
errorKind?: LoadErrorKind;
|
|
141
|
+
} | {
|
|
142
|
+
type: "assertion";
|
|
143
|
+
tsOffsetMs: number;
|
|
144
|
+
stepId?: string;
|
|
145
|
+
stepName?: string;
|
|
146
|
+
phase?: "primary" | "continuation";
|
|
147
|
+
passed: false;
|
|
148
|
+
message?: string;
|
|
149
|
+
actualPreview?: unknown;
|
|
150
|
+
expectedPreview?: unknown;
|
|
151
|
+
} | {
|
|
152
|
+
type: "log";
|
|
153
|
+
tsOffsetMs: number;
|
|
154
|
+
level: "debug" | "info" | "warn" | "error";
|
|
155
|
+
message: string;
|
|
156
|
+
};
|
|
157
|
+
/** A bounded trace kept only for a failed iteration. */
|
|
158
|
+
export interface LoadFailureTraceSample {
|
|
159
|
+
identity: LoadSampleIdentity;
|
|
160
|
+
durationMs: number;
|
|
161
|
+
errorKind?: LoadErrorKind;
|
|
162
|
+
failedStepId?: string;
|
|
163
|
+
failedStepName?: string;
|
|
164
|
+
observations: LoadFailureObservation[];
|
|
165
|
+
truncated: boolean;
|
|
166
|
+
droppedObservationCount: number;
|
|
167
|
+
}
|
|
168
|
+
/** A slow-but-successful transaction summary (no request trace). */
|
|
169
|
+
export interface LoadSlowTransactionSummary {
|
|
170
|
+
identity: LoadSampleIdentity;
|
|
171
|
+
durationMs: number;
|
|
172
|
+
slowStepId?: string;
|
|
173
|
+
slowStepName?: string;
|
|
174
|
+
topEndpoints: Array<{
|
|
175
|
+
routeKey: string;
|
|
176
|
+
phase?: "primary" | "continuation";
|
|
177
|
+
durationMs: number;
|
|
178
|
+
status?: number;
|
|
179
|
+
}>;
|
|
180
|
+
truncated: false;
|
|
181
|
+
}
|
|
182
|
+
/** Per-step aggregate (builder view). */
|
|
183
|
+
export interface LoadStepSummary {
|
|
184
|
+
scenarioId: string;
|
|
185
|
+
/** Traffic-mix entry id, when this step's scenario was referenced via a mix entry.
|
|
186
|
+
* Disambiguates the SAME `loadScenario` referenced under two entry ids (otherwise two
|
|
187
|
+
* rows would share scenarioId/stepId). Absent for a single-scenario run. */
|
|
188
|
+
scenarioRefId?: string;
|
|
189
|
+
stepId: string;
|
|
190
|
+
stepName: string;
|
|
191
|
+
groupId?: string;
|
|
192
|
+
phase?: "primary" | "continuation";
|
|
193
|
+
invocationCount: number;
|
|
194
|
+
skippedCount: number;
|
|
195
|
+
assertionFailureCount: number;
|
|
196
|
+
errorCount: number;
|
|
197
|
+
errorRate: number;
|
|
198
|
+
latency: Percentiles;
|
|
199
|
+
requestCount: number;
|
|
200
|
+
}
|
|
201
|
+
/** Per-endpoint aggregate (routeKey view). */
|
|
202
|
+
export interface LoadEndpointSummary {
|
|
203
|
+
routeKey: string;
|
|
204
|
+
phase?: "primary" | "continuation";
|
|
205
|
+
routeKeySource: "explicit" | "catalog" | "contract-metadata" | "normalized-url";
|
|
206
|
+
routeKeyHeuristic: boolean;
|
|
207
|
+
method?: string;
|
|
208
|
+
pathPattern?: string;
|
|
209
|
+
operationId?: string;
|
|
210
|
+
requestCount: number;
|
|
211
|
+
errorCount: number;
|
|
212
|
+
errorRate: number;
|
|
213
|
+
statusCounts: Record<string, number>;
|
|
214
|
+
latency: Percentiles;
|
|
215
|
+
/** Request-latency distribution (fixed-ladder buckets) for a per-endpoint histogram. */
|
|
216
|
+
latencyDistribution?: LoadLatencyBucket[];
|
|
217
|
+
throughputPerSec: number;
|
|
218
|
+
}
|
|
219
|
+
/** Scenario-step × endpoint cell (which endpoint inside which step). */
|
|
220
|
+
export interface LoadScenarioEndpointMatrix {
|
|
221
|
+
scenarioId: string;
|
|
222
|
+
scenarioRefId?: string;
|
|
223
|
+
stepId?: string;
|
|
224
|
+
stepName?: string;
|
|
225
|
+
phase?: "primary" | "continuation";
|
|
226
|
+
routeKey: string;
|
|
227
|
+
routeKeySource: "explicit" | "catalog" | "contract-metadata" | "normalized-url";
|
|
228
|
+
routeKeyHeuristic: boolean;
|
|
229
|
+
requestCount: number;
|
|
230
|
+
errorRate: number;
|
|
231
|
+
latency: Percentiles;
|
|
232
|
+
}
|
|
233
|
+
/** One fixed-width time window of the run — the unit of the over-time timeline. */
|
|
234
|
+
export interface LoadTimelineWindow {
|
|
235
|
+
/** Window start, ms from the run start (`startedAt`). Width is `LoadTimeline.windowMs`. */
|
|
236
|
+
offsetMs: number;
|
|
237
|
+
/** Requests observed in this window. */
|
|
238
|
+
requests: number;
|
|
239
|
+
/** Requests with a non-2xx / failed response in this window. */
|
|
240
|
+
errors: number;
|
|
241
|
+
errorRate: number;
|
|
242
|
+
/** Request throughput (requests / windowSec) — RPS over time. */
|
|
243
|
+
throughputPerSec: number;
|
|
244
|
+
/** Request latency percentiles within this window. */
|
|
245
|
+
latency: Percentiles;
|
|
246
|
+
/** Iterations COMPLETED (iteration:end) in this window — iteration throughput over time. */
|
|
247
|
+
iterations: number;
|
|
248
|
+
/** Peak concurrent in-flight iterations during this window — concurrency over time. It is
|
|
249
|
+
* max(the peak sampled within the window, the count carried in from earlier windows), so a
|
|
250
|
+
* long iteration spanning quiet windows keeps the curve up AND a short iteration that starts
|
|
251
|
+
* and ends within one window still shows its concurrency (rather than netting to zero). */
|
|
252
|
+
peakInFlight: number;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Over-time series: fixed-width windows from run start, so a consumer can draw the
|
|
256
|
+
* classic load curves (RPS / error-rate / latency / concurrency vs time). Windows are
|
|
257
|
+
* dense (an idle window is present with zero counts) so the x-axis has no gaps. The width
|
|
258
|
+
* (`windowMs`) starts fine and is coarsened (doubled) as needed so the series stays bounded
|
|
259
|
+
* for an arbitrarily long run. Present for the local engine; an external adapter may omit it.
|
|
260
|
+
*/
|
|
261
|
+
export interface LoadTimeline {
|
|
262
|
+
windowMs: number;
|
|
263
|
+
windows: LoadTimelineWindow[];
|
|
264
|
+
}
|
|
265
|
+
/** Per-scenario aggregate. */
|
|
266
|
+
export interface LoadScenarioSummary {
|
|
267
|
+
scenarioId: string;
|
|
268
|
+
scenarioRefId?: string;
|
|
269
|
+
iterations: number;
|
|
270
|
+
successfulIterations: number;
|
|
271
|
+
failedIterations: number;
|
|
272
|
+
errorRate: number;
|
|
273
|
+
latency: Percentiles;
|
|
274
|
+
primary?: LoadPrimaryPhaseSummary;
|
|
275
|
+
endToEnd?: Omit<LoadEndToEndSummary, "started">;
|
|
276
|
+
steps: LoadStepSummary[];
|
|
277
|
+
}
|
|
278
|
+
/** Resolved (ms-normalized) config recorded in the artifact. */
|
|
279
|
+
export interface LoadArtifactConfig {
|
|
280
|
+
concurrency: number;
|
|
281
|
+
durationMs?: number;
|
|
282
|
+
iterations?: number;
|
|
283
|
+
rampUpMs?: number;
|
|
284
|
+
/** Traffic-mix composition (present only for a `scenarios[]` run): each configured entry
|
|
285
|
+
* with its weight. Records WHAT was configured so a low-weight entry that drew zero
|
|
286
|
+
* iterations still shows up (as a 0-iteration scenario), not as if it were never set. */
|
|
287
|
+
scenarios?: {
|
|
288
|
+
scenarioRefId: string;
|
|
289
|
+
scenarioId: string;
|
|
290
|
+
weight: number;
|
|
291
|
+
}[];
|
|
292
|
+
pacing?: {
|
|
293
|
+
thinkTimeMs?: number | {
|
|
294
|
+
min: number;
|
|
295
|
+
max: number;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
continuation?: {
|
|
299
|
+
maxOutstanding?: number;
|
|
300
|
+
maxConcurrent?: number;
|
|
301
|
+
minPollIntervalMs?: number;
|
|
302
|
+
drainTimeoutMs?: number;
|
|
303
|
+
onBacklogFull?: "block-producer" | "fail-iteration";
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
/** Runtime / engine provenance + saturation signals. */
|
|
307
|
+
export interface LoadArtifactRuntime {
|
|
308
|
+
engine: "local" | "k6" | "jmeter" | "custom";
|
|
309
|
+
engineVersion?: string;
|
|
310
|
+
adapterName?: string;
|
|
311
|
+
adapterVersion?: string;
|
|
312
|
+
processModel: "single-process-async-producer-slot" | "external-engine" | "distributed-adapter";
|
|
313
|
+
executionModel: "closed-back-to-back" | "closed-paced";
|
|
314
|
+
slotModel: "end-to-end" | "end-to-end-measured" | "producer-released";
|
|
315
|
+
requestedConcurrency: number;
|
|
316
|
+
primaryInFlight: number;
|
|
317
|
+
continuationInFlight: number;
|
|
318
|
+
blockedOnBacklog: number;
|
|
319
|
+
eventLoopDelayMs?: Percentiles;
|
|
320
|
+
feederGuarantee: "single-node" | "distributed" | "degraded";
|
|
321
|
+
sampleGranularity: "event" | "sample" | "aggregate";
|
|
322
|
+
attribution: LoadAttributionReport;
|
|
323
|
+
percentileSource: "glubean-reducer" | "engine-summary" | "adapter-computed" | "mixed";
|
|
324
|
+
crash?: LoadCrashSummary;
|
|
325
|
+
}
|
|
326
|
+
/** Top-level summary (compatibility end-to-end fields + phase splits + thresholds). */
|
|
327
|
+
export interface LoadArtifactSummary {
|
|
328
|
+
pass: boolean;
|
|
329
|
+
/** Compatibility alias for endToEnd.completed. */
|
|
330
|
+
totalIterations: number;
|
|
331
|
+
successfulIterations: number;
|
|
332
|
+
failedIterations: number;
|
|
333
|
+
errorRate: number;
|
|
334
|
+
throughputPerSec: number;
|
|
335
|
+
latency: Percentiles;
|
|
336
|
+
/** Transaction (iteration) latency distribution (fixed-ladder buckets) for the overall
|
|
337
|
+
* latency histogram — comparable bucket-for-bucket across runs. */
|
|
338
|
+
latencyDistribution?: LoadLatencyBucket[];
|
|
339
|
+
primary?: LoadPrimaryPhaseSummary;
|
|
340
|
+
endToEnd?: LoadEndToEndSummary;
|
|
341
|
+
continuation?: LoadContinuationSummary;
|
|
342
|
+
thresholds: ThresholdEvaluation[];
|
|
343
|
+
/** Non-fatal advisories about the run's shape (e.g. a long poll with no
|
|
344
|
+
* `primaryComplete`, so closed scheduling may under-pressure the upstream).
|
|
345
|
+
* Present only when there's something to surface. */
|
|
346
|
+
advisories?: string[];
|
|
347
|
+
}
|
|
348
|
+
/** Bounded failure / slow-transaction samples with their caps. */
|
|
349
|
+
export interface LoadArtifactSamples {
|
|
350
|
+
maxFailureTraces: number;
|
|
351
|
+
maxSlowTransactionSummaries: number;
|
|
352
|
+
failureTraces: LoadFailureTraceSample[];
|
|
353
|
+
slowTransactions: LoadSlowTransactionSummary[];
|
|
354
|
+
}
|
|
355
|
+
/** The complete versioned load report artifact. */
|
|
356
|
+
export interface LoadArtifact {
|
|
357
|
+
schemaVersion: "glubean.load.v1";
|
|
358
|
+
runnerId: string;
|
|
359
|
+
runMode: "load";
|
|
360
|
+
startedAt: string;
|
|
361
|
+
durationMs: number;
|
|
362
|
+
source: LoadArtifactSource;
|
|
363
|
+
config: LoadArtifactConfig;
|
|
364
|
+
runtime: LoadArtifactRuntime;
|
|
365
|
+
summary: LoadArtifactSummary;
|
|
366
|
+
scenarios: LoadScenarioSummary[];
|
|
367
|
+
steps: LoadStepSummary[];
|
|
368
|
+
endpoints: LoadEndpointSummary[];
|
|
369
|
+
matrix: LoadScenarioEndpointMatrix[];
|
|
370
|
+
/** Over-time series (RPS / error-rate / latency / concurrency vs time). Present for the
|
|
371
|
+
* local engine; an external adapter that only has summary stats may omit it. */
|
|
372
|
+
timeline?: LoadTimeline;
|
|
373
|
+
samples: LoadArtifactSamples;
|
|
374
|
+
externalArtifacts?: LoadExternalArtifactRef[];
|
|
375
|
+
}
|
|
376
|
+
//# sourceMappingURL=artifact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../src/load/artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,2CAA2C;AAC3C,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;6FAE6F;AAC7F,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qFAAqF;AACrF,MAAM,MAAM,sBAAsB,GAC9B,WAAW,GACX,QAAQ,GACR,WAAW,GACX,gBAAgB,GAChB,aAAa,CAAC;AAElB,yDAAyD;AACzD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,KAAK,EAAE,sBAAsB,CAAC;IAC9B,SAAS,EAAE,sBAAsB,CAAC;IAClC,YAAY,EAAE,sBAAsB,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,mCAAmC;AACnC,MAAM,WAAW,kBAAkB;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3
|
+
*
|
|
4
|
+
* This is the stable boundary the CLI / Cloud read. `LoadEvent` (runtime fact
|
|
5
|
+
* stream, M3) and external-engine native files are only inputs that produce a
|
|
6
|
+
* `LoadArtifact`. M1 defines the types; the reducer that emits them lands later.
|
|
7
|
+
*
|
|
8
|
+
* Two business views + a matrix:
|
|
9
|
+
* - scenario / step (which transaction step is slow or failing under load)
|
|
10
|
+
* - endpoint (which endpoint's p95/p99/errorRate degrades)
|
|
11
|
+
* - matrix (which endpoint inside which step)
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=artifact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/load/artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { StepJsonScalar, StepNoExtraKeys } from "../types.js";
|
|
2
|
+
import type { LoadContext } from "./context.js";
|
|
3
|
+
import type { LoadStepOptions } from "./step.js";
|
|
4
|
+
import type { LoadConditionSpec, LoadFragmentBuilder, LoadPollOpts, LoadScenario, LoadScenarioMeta } from "./scenario.js";
|
|
5
|
+
/**
|
|
6
|
+
* Fluent builder for a performance transaction.
|
|
7
|
+
*
|
|
8
|
+
* @template Input The per-iteration input type (from `loadRunner().input`).
|
|
9
|
+
* @template S The threaded state type.
|
|
10
|
+
*/
|
|
11
|
+
export declare class LoadBuilder<Input = unknown, S = unknown> {
|
|
12
|
+
private _meta;
|
|
13
|
+
private _setup?;
|
|
14
|
+
private _teardown?;
|
|
15
|
+
private _steps;
|
|
16
|
+
/**
|
|
17
|
+
* Marker so the scanner / loadRunner can detect an un-built LoadBuilder
|
|
18
|
+
* export without importing the SDK.
|
|
19
|
+
*/
|
|
20
|
+
readonly __glubean_type: "load-scenario-builder";
|
|
21
|
+
constructor(id: string);
|
|
22
|
+
/** Set additional scenario metadata. */
|
|
23
|
+
meta(meta: Omit<LoadScenarioMeta, "id">): LoadBuilder<Input, S>;
|
|
24
|
+
/** Set the setup function that runs before all steps and produces the initial state. */
|
|
25
|
+
setup<NewS>(fn: (ctx: LoadContext<Input>) => Promise<NewS>): LoadBuilder<Input, NewS>;
|
|
26
|
+
/** Set the teardown function (always run with the last committed state). */
|
|
27
|
+
teardown(fn: (ctx: LoadContext<Input>, state: S) => Promise<void>): LoadBuilder<Input, S>;
|
|
28
|
+
/** Add a step that does not return state (void); the state type is preserved. */
|
|
29
|
+
step(name: string, fn: (ctx: LoadContext<Input>, state: S) => Promise<void>): LoadBuilder<Input, S>;
|
|
30
|
+
/** Add a step that returns new state, replacing the current state type. */
|
|
31
|
+
step<NewS>(name: string, fn: (ctx: LoadContext<Input>, state: S) => Promise<NewS>): LoadBuilder<Input, NewS>;
|
|
32
|
+
/** Add a step with options (void return). */
|
|
33
|
+
step(name: string, options: LoadStepOptions, fn: (ctx: LoadContext<Input>, state: S) => Promise<void>): LoadBuilder<Input, S>;
|
|
34
|
+
/** Add a step with options, returning new state. */
|
|
35
|
+
step<NewS>(name: string, options: LoadStepOptions, fn: (ctx: LoadContext<Input>, state: S) => Promise<NewS>): LoadBuilder<Input, NewS>;
|
|
36
|
+
/** Apply a builder transform for reusable step composition (preserves state flow). */
|
|
37
|
+
use<NewS>(fn: (builder: LoadBuilder<Input, S>) => LoadBuilder<Input, NewS>): LoadBuilder<Input, NewS>;
|
|
38
|
+
/** Apply a builder transform and tag all newly added steps with a group ID. */
|
|
39
|
+
group<NewS>(id: string, fn: (builder: LoadBuilder<Input, S>) => LoadBuilder<Input, NewS>): LoadBuilder<Input, NewS>;
|
|
40
|
+
/**
|
|
41
|
+
* Runtime conditional branch. No-else keeps State's shape (may narrow values,
|
|
42
|
+
* not add keys); with-else infers `T` from `then` and checks `else` via NoInfer.
|
|
43
|
+
*/
|
|
44
|
+
condition<R extends S = S>(spec: LoadConditionSpec<Input, S>, thenBranch: (b: LoadFragmentBuilder<Input, S>) => LoadFragmentBuilder<Input, R & StepNoExtraKeys<R, S>>): LoadBuilder<Input, S>;
|
|
45
|
+
condition<T>(spec: LoadConditionSpec<Input, S>, thenBranch: (b: LoadFragmentBuilder<Input, S>) => LoadFragmentBuilder<Input, T>, elseBranch: (b: LoadFragmentBuilder<Input, S>) => LoadFragmentBuilder<Input, NoInfer<T>>): LoadBuilder<Input, T>;
|
|
46
|
+
/** value-switch (single lens × N scalar values; curried so V infers from the lens). */
|
|
47
|
+
switchOn<V>(lens: (ctx: LoadContext<Input>, state: S) => V): <T>(cases: ReadonlyArray<{
|
|
48
|
+
value: [Exclude<Awaited<V>, undefined>] extends [StepJsonScalar] ? Exclude<Awaited<V>, undefined> : never;
|
|
49
|
+
then: (b: LoadFragmentBuilder<Input, S>) => LoadFragmentBuilder<Input, NoInfer<T>>;
|
|
50
|
+
}>, deflt: (b: LoadFragmentBuilder<Input, S>) => LoadFragmentBuilder<Input, T>) => LoadBuilder<Input, T>;
|
|
51
|
+
/** cond-switch (ordered first-match arbitrary predicates). */
|
|
52
|
+
switchCond<T>(cases: ReadonlyArray<{
|
|
53
|
+
when: (ctx: LoadContext<Input>, state: S) => boolean | Promise<boolean>;
|
|
54
|
+
then: (b: LoadFragmentBuilder<Input, S>) => LoadFragmentBuilder<Input, NoInfer<T>>;
|
|
55
|
+
}>, deflt: (b: LoadFragmentBuilder<Input, S>) => LoadFragmentBuilder<Input, T>): LoadBuilder<Input, T>;
|
|
56
|
+
/** Bounded poll-until — repeat `fn` until `opts.until` holds (or a bound exhausts). */
|
|
57
|
+
poll<Res, NewS = S>(name: string, fn: (ctx: LoadContext<Input>, state: S) => Promise<Res>, opts: LoadPollOpts<Input, S, Res, NewS>): LoadBuilder<Input, NewS>;
|
|
58
|
+
/** Build a plain `LoadScenario` definition consumed by `loadRunner()`. */
|
|
59
|
+
build(): LoadScenario<Input, S>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Define a performance transaction.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* export const checkoutScenario = loadScenario<CheckoutInput>("checkout")
|
|
67
|
+
* .setup(async (ctx) => ({ user: ctx.input.user, product: ctx.input.product }))
|
|
68
|
+
* .step("login", async (ctx, state) => {
|
|
69
|
+
* const res = await api.post("login", { json: state.user.credentials }).json<{ token: string }>();
|
|
70
|
+
* return { ...state, token: res.token };
|
|
71
|
+
* })
|
|
72
|
+
* .step("checkout", async (ctx, state) => {
|
|
73
|
+
* const res = await api.post("checkout", { headers: { Authorization: `Bearer ${state.token}` } });
|
|
74
|
+
* ctx.expect(res.status).toBe(201).orFail();
|
|
75
|
+
* return state;
|
|
76
|
+
* });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare function loadScenario<Input = unknown>(id: string): LoadBuilder<Input, unknown>;
|
|
80
|
+
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/load/builder.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAEV,iBAAiB,EACjB,mBAAmB,EAEnB,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AAqMvB;;;;;GAKG;AACH,qBAAa,WAAW,CAAC,KAAK,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO;IACnD,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,MAAM,CAAC,CAAgD;IAC/D,OAAO,CAAC,SAAS,CAAC,CAA6D;IAC/E,OAAO,CAAC,MAAM,CAA4C;IAE1D;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAG,uBAAuB,CAAU;gBAE/C,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