@mark1russell7/harness 0.16.8 → 0.16.9

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 CHANGED
@@ -456,6 +456,9 @@ The injector refuses `protocol` on a fault other than a black hole, a reject or
456
456
  - Each later band (`then`) has its own reference and line. A later band outside its band, or absent, is a finding. So is a line that the prediction names as quiet, after the fault.
457
457
  - For a silent prediction, a flow of an open socket of the driver that a router forgot is a finding.
458
458
  - A silent prediction can give a band for the forget of the flow of the socket of the driver (`Prediction.middlebox`). The band counts from the last segment that the socket got before the fault. A forget of another socket of the driver is still a finding.
459
+ - **A port cell** (`measurePorts`). The `round` lines of the client give each search, and the prober gives the retransmissions of the client.
460
+ - The client writes two `stack` lines before its first round and two after its last round. Each line has the counters of the network stack of one end: snmp, netstat and the devices of its namespace, and softnet_stat of the host.
461
+ - The reading gives the change of each counter that moved, by end (`PortsReading.stack`). A finding of a retransmission names each counter of a drop, a skip, a reset or a retransmission that moved. Thus a lost ACK tells where it went.
459
462
 
460
463
  ## The verdict
461
464
 
package/build/index.d.ts CHANGED
@@ -1908,6 +1908,17 @@ interface PortsReading {
1908
1908
  readonly freed: number;
1909
1909
  /** This count is the connects that failed before the last `freed` line. */
1910
1910
  readonly tries: number;
1911
+ /** These counters of the network stack moved in the run, or null for a run with no `stack` lines. */
1912
+ readonly stack: StackChange | null;
1913
+ }
1914
+ /**
1915
+ * A stack change is the change of each counter of the network stack at each end. The change goes from
1916
+ * the `stack` line before the first round to the line after the last round. A counter that did not move
1917
+ * is absent.
1918
+ */
1919
+ interface StackChange {
1920
+ readonly client: Readonly<Record<string, number>>;
1921
+ readonly target: Readonly<Record<string, number>>;
1911
1922
  }
1912
1923
  /**
1913
1924
  * This function reads one run of a port cell. The `round` lines give each search. The `closing` and
@@ -3007,4 +3018,4 @@ export declare const environmentCounts: (cell: Cell, runs: number) => number[];
3007
3018
  * Each environment does a warm-up first, and the result keeps it apart from the counted runs.
3008
3019
  */
3009
3020
  export declare const runCell: (cell: Cell, say?: (line: string) => void) => Promise<CellResult>;
3010
- 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 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 HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, type Lab, type Layer, type LeafViews, 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, 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 RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SocketPlace, type Spread, 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, environmentProblems, isHopPlace, latestEndOf };
3021
+ 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 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 HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, type Lab, type Layer, type LeafViews, 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, 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 RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, 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, environmentProblems, isHopPlace, latestEndOf };
package/build/index.js CHANGED
@@ -2348,6 +2348,42 @@ const measurePause = (run, prediction) => {
2348
2348
  // src/ports.ts
2349
2349
  /** This errno ends a search that found no port. */
2350
2350
  const NO_PORT = "EADDRNOTAVAIL";
2351
+ /** This pattern names the counters of a drop, a skip, a reset or a retransmission. A finding of a lost segment names them. */
2352
+ const LOSS = /Drop|drop|Skipped|Overflow|Errs|errs|Discards|Challenge|PAWS|Rsts|Retrans/;
2353
+ const countersOf = (line) => {
2354
+ const counters = line?.["counters"];
2355
+ if (counters === null || typeof counters !== "object" || Array.isArray(counters)) return void 0;
2356
+ return Object.fromEntries(Object.entries(counters).filter((entry) => typeof entry[1] === "number"));
2357
+ };
2358
+ /** This function gives the counters of one end that moved from its `stack` line at the start to its line at the end. */
2359
+ const changeOf = (events, side) => {
2360
+ const at = (point) => countersOf(events.find((event) => event.ev === "stack" && event["side"] === side && event["at"] === point));
2361
+ const start = at("start");
2362
+ const end = at("end");
2363
+ if (start === void 0 || end === void 0) return null;
2364
+ return Object.fromEntries(Object.entries(end).flatMap(([name, value]) => {
2365
+ const change = value - (start[name] ?? 0);
2366
+ return change === 0 ? [] : [[name, change]];
2367
+ }));
2368
+ };
2369
+ /** This function gives the stack change of a run, or null when an end has no pair of `stack` lines. */
2370
+ const stackOf = (events) => {
2371
+ const client = changeOf(events, "client");
2372
+ const target = changeOf(events, "target");
2373
+ return client === null || target === null ? null : {
2374
+ client,
2375
+ target
2376
+ };
2377
+ };
2378
+ /** This function gives the words of the counters of a loss that moved at each end. */
2379
+ const lossWords = (stack) => {
2380
+ if (stack === null) return "the run has no stack lines";
2381
+ const words = ["client", "target"].flatMap((side) => {
2382
+ const moved = Object.entries(stack[side]).filter(([name]) => LOSS.test(name));
2383
+ return moved.length === 0 ? [] : [`the ${side}: ${moved.map(([name, change]) => `${name} ${change > 0 ? "+" : ""}${change}`).join(", ")}`];
2384
+ });
2385
+ return words.length === 0 ? "no counter of a loss moved at either end" : words.join("; ");
2386
+ };
2351
2387
  const portsOf = (line) => Array.isArray(line["ports"]) ? line["ports"].filter((port) => typeof port === "number") : [];
2352
2388
  /** This function says if the ports of the parity of the low port come first in one search. */
2353
2389
  const lowFirst = (ports, low) => {
@@ -2403,7 +2439,8 @@ const measurePorts = (run, expected) => {
2403
2439
  firstFreed: closing === void 0 || first === void 0 ? null : between$2(closing.t, first.t),
2404
2440
  lastFreed: closing === void 0 || last === void 0 ? null : between$2(closing.t, last.t),
2405
2441
  freed: freedLines.length,
2406
- tries: last === void 0 || typeof last["tries"] !== "number" ? 0 : last["tries"]
2442
+ tries: last === void 0 || typeof last["tries"] !== "number" ? 0 : last["tries"],
2443
+ stack: stackOf(events)
2407
2444
  };
2408
2445
  const found = [];
2409
2446
  const searches = expected.rounds * expected.destinations;
@@ -2419,7 +2456,7 @@ const measurePorts = (run, expected) => {
2419
2456
  if (share < low || share > high) found.push(`the share of ${count} connects is ${share}, outside [${low}, ${high}]`);
2420
2457
  }
2421
2458
  if (expected.lowFirst === true && !rounds.every((round) => lowFirst(portsOf(round), expected.low))) found.push("a search got a port of the other parity before each port of the parity of the low port");
2422
- if (expected.retransmissions !== void 0 && retransmissions !== expected.retransmissions) found.push(`${retransmissions} retransmissions, not ${expected.retransmissions}`);
2459
+ if (expected.retransmissions !== void 0 && retransmissions !== expected.retransmissions) found.push(`${retransmissions} retransmissions, not ${expected.retransmissions} (${lossWords(ports.stack)})`);
2423
2460
  if (expected.freed !== void 0) {
2424
2461
  const held = Math.max(...expected.counts);
2425
2462
  if (ports.freed !== held) found.push(`${ports.freed} ports came back, not ${held}`);