@mark1russell7/harness 0.16.18 → 0.16.19

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/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as MiddleboxEvent, $t as RESOURCES_PROGRAM, A as HopEvent, At as RunGroup, B as KernelRecord, Bt as ShippedImage, C as Fault, Ct as RequestPrediction, D as GroupPrediction, Dt as RunBackup, E as GroupPlace, Et as Run, F as HttpProbe, Ft as RunStream, G as LoadPrediction, Gt as Topology, H as LineMatch, Ht as StageBand, I as ImageSource, It as RunTopology, J as MemoryOomPrediction, Jt as environmentProblems, K as LoadStream, Kt as Toxic, L as Jitter, Lt as SentinelEvent, M as HopSignal, Mt as RunPause, N as HopWrite, Nt as RunResources, O as GroupRole, Ot as RunDrill, P as HostSysctl, Pt as RunRoute, Q as MemoryThrottlePrediction, Qt as RESOURCES_EVENT, R as Kafka, Rt as SentinelStage, S as FabricManifest, Sn as resourceReadingOf, St as Replies, T as Group, Tt as RttRange, U as LoadBand, Ut as Subject, V as LineCount, Vt as Stage, W as LoadPlan, Wt as Target, X as MemoryPrediction, Xt as latestEndOf, Y as MemoryOomTask, Yt as isHopPlace, Z as MemoryStep, Zt as HostLimits, _ as DriverStep, _n as memoryStatOf, _t as Reconnects, a as ClientCapability, an as ResourceNetwork, at as PauseBand, b as EgressPrediction, bn as resourceChange, bt as ReplicaSet, c as ClusterClientAt, cn as ResourceReading, ct as PortsPrediction, d as ContainerLimits, dn as cgroupLimit, dt as ProxyHop, en as ResourceChange, et as MiddleboxExpectation, f as CountBand, fn as cgroupNumber, ft as ProxyTime, g as DriverBand, gn as limitsProblems, gt as QueuePrediction, h as DrillRoom, hn as hostLimitsOf, ht as QueueEnd, i as Client, in as ResourceMemory, it as Pair, j as HopPlace, jt as RunPart, k as Hop, kt as RunFabric, l as ClusterStage, ln as ResourceTraffic, lt as Prediction, m as Drill, mn as cpuStatOf, mt as QueueConnection, n as CLIENT_CAPABILITIES, nn as ResourceDevice, nt as Observer, o as ClientImage, on as ResourceOptions, ot as PausePrediction, p as DeliveryPrediction, pn as cpuMaxOf, pt as QueueBand, q as MemoryLimits, qt as WsProbe, r as Cell, rn as ResourceLimits, rt as Outcomes, s as Cluster, sn as ResourceReader, st as PinnedImage, t as BuildImage, tn as ResourceCpu, tt as MiddleboxForm, u as ConntrackPrediction, un as cgroupKeyed, ut as ProbeEvent, v as EgressBurst, vn as networkOf, vt as Recovers, w as FaultPlace, wt as RouterHop, x as Fabric, xn as resourceReadingIn, xt as ReplicaSetStage, y as EgressPacketLaw, yn as resourceArgs, yt as Reference, z as KafkaPause, zt as Shipped } from "./cell-C8M2J7Ya.js";
1
+ import { $ as MemoryThrottlePrediction, $t as RESOURCES_EVENT, A as HopEvent, At as RunFabric, B as KernelRecord, Bt as Shipped, C as Fault, Cn as resourceReadingOf, Ct as Replies, D as GroupPrediction, Dt as Run, E as GroupPlace, Et as RttRange, F as HttpProbe, Ft as RunRoute, G as LoadPlan, Gt as Target, H as LineMatch, Ht as Stage, I as ImageSource, It as RunStream, J as MemoryLimits, Jt as WsProbe, K as LoadPrediction, Kt as Topology, L as Jitter, Lt as RunTopology, M as HopSignal, Mt as RunPart, N as HopWrite, Nt as RunPause, O as GroupRole, Ot as RunBackup, P as HostSysctl, Pt as RunResources, Q as MemoryStep, Qt as HostLimits, R as Kafka, Rt as SentinelEvent, S as FabricManifest, Sn as resourceReadingIn, St as ReplicaSetStage, T as Group, Tt as RouterHop, U as LoadBand, Ut as StageBand, V as LineCount, Vt as ShippedImage, W as LoadConnections, Wt as Subject, X as MemoryOomTask, Xt as isHopPlace, Y as MemoryOomPrediction, Yt as environmentProblems, Z as MemoryPrediction, Zt as latestEndOf, _ as DriverStep, _n as limitsProblems, _t as QueuePrediction, a as ClientCapability, an as ResourceMemory, at as Pair, b as EgressPrediction, bn as resourceArgs, bt as Reference, c as ClusterClientAt, cn as ResourceReader, ct as PinnedImage, d as ContainerLimits, dn as cgroupKeyed, dt as ProbeEvent, en as RESOURCES_PROGRAM, et as MiddleboxEvent, f as CountBand, fn as cgroupLimit, ft as ProxyHop, g as DriverBand, gn as hostLimitsOf, gt as QueueEnd, h as DrillRoom, hn as cpuStatOf, ht as QueueConnection, i as Client, in as ResourceLimits, it as Outcomes, j as HopPlace, jt as RunGroup, k as Hop, kt as RunDrill, l as ClusterStage, ln as ResourceReading, lt as PortsPrediction, m as Drill, mn as cpuMaxOf, mt as QueueBand, n as CLIENT_CAPABILITIES, nn as ResourceCpu, nt as MiddleboxForm, o as ClientImage, on as ResourceNetwork, ot as PauseBand, p as DeliveryPrediction, pn as cgroupNumber, pt as ProxyTime, q as LoadStream, qt as Toxic, r as Cell, rn as ResourceDevice, rt as Observer, s as Cluster, sn as ResourceOptions, st as PausePrediction, t as BuildImage, tn as ResourceChange, tt as MiddleboxExpectation, u as ConntrackPrediction, un as ResourceTraffic, ut as Prediction, v as EgressBurst, vn as memoryStatOf, vt as Reconnects, w as FaultPlace, wt as RequestPrediction, x as Fabric, xn as resourceChange, xt as ReplicaSet, y as EgressPacketLaw, yn as networkOf, yt as Recovers, z as KafkaPause, zt as SentinelStage } from "./cell-CgjwfQQ-.js";
2
2
  import { LAYERS, LAYER_FACTS, LIMITS, Layer, LayerFacts, LayerState, Limit, layerOf, limitsOf } from "./layers.js";
3
3
  import { Quantity } from "@mark1russell7/quantity";
4
4
  import { DiskFault, LoadMeasure, Schedule } from "@mark1russell7/rigor-chaos";
@@ -205,9 +205,18 @@ type RunLoad = LoadMeasure & {
205
205
  export declare const LOAD_PATH = "/tmp/load.json";
206
206
  /** This text is the format of the plan of the client `load`. */
207
207
  export declare const LOAD_FORMAT = "systems-load/1";
208
+ /** This count is the most connections of the pool of one stream of the client `load`. */
209
+ export declare const LOAD_POOL_LIMIT = 1024;
210
+ /**
211
+ * This function gives each problem of the connections of one load stream. An empty list means that
212
+ * the client `load` can use them. The size of a pool is a whole number from 1 to `LOAD_POOL_LIMIT`.
213
+ */
214
+ export declare const connectionsProblems: (connections: LoadConnections) => string[];
208
215
  /**
209
216
  * This function gives the schedule of each stream of a cell, and the text of the plan of the client
210
217
  * `load`. It throws for no stream, for two streams with one key and for a stream with no request.
218
+ * It also throws for a bad value of the connections of a stream. A stream with no connections has
219
+ * no such field in the plan.
211
220
  */
212
221
  export declare const loadPlanOf: (streams: readonly LoadStream[]) => {
213
222
  readonly streams: readonly RunStream[];
@@ -3043,4 +3052,4 @@ export declare const environmentCounts: (cell: Cell, runs: number) => number[];
3043
3052
  * Each environment does a warm-up first, and the result keeps it apart from the counted runs.
3044
3053
  */
3045
3054
  export declare const runCell: (cell: Cell, say?: (line: string) => void) => Promise<CellResult>;
3046
- export { type Agent, type BuildImage, type BuildRecord, CLIENT_CAPABILITIES, type CallReading, type Cell, type CellResult, type Client, type ClientCapability, type ClientImage, type ClockPair, type Cloud, type Cluster, type ClusterClientAt, type ClusterLab, type ClusterStage, type ConntrackPrediction, type ConntrackReading, type ContainerLimits, type ContextFile, type CountBand, type Crossings, type Cut, type Decision, type DeliveryPrediction, type DeliveryReading, type DeliveryStream, type DiskImage, type DiskLab, type DiskLabOptions, type DiskPinnable, type DiskRecord, type DiskSubject, type DiskWriterRecord, type Drill, type DrillRoom, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type EgressBurst, type EgressPacketLaw, type EgressPacketReading, type EgressPrediction, type EgressReading, type ErrorOnTheWay, type EstimateVerdict, type Fabric, type FabricLab, type FabricManifest, type FabricParts, type Fault, type FaultOptions, type FaultPlace, type FaultSide, type Group, type GroupClient, type GroupLab, type GroupMeasured, type GroupNetworkFault, type GroupPlace, type GroupPrediction, type GroupReading, type GroupRole, type GroupVerdict, type GroupView, type Hop, type HopEvent, type HopPlace, type HopSignal, type HopWrite, type Host, type HostLimits, type HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, LAYERS, LAYER_FACTS, LIMITS, type Lab, type Layer, type LayerFacts, type LayerState, type LeafViews, type Limit, type LineCount, type LineMatch, type LoadBand, type LoadJudgement, type LoadPlan, type LoadPrediction, type LoadSpread, type LoadStream, type LoadVerdict, type Manifest, type ManifestHop, type Measured, type MemberLine, type MemoryLimits, type MemoryOomPrediction, type MemoryOomTask, type MemoryPrediction, type MemoryReading, type MemoryStep, type MemoryStepReading, type MemoryTaskReading, type MemoryThrottlePrediction, type MiddleboxEvent, type MiddleboxExpectation, type MiddleboxForm, type NetworkFault, type NodeLine, type Observer, type OplogRead, type OplogTime, type Outcome, type Outcomes, type Pair, type PairSets, type Pairing, type PartitionView, type PauseBand, type PauseCommit, type PausePrediction, type PauseReading, type Pinnable, type PinnedImage, type PortsPrediction, type PortsReading, type Prediction, type Probe, type ProbeEvent, type ProgramEvent, type ProxyHop, type ProxyTime, type QueueBand, type QueueConnection, type QueueConnectionReading, type QueueEnd, type QueuePrediction, type QueueReading, RESOURCES_EVENT, RESOURCES_PROGRAM, type ReconnectReading, type ReconnectVerdict, type Reconnects, type RecordCode, type Recovers, type RecoveryMeasured, type Reference, type Reordering, type ReplicaSet, type ReplicaSetLab, type ReplicaSetStage, type Replies, type RequestPrediction, type RequestReading, type ResourceChange, type ResourceCpu, type ResourceDevice, type ResourceLimits, type ResourceMemory, type ResourceNetwork, type ResourceOptions, type ResourceReader, type ResourceReading, type ResourceTraffic, type RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunResources, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SocketPlace, type Spread, type StackChange, type Stage, type StageBand, type StageVerdict, type StallReading, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, type Target, type TimeFromFault, type Topology, type Toxic, type Verdict, type WallStamp, type Writes, type WsProbe, cgroupKeyed, cgroupLimit, cgroupNumber, cpuMaxOf, cpuStatOf, environmentProblems, hostLimitsOf, isHopPlace, latestEndOf, layerOf, limitsOf, limitsProblems, memoryStatOf, networkOf, resourceArgs, resourceChange, resourceReadingIn, resourceReadingOf };
3055
+ export { type Agent, type BuildImage, type BuildRecord, CLIENT_CAPABILITIES, type CallReading, type Cell, type CellResult, type Client, type ClientCapability, type ClientImage, type ClockPair, type Cloud, type Cluster, type ClusterClientAt, type ClusterLab, type ClusterStage, type ConntrackPrediction, type ConntrackReading, type ContainerLimits, type ContextFile, type CountBand, type Crossings, type Cut, type Decision, type DeliveryPrediction, type DeliveryReading, type DeliveryStream, type DiskImage, type DiskLab, type DiskLabOptions, type DiskPinnable, type DiskRecord, type DiskSubject, type DiskWriterRecord, type Drill, type DrillRoom, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type EgressBurst, type EgressPacketLaw, type EgressPacketReading, type EgressPrediction, type EgressReading, type ErrorOnTheWay, type EstimateVerdict, type Fabric, type FabricLab, type FabricManifest, type FabricParts, type Fault, type FaultOptions, type FaultPlace, type FaultSide, type Group, type GroupClient, type GroupLab, type GroupMeasured, type GroupNetworkFault, type GroupPlace, type GroupPrediction, type GroupReading, type GroupRole, type GroupVerdict, type GroupView, type Hop, type HopEvent, type HopPlace, type HopSignal, type HopWrite, type Host, type HostLimits, type HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, LAYERS, LAYER_FACTS, LIMITS, type Lab, type Layer, type LayerFacts, type LayerState, type LeafViews, type Limit, type LineCount, type LineMatch, type LoadBand, type LoadConnections, type LoadJudgement, type LoadPlan, type LoadPrediction, type LoadSpread, type LoadStream, type LoadVerdict, type Manifest, type ManifestHop, type Measured, type MemberLine, type MemoryLimits, type MemoryOomPrediction, type MemoryOomTask, type MemoryPrediction, type MemoryReading, type MemoryStep, type MemoryStepReading, type MemoryTaskReading, type MemoryThrottlePrediction, type MiddleboxEvent, type MiddleboxExpectation, type MiddleboxForm, type NetworkFault, type NodeLine, type Observer, type OplogRead, type OplogTime, type Outcome, type Outcomes, type Pair, type PairSets, type Pairing, type PartitionView, type PauseBand, type PauseCommit, type PausePrediction, type PauseReading, type Pinnable, type PinnedImage, type PortsPrediction, type PortsReading, type Prediction, type Probe, type ProbeEvent, type ProgramEvent, type ProxyHop, type ProxyTime, type QueueBand, type QueueConnection, type QueueConnectionReading, type QueueEnd, type QueuePrediction, type QueueReading, RESOURCES_EVENT, RESOURCES_PROGRAM, type ReconnectReading, type ReconnectVerdict, type Reconnects, type RecordCode, type Recovers, type RecoveryMeasured, type Reference, type Reordering, type ReplicaSet, type ReplicaSetLab, type ReplicaSetStage, type Replies, type RequestPrediction, type RequestReading, type ResourceChange, type ResourceCpu, type ResourceDevice, type ResourceLimits, type ResourceMemory, type ResourceNetwork, type ResourceOptions, type ResourceReader, type ResourceReading, type ResourceTraffic, type RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunResources, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SocketPlace, type Spread, type StackChange, type Stage, type StageBand, type StageVerdict, type StallReading, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, type Target, type TimeFromFault, type Topology, type Toxic, type Verdict, type WallStamp, type Writes, type WsProbe, cgroupKeyed, cgroupLimit, cgroupNumber, cpuMaxOf, cpuStatOf, environmentProblems, hostLimitsOf, isHopPlace, latestEndOf, layerOf, limitsOf, limitsProblems, memoryStatOf, networkOf, resourceArgs, resourceChange, resourceReadingIn, resourceReadingOf };
package/build/index.js CHANGED
@@ -1,9 +1,8 @@
1
- import { $ as hostLimitsOf, A as targetSourceOf, B as versionsOf, C as programOf, D as subjectClient, E as sources, F as goVersions, G as requestFirst, H as environmentProblems, I as jarVersions, J as cgroupKeyed, K as RESOURCES_EVENT, L as locksOf, M as unpinnedBases, N as LOCK_NAMES, O as subjectProblems, P as cargoVersions, Q as cpuStatOf, R as npmDrift, S as planOf, T as shippedSource, U as isHopPlace, V as CLIENT_CAPABILITIES, W as latestEndOf, X as cgroupNumber, Y as cgroupLimit, Z as cpuMaxOf, _ as kafkaClientImage, a as SHIPPED_NAMES, at as resourceReadingIn, b as nodeHttpImage, c as buildRecordOf, d as harnessImage, et as limitsProblems, f as harnessVersion, g as inContext, h as imageProblems, i as SHIPPED_CLIENTS, it as resourceChange, j as unlockedManifests, k as targetImageOf, l as goHttpImage, m as imageOf, n as PINNED, nt as networkOf, o as amqpClientImage, ot as resourceReadingOf, p as hikariClientImage, q as RESOURCES_PROGRAM, r as REPOSITORY, rt as resourceArgs, s as basesOf, t as CLIENT_NAMES, tt as memoryStatOf, u as grpcClientImage, v as mongoClientImage, w as routerImage, x as pgClientImage, y as nodeClientImage, z as npmVersions } from "./image-CjrmLPA7.js";
1
+ import { $ as hostLimitsOf, A as targetSourceOf, B as versionsOf, C as programOf, D as subjectClient, E as sources, F as goVersions, G as requestFirst, H as environmentProblems, I as jarVersions, J as cgroupKeyed, K as RESOURCES_EVENT, L as locksOf, M as unpinnedBases, N as LOCK_NAMES, O as subjectProblems, P as cargoVersions, Q as cpuStatOf, R as npmDrift, S as planOf, T as shippedSource, U as isHopPlace, V as CLIENT_CAPABILITIES, W as latestEndOf, X as cgroupNumber, Y as cgroupLimit, Z as cpuMaxOf, _ as kafkaClientImage, _t as loadPlanOf, a as SHIPPED_NAMES, at as resourceReadingIn, b as nodeHttpImage, bt as streamsLoadOf, c as buildRecordOf, ct as LOAD_FORMAT, d as harnessImage, dt as SCHEDULE_PATH, et as limitsProblems, f as harnessVersion, ft as connectionsProblems, g as inContext, gt as loadOf, h as imageProblems, ht as loadEnds, i as SHIPPED_CLIENTS, it as resourceChange, j as unlockedManifests, k as targetImageOf, l as goHttpImage, lt as LOAD_PATH, m as imageOf, mt as estimateVerdict, n as PINNED, nt as networkOf, o as amqpClientImage, ot as resourceReadingOf, p as hikariClientImage, pt as estimateOf, q as RESOURCES_PROGRAM, r as REPOSITORY, rt as resourceArgs, s as basesOf, st as CLOSED_TOLERANCE, t as CLIENT_NAMES, tt as memoryStatOf, u as grpcClientImage, ut as LOAD_POOL_LIMIT, v as mongoClientImage, vt as loadVerdict, w as routerImage, x as pgClientImage, y as nodeClientImage, yt as poolOf, z as npmVersions } from "./image-S18_TQfQ.js";
2
2
  import { LAYERS, LAYER_FACTS, LIMITS, layerOf, limitsOf } from "./layers.js";
3
3
  import { quantity, valueIn } from "@mark1russell7/quantity";
4
- import { median, medianInterval as medianInterval$1, quantile, quantileSorted } from "@mark1russell7/rigor-statistics";
5
- import { rungVerdict } from "@mark1russell7/rigor-bench";
6
- import { checkDiskFault, closedLoopPlan, measureLoad, schedule, scheduleHeld, stopTriggerOf } from "@mark1russell7/rigor-chaos";
4
+ import { checkDiskFault, schedule, stopTriggerOf } from "@mark1russell7/rigor-chaos";
5
+ import { median, medianInterval as medianInterval$1, quantileSorted } from "@mark1russell7/rigor-statistics";
7
6
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
8
7
  import { createHash, randomBytes } from "node:crypto";
9
8
  import { execFile } from "node:child_process";
@@ -12,300 +11,6 @@ import { release, tmpdir } from "node:os";
12
11
  import { join, relative, resolve } from "node:path";
13
12
  import { existsSync, readFileSync, statSync } from "node:fs";
14
13
  import { STOP_ENV, parseProgress, stopOrderOf } from "@mark1russell7/rigor-testkit/stop";
15
- // src/load.ts
16
- /**
17
- * The measure and the verdict of an open-loop cell (SYS-68). A client on a schedule sends each
18
- * arrival at its time, thus a stall counts in each arrival that it delayed. The package rigor-chaos
19
- * counts each latency from the planned time. The package rigor-bench judges a quantile by a
20
- * distribution-free interval.
21
- */
22
- /** This path is where the client of an open-loop cell finds its schedule. */
23
- const SCHEDULE_PATH = "/tmp/schedule.json";
24
- /** This function gives the time of a line of the client, in ms from the start of the schedule. */
25
- const fromStart = (start, t) => (t - start) / 1e6;
26
- /**
27
- * This function gives the measure of one run of a schedule from the lines of its client. It gives
28
- * null when the client did not start the schedule. The first `sent` line of a client is its request
29
- * before `ready`, and it names no arrival. The end of the run is its last line.
30
- */
31
- const loadOf = (events, plan) => {
32
- const start = events.find((event) => event.ev === "scheduled")?.t;
33
- if (start === void 0) return null;
34
- return measureOf(events, start, plan, void 0);
35
- };
36
- /** This function tells if a status of a reply is a failure: a number outside 200 to 299. */
37
- const failedStatus = (status) => typeof status === "number" && (status < 200 || status > 299);
38
- /** This function gives the measure of the arrivals of one stream: the lines with the key `key`, or each line for no key. */
39
- const measureOf = (events, start, plan, key) => {
40
- const sent = /* @__PURE__ */ new Map();
41
- const done = /* @__PURE__ */ new Map();
42
- let failed = 0;
43
- for (const event of events) {
44
- const index = event["i"];
45
- if (typeof index !== "number" || key !== void 0 && event["k"] !== key) continue;
46
- if (event.ev === "sent") sent.set(index, fromStart(start, event.t));
47
- if (event.ev === "replied") {
48
- done.set(index, fromStart(start, event.t));
49
- if (failedStatus(event["status"])) failed += 1;
50
- }
51
- }
52
- const completions = [...sent].map(([index, at]) => ({
53
- index,
54
- sent: at,
55
- done: done.get(index) ?? null
56
- }));
57
- const end = events.reduce((latest, event) => Math.max(latest, fromStart(start, event.t)), 0);
58
- return {
59
- ...measureLoad(plan, completions, end),
60
- failed
61
- };
62
- };
63
- /** This path is where the client `load` finds its plan. */
64
- const LOAD_PATH = "/tmp/load.json";
65
- /** This text is the format of the plan of the client `load`. */
66
- const LOAD_FORMAT = "systems-load/1";
67
- /**
68
- * This function gives the schedule of each stream of a cell, and the text of the plan of the client
69
- * `load`. It throws for no stream, for two streams with one key and for a stream with no request.
70
- */
71
- const loadPlanOf = (streams) => {
72
- if (streams.length === 0) throw new RangeError("a plan of the client load has no stream");
73
- const keys = /* @__PURE__ */ new Set();
74
- for (const stream of streams) {
75
- if (keys.has(stream.key)) throw new RangeError(`two streams have the key ${stream.key}`);
76
- if (stream.requests.length === 0) throw new RangeError(`the stream ${stream.key} has no request`);
77
- keys.add(stream.key);
78
- }
79
- const scheduled = streams.map((stream) => ({
80
- key: stream.key,
81
- schedule: schedule(stream.plan.profile, stream.plan.options),
82
- requests: stream.requests
83
- }));
84
- return {
85
- streams: scheduled.map(({ key, schedule: each }) => ({
86
- key,
87
- schedule: each
88
- })),
89
- content: JSON.stringify({
90
- format: LOAD_FORMAT,
91
- streams: scheduled
92
- })
93
- };
94
- };
95
- /**
96
- * This function gives the measure of each stream of a run of the client `load`, and their pool. Each
97
- * stream counts its arrivals from 0, thus the lines of a stream are the lines with its key. The pool
98
- * sums the counts and joins the times, in the order of the streams. It gives null when the client did
99
- * not start its schedule.
100
- */
101
- const streamsLoadOf = (events, streams) => {
102
- const start = events.find((event) => event.ev === "scheduled")?.t;
103
- if (start === void 0) return null;
104
- const each = streams.map((stream) => [stream.key, measureOf(events, start, stream.schedule, stream.key)]);
105
- return {
106
- pool: poolOf(each.map(([, measure]) => measure)),
107
- streams: Object.fromEntries(each)
108
- };
109
- };
110
- /** This function gives the pool of some measures: it sums the counts and joins the times, in the order of the measures. */
111
- const poolOf = (measures) => {
112
- const sum = (count) => measures.reduce((total, measure) => total + count(measure), 0);
113
- const join = (times) => measures.flatMap(times);
114
- return {
115
- planned: sum((measure) => measure.planned),
116
- unsent: sum((measure) => measure.unsent),
117
- unfinished: sum((measure) => measure.unfinished),
118
- failed: sum((measure) => measure.failed ?? 0),
119
- latency: join((measure) => measure.latency),
120
- service: join((measure) => measure.service),
121
- lag: join((measure) => measure.lag),
122
- censored: join((measure) => measure.censored)
123
- };
124
- };
125
- /**
126
- * This time is the tolerance of a closed-loop estimate, in ms. A send later than its expected time
127
- * by more than this tolerance is a pause of the client: a driver gap.
128
- */
129
- const CLOSED_TOLERANCE = 5;
130
- /**
131
- * This function gives the estimate of one closed-loop stream from its requests, in the order of their
132
- * sends. Each time is a time of a line of the client. The client waits `interval` ms after each reply,
133
- * thus the interval is also the pause of the driver. The function gives undefined for no request, and
134
- * for a request with no reply before the last request.
135
- */
136
- const estimateOf = (requests, end, interval) => {
137
- const start = requests[0]?.sent;
138
- if (start === void 0 || requests.slice(0, -1).some((request) => request.done === null)) return void 0;
139
- const loop = requests.map((request) => ({
140
- sent: fromStart(start, request.sent),
141
- done: request.done === null ? null : fromStart(start, request.done)
142
- }));
143
- const stop = Math.max(fromStart(start, end), ...loop.map((request) => request.done ?? request.sent), interval);
144
- const run = closedLoopPlan(loop, {
145
- interval,
146
- end: stop,
147
- tolerance: 5,
148
- pause: interval
149
- });
150
- return {
151
- ...measureLoad(run.plan, run.completions, stop),
152
- hidden: run.hidden,
153
- driverGaps: run.driverGaps,
154
- driverGapTotal: run.driverGapTotal
155
- };
156
- };
157
- /** This function gives the spread of a list of times in ms, or null for no time. */
158
- const spreadOf$1 = (values) => values.length === 0 ? null : {
159
- p50: quantity(quantile(values, .5, "nearest-rank"), "ms"),
160
- p99: quantity(quantile(values, .99, "nearest-rank"), "ms"),
161
- max: quantity(values.reduce((most, value) => Math.max(most, value), 0), "ms")
162
- };
163
- /** This time is the date of the record of a band and the date of its verdict. The record has no age, because it comes from this run. */
164
- const NOW = "2026-01-01T00:00:00.000Z";
165
- /**
166
- * This function judges one band of the latency over the pooled arrivals of the counted runs. The
167
- * top of the band reads the interval of rigor-bench: the band holds only if the interval is under its top.
168
- * The latencies of one run can follow each other, thus the width of the interval is an estimate.
169
- * The bottom of the band reads the quantile itself. It gives the text of the verdict, and if it holds.
170
- */
171
- const bandVerdict = (band, values, censored) => {
172
- const high = valueIn(band.high, "ms");
173
- const rung = {
174
- name: "band",
175
- at: {},
176
- budgets: [{
177
- kind: "quantile",
178
- measure: "latency",
179
- unit: "ms",
180
- quantile: band.quantile,
181
- limit: high
182
- }],
183
- test: "the cell"
184
- };
185
- const top = rungVerdict(rung, {
186
- rung: "band",
187
- commit: "the cell",
188
- at: NOW,
189
- real: ["the counted runs"],
190
- synthetic: [],
191
- evidence: [{
192
- kind: "quantile",
193
- measure: "latency",
194
- values,
195
- censored
196
- }]
197
- }, { now: NOW });
198
- const read = values.length + censored.length === 0 ? null : quantile([...values, ...censored], band.quantile, "nearest-rank");
199
- const low = band.low === void 0 ? null : valueIn(band.low, "ms");
200
- const above = low === null || read !== null && read >= low;
201
- const place = low === null ? `under ${high} ms` : `in [${low}, ${high}] ms`;
202
- const outcome = top.outcome === "within" && !above ? "under the bottom of the band" : top.outcome;
203
- return {
204
- holds: top.outcome === "within" && above,
205
- words: `p${band.quantile * 100} of the latency ${read === null ? "has no value" : `is ${read} ms`}, wanted ${place}: ${outcome}. ${top.reason}`
206
- };
207
- };
208
- /**
209
- * This function judges the share of failed arrivals over the counted runs against a limit. Each
210
- * planned arrival is a trial. An arrival fails if the client did not send it. It also fails with no
211
- * reply at the end of its run, or with the status of a failure. The rate budget of rigor-bench
212
- * reads the upper end of the Wilson interval at 0.95. Thus 381 arrivals with no failure hold a limit
213
- * of 1 %, and fewer arrivals cannot decide.
214
- */
215
- const failuresVerdict = (limit, failures, trials) => {
216
- const verdict = rungVerdict({
217
- name: "failures",
218
- at: {},
219
- budgets: [{
220
- kind: "rate",
221
- measure: "failures",
222
- limit
223
- }],
224
- test: "the cell"
225
- }, {
226
- rung: "failures",
227
- commit: "the cell",
228
- at: NOW,
229
- real: ["the counted runs"],
230
- synthetic: [],
231
- evidence: [{
232
- kind: "rate",
233
- measure: "failures",
234
- failures,
235
- trials
236
- }]
237
- }, { now: NOW });
238
- return {
239
- holds: verdict.outcome === "within",
240
- words: `${failures} of ${trials} arrivals failed, wanted a share under ${limit * 100} %: ${verdict.outcome}. ${verdict.reason}`
241
- };
242
- };
243
- /**
244
- * This function judges the load of an open-loop cell over its counted runs. A run that did not keep
245
- * its schedule measures its driver, not the target, thus it is a finding of that run. Each
246
- * band reads all the arrivals of the counted runs.
247
- */
248
- const loadVerdict = (prediction, runs) => {
249
- const limit = valueIn(prediction.lag, "ms");
250
- const outside = runs.flatMap((run) => {
251
- if (run.load === void 0) return [{
252
- run: run.name,
253
- why: "the client never started its schedule"
254
- }];
255
- const check = scheduleHeld(run.load, limit);
256
- return check.held ? [] : [{
257
- run: run.name,
258
- why: check.reason
259
- }];
260
- });
261
- const measures = runs.flatMap((run) => run.load === void 0 ? [] : [run.load]);
262
- const latency = measures.flatMap((measure) => measure.latency);
263
- const censored = measures.flatMap((measure) => measure.censored);
264
- const bands = prediction.bands.map((band) => bandVerdict(band, latency, censored));
265
- const total = (count) => measures.reduce((sum, measure) => sum + count(measure), 0);
266
- const planned = total((measure) => measure.planned);
267
- const unsent = total((measure) => measure.unsent);
268
- const unfinished = total((measure) => measure.unfinished);
269
- const failed = total((measure) => measure.failed ?? 0);
270
- const failures = prediction.failures === void 0 ? void 0 : failuresVerdict(prediction.failures, unsent + unfinished + failed, planned);
271
- return {
272
- holds: runs.length > 0 && outside.length === 0 && bands.every((band) => band.holds) && (failures?.holds ?? true),
273
- outside,
274
- load: {
275
- planned,
276
- unsent,
277
- unfinished,
278
- failed,
279
- latency: spreadOf$1([...latency, ...censored]),
280
- service: spreadOf$1(measures.flatMap((measure) => measure.service)),
281
- lag: spreadOf$1(measures.flatMap((measure) => measure.lag.map((lag) => Math.abs(lag)))),
282
- bands: bands.map((band) => band.words),
283
- ...failures === void 0 ? {} : { failures: failures.words }
284
- }
285
- };
286
- };
287
- /** This function gives the estimate verdict of the counted runs, or undefined when no run has an estimate. */
288
- const estimateVerdict = (estimates) => {
289
- const runs = estimates.filter((estimate) => estimate !== void 0);
290
- if (runs.length === 0) return void 0;
291
- const pool = poolOf(runs);
292
- const total = (count) => runs.reduce((sum, estimate) => sum + count(estimate), 0);
293
- const hidden = total((estimate) => estimate.hidden);
294
- const driverGaps = total((estimate) => estimate.driverGaps);
295
- const driverGapTotal = total((estimate) => estimate.driverGapTotal);
296
- const latency = spreadOf$1([...pool.latency, ...pool.censored]);
297
- const seconds = (time) => (valueIn(time, "ms") / 1e3).toFixed(3);
298
- const spread = latency === null ? "no latency" : `median ${seconds(latency.p50)} s, p99 ${seconds(latency.p99)} s, slowest ${seconds(latency.max)} s`;
299
- const gaps = driverGaps === 0 ? "no pause of the client" : `${driverGaps} pauses of the client, ${Math.round(driverGapTotal)} ms in all`;
300
- return {
301
- planned: pool.planned,
302
- hidden,
303
- driverGaps,
304
- driverGapTotal: quantity(driverGapTotal, "ms"),
305
- latency,
306
- words: `The estimate of the open loop puts back ${hidden} hidden sends, with ${gaps}: ${spread}.`
307
- };
308
- };
309
14
  // src/verdict.ts
310
15
  /** This function gives the words of the outcome of a second request: its connection, a retry, and its end. */
311
16
  const requestWords = (outcome) => `${outcome.connection}${outcome.retried ? ", a retry" : ""}, ${outcome.pending === true ? "pending" : outcome.error ?? "a reply"}`;
@@ -9618,12 +9323,7 @@ const once = async (lab, cell, environment, index, dry = false) => {
9618
9323
  };
9619
9324
  } else if (prediction.detects === null) {
9620
9325
  const window = valueIn(prediction.window, "s") * 1e3;
9621
- await probe.until([
9622
- "done",
9623
- "error",
9624
- "eof",
9625
- "deadline"
9626
- ], window).catch(() => void 0);
9326
+ await probe.until(loadEnds(cell.probe.streams), window).catch(() => void 0);
9627
9327
  } else if (prediction.detects) {
9628
9328
  const within = latestEndOf(prediction) * 2e3 + 1e4;
9629
9329
  if (cell.observer !== void 0 && cell.observer !== "client") await observerError(cell, partial, within, () => lab.server.slice(serverFrom).some((line) => line.ev === "drop"));
@@ -9975,6 +9675,6 @@ const runCell = async (cell, say = () => {}) => {
9975
9675
  target = larger;
9976
9676
  }
9977
9677
  };
9978
- export { AWS_FROM, CLIENT_CAPABILITIES, CLIENT_NAMES, CLOSED_TOLERANCE, CLOUDS, CLUSTER_STAGES, CONVERGE_MS, DAEMONS, DEBUG, DIRTY, DISK_MOUNT, DISK_RECORD_FORMAT, DISK_ROOT, DISK_SUBJECT, DROP_HANDLING, FABRIC_CLIENT, FABRIC_DEVICE, FABRIC_TARGET, FRR_IMAGE, GIVES_AWAY, HASH_SCRIPT, INJECT, INSERT, KAFKA_TAIL_MS, KEPT, LAYERS, LAYER_FACTS, LIMITS, LINGER_MS, LISTING, LOAD_FORMAT, LOAD_PATH, LOCK_NAMES, LOSS_MARGIN, MEMBER_MARKS, MONITOR_DOWN, NODE_MARKS, NOISE, PINNED, PUMP, PUMP_SLACK, QUIET_MS, RELATIVE, REPLICA_SET_STAGES, REPOSITORY, RESOURCES_EVENT, RESOURCES_PROGRAM, RESTART, ROUTERS, SCHEDULE_PATH, SEED_DOCUMENT, SHIPPED_CLIENTS, SHIPPED_NAMES, STAGES, STANDBY_READY, STATUS_SCRIPT, STEPS, STEP_DOWN, amqpClientImage, basesOf, bootstrapOf, brokerEnv, buildOf, buildRecordOf, callOf, cancelsOf, cargoVersions, cgroupKeyed, cgroupLimit, cgroupNumber, clockOffsetOf, closeOrExit, cloudOf, clusterArgs, clusterConf, clusterCutOf, clusterHostsOf, clusterOnce, clusterStagesOf, clusterViewOf, commitProblems, commitVoid, comparable, controllerEnv, cpuMaxOf, cpuStatOf, crossingsOf, cutOf, deadlineOf, delayVoids, deliveryFinding, deliveryOf, deviceOf, diskRecordProblems, diskSubjectProblems, drillOnce, drillSpan, dropFinding, dropOf, endpointAfter, envOf, environmentCounts, environmentProblems, errorsOf, estimateOf, estimateVerdict, exitOf, fieldOf, fieldsOf, firstUnanswered, folderDigest, frrConf, goHttpImage, goVersions, groupOnce, groupVerdictOf, grpcClientImage, harnessImage, harnessRecord, harnessVersion, hashOf, highestHeld, hikariClientImage, hostLimitsOf, hzOf, imageOf, imagePinProblems, imageProblems, inContext, infoOf, initiateScript, isFenceLine, isHopPlace, jarVersions, jitterOf, jitterOfLines, judge, kafkaArgs, kafkaClientImage, kafkaCutOf, kafkaOnce, kafkaPauseOnce, kafkaViewOf, lagsOf, laterMove, latestEndOf, layerOf, leafLacks, leftAfter, limitsOf, limitsProblems, loadOf, loadPlanOf, loadVerdict, locksOf, logNameOf, logTimeOf, manifestProblems, matches, measure, measureConntrack, measureDriver, measureEgress, measureGroup, measureMemory, measurePause, measurePorts, measureQueue, medianInterval, memAvailableOf, memberCommand, memberConfig, memberLineOf, memoryStatOf, mongoClientImage, monotonicAt, monotonicOf, namesGroup, networkOf, nodeClientImage, nodeCommand, nodeHttpImage, nodeIdOf, nodeLineOf, nodeNameOf, nodesOnMonotonic, noiseOf, npmDrift, npmVersions, numbersOf, onMonotonic, openClusterLab, openDiskLab, openFabric, openGroupLab, openKafkaLab, openLab, openReplicaSetLab, openStandby, pairArgs, pairOnce, pairingOf, pairingsOf, pauseReady, peersOf, pgClientImage, pingsOf, plainOf, planOf, pongsOf, poolOf, programLines, programOf, quantileOf, readCpu, readHost, readOplog, reconnectFinding, reconnectOf, recordProblems, recoveryFindings, recoveryOf, referenceOf, reorderingOf, replicaSetArgs, replicaSetOnce, replicaSetStagesOf, requestOf, requestWords, resourceArgs, resourceChange, resourceReader, resourceReadingIn, resourceReadingOf, restamped, roomNeeded, roomVoidOf, routeLine, routerImage, routesOf, runCell, runDiskFault, seedScript, sentinelConfig, sessionsOf, shippedClientRecord, shippedSource, sliceQuery, socketAt, socketOf, socketsOf, spread, spreadOf, stagesOf, standaloneCommand, standbyCommand, statusViewOf, stealShare, stepBand, stopScript, streamEnded, streamOf, streamsLoadOf, subjectClient, subjectProblems, subscriptionsOf, substrateHere, substrateKey, substrateOf, substrateOn, targetImageOf, targetSourceOf, templated, toolJsonOf, topicOf, topologyOf, toxicBody, unlockedManifests, unpinnedBases, unpoolable, verdictOf, versionsOf, viewOf, writesOf };
9678
+ export { AWS_FROM, CLIENT_CAPABILITIES, CLIENT_NAMES, CLOSED_TOLERANCE, CLOUDS, CLUSTER_STAGES, CONVERGE_MS, DAEMONS, DEBUG, DIRTY, DISK_MOUNT, DISK_RECORD_FORMAT, DISK_ROOT, DISK_SUBJECT, DROP_HANDLING, FABRIC_CLIENT, FABRIC_DEVICE, FABRIC_TARGET, FRR_IMAGE, GIVES_AWAY, HASH_SCRIPT, INJECT, INSERT, KAFKA_TAIL_MS, KEPT, LAYERS, LAYER_FACTS, LIMITS, LINGER_MS, LISTING, LOAD_FORMAT, LOAD_PATH, LOAD_POOL_LIMIT, LOCK_NAMES, LOSS_MARGIN, MEMBER_MARKS, MONITOR_DOWN, NODE_MARKS, NOISE, PINNED, PUMP, PUMP_SLACK, QUIET_MS, RELATIVE, REPLICA_SET_STAGES, REPOSITORY, RESOURCES_EVENT, RESOURCES_PROGRAM, RESTART, ROUTERS, SCHEDULE_PATH, SEED_DOCUMENT, SHIPPED_CLIENTS, SHIPPED_NAMES, STAGES, STANDBY_READY, STATUS_SCRIPT, STEPS, STEP_DOWN, amqpClientImage, basesOf, bootstrapOf, brokerEnv, buildOf, buildRecordOf, callOf, cancelsOf, cargoVersions, cgroupKeyed, cgroupLimit, cgroupNumber, clockOffsetOf, closeOrExit, cloudOf, clusterArgs, clusterConf, clusterCutOf, clusterHostsOf, clusterOnce, clusterStagesOf, clusterViewOf, commitProblems, commitVoid, comparable, connectionsProblems, controllerEnv, cpuMaxOf, cpuStatOf, crossingsOf, cutOf, deadlineOf, delayVoids, deliveryFinding, deliveryOf, deviceOf, diskRecordProblems, diskSubjectProblems, drillOnce, drillSpan, dropFinding, dropOf, endpointAfter, envOf, environmentCounts, environmentProblems, errorsOf, estimateOf, estimateVerdict, exitOf, fieldOf, fieldsOf, firstUnanswered, folderDigest, frrConf, goHttpImage, goVersions, groupOnce, groupVerdictOf, grpcClientImage, harnessImage, harnessRecord, harnessVersion, hashOf, highestHeld, hikariClientImage, hostLimitsOf, hzOf, imageOf, imagePinProblems, imageProblems, inContext, infoOf, initiateScript, isFenceLine, isHopPlace, jarVersions, jitterOf, jitterOfLines, judge, kafkaArgs, kafkaClientImage, kafkaCutOf, kafkaOnce, kafkaPauseOnce, kafkaViewOf, lagsOf, laterMove, latestEndOf, layerOf, leafLacks, leftAfter, limitsOf, limitsProblems, loadOf, loadPlanOf, loadVerdict, locksOf, logNameOf, logTimeOf, manifestProblems, matches, measure, measureConntrack, measureDriver, measureEgress, measureGroup, measureMemory, measurePause, measurePorts, measureQueue, medianInterval, memAvailableOf, memberCommand, memberConfig, memberLineOf, memoryStatOf, mongoClientImage, monotonicAt, monotonicOf, namesGroup, networkOf, nodeClientImage, nodeCommand, nodeHttpImage, nodeIdOf, nodeLineOf, nodeNameOf, nodesOnMonotonic, noiseOf, npmDrift, npmVersions, numbersOf, onMonotonic, openClusterLab, openDiskLab, openFabric, openGroupLab, openKafkaLab, openLab, openReplicaSetLab, openStandby, pairArgs, pairOnce, pairingOf, pairingsOf, pauseReady, peersOf, pgClientImage, pingsOf, plainOf, planOf, pongsOf, poolOf, programLines, programOf, quantileOf, readCpu, readHost, readOplog, reconnectFinding, reconnectOf, recordProblems, recoveryFindings, recoveryOf, referenceOf, reorderingOf, replicaSetArgs, replicaSetOnce, replicaSetStagesOf, requestOf, requestWords, resourceArgs, resourceChange, resourceReader, resourceReadingIn, resourceReadingOf, restamped, roomNeeded, roomVoidOf, routeLine, routerImage, routesOf, runCell, runDiskFault, seedScript, sentinelConfig, sessionsOf, shippedClientRecord, shippedSource, sliceQuery, socketAt, socketOf, socketsOf, spread, spreadOf, stagesOf, standaloneCommand, standbyCommand, statusViewOf, stealShare, stepBand, stopScript, streamEnded, streamOf, streamsLoadOf, subjectClient, subjectProblems, subscriptionsOf, substrateHere, substrateKey, substrateOf, substrateOn, targetImageOf, targetSourceOf, templated, toolJsonOf, topicOf, topologyOf, toxicBody, unlockedManifests, unpinnedBases, unpoolable, verdictOf, versionsOf, viewOf, writesOf };
9979
9679
 
9980
9680
  //# sourceMappingURL=index.js.map