@mark1russell7/harness 0.16.7 → 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 +16 -0
- package/build/{cell-FMlgjqVq.d.ts → cell-CYOKWfwg.d.ts} +46 -1
- package/build/image-YlflAajQ.js.map +1 -1
- package/build/index.d.ts +62 -2
- package/build/index.js +227 -55
- package/build/index.js.map +1 -1
- package/build/schema.d.ts +1 -1
- package/image/Dockerfile +1 -1
- package/image/native/src/bin/egress.rs +540 -0
- package/image/native/src/bin/ports.rs +33 -1
- package/image/native/src/lib.rs +111 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -190,6 +190,19 @@ A cell can set the limits of the memory controller of cgroup v2 for its client (
|
|
|
190
190
|
- **The law of the OOM killer** (`MemoryOomPrediction`) gives the outcome of each task and the count of the event `oom_kill` of the cgroup.
|
|
191
191
|
- **A void run.** A run is void when the cgroup reads other limits than the cell, or when the client stops before its end. A throttle run is also void when the client did not lock its pages, or on a kernel with another HZ. It is void too when the judge reads less than the share `read` of the steps above the high. The judge does not read a step whose usage rose by more or less than one batch, outside the drift.
|
|
192
192
|
|
|
193
|
+
## The egress qdisc of a client
|
|
194
|
+
|
|
195
|
+
A cell can put a qdisc at the root of the interface of its client, and judge the time that each datagram leaves it (`EgressPrediction`, SYS-124). The law of netem and tbf is in `@mark1russell7/algebra` (`egress.ts`), from the sources of Linux.
|
|
196
|
+
|
|
197
|
+
- **The egress client** is `/opt/harness/egress` of the image `harness`. It has two commands:
|
|
198
|
+
- `sink PORT` binds a UDP socket and reads each datagram. The target of an egress cell is this sink.
|
|
199
|
+
- `send` puts the qdisc of `--qdisc` at the root of `eth0` with `tc qdisc replace`. Then it sends each `--burst AT_MS:COUNT:PAYLOAD` of UDP datagrams to the target. The qdisc and the pin of the neighbour need the capability `NET_ADMIN` of the client.
|
|
200
|
+
- **The stamps of the kernel.** The client sets `SO_TIMESTAMPING` with the stamps `SCHED` and `SOFTWARE`. The kernel gives a stamp when the qdisc takes a datagram and a stamp when the device takes it from the qdisc. The client moves each stamp from `CLOCK_REALTIME` to `CLOCK_MONOTONIC`. A drop of the qdisc is a send that gives `ENOBUFS`.
|
|
201
|
+
- **No other traffic.** Before the qdisc, the client pins the neighbour of the target as `PERMANENT`, thus no ARP packet goes through the qdisc. It reads the counts of the root qdisc before and after the bursts.
|
|
202
|
+
- **The lines of the egress client.** The `ready` line gives the MTU, the root qdisc as `tc` reads it and the neighbour. A `packet` line gives each datagram: its key, its burst, its errno and its two stamps. The client ends with the counts of the qdisc (`stats`), the step of the clock (`clock`) and `done`.
|
|
203
|
+
- **The law of a datagram** (`EgressPacketLaw`) is `sent` or `dropped`. A sent datagram has a time band after the first arrival of its burst. A drop is at the `limit` of the queue, or at the `size` of the burst of tbf. The judge (`measureEgress`) compares each datagram with its law.
|
|
204
|
+
- **A void run.** A run is void when the client stops before its end or when the root qdisc is of another kind. A neighbour that is not permanent voids a run too. It is void too when a send fails with another error. A burst that spreads more than `spread`, or that starts more than `jitter` off its time, voids its run. The counts of the qdisc void a run when other traffic went through it. A step of the clock above 100 µs voids a run, and a read of less than the share `read` of the departures voids it too.
|
|
205
|
+
|
|
193
206
|
## The subjects
|
|
194
207
|
|
|
195
208
|
A subject (`Subject`, `image.ts`) is the program under test, as data. The harness does not import the program. It starts the image of the program. Thus another repository can give its own subject, with its own release in it.
|
|
@@ -443,6 +456,9 @@ The injector refuses `protocol` on a fault other than a black hole, a reject or
|
|
|
443
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.
|
|
444
457
|
- For a silent prediction, a flow of an open socket of the driver that a router forgot is a finding.
|
|
445
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.
|
|
446
462
|
|
|
447
463
|
## The verdict
|
|
448
464
|
|
|
@@ -883,6 +883,11 @@ type Prediction = {
|
|
|
883
883
|
* `memory.high`, or the victim of its OOM killer. A value outside it is a finding of its run.
|
|
884
884
|
*/
|
|
885
885
|
readonly memory?: MemoryPrediction;
|
|
886
|
+
/**
|
|
887
|
+
* This record is the law of the qdisc at the root of the interface of the client. It gives the
|
|
888
|
+
* time that each datagram leaves the qdisc, or its drop. A value outside it is a finding of its run.
|
|
889
|
+
*/
|
|
890
|
+
readonly egress?: EgressPrediction;
|
|
886
891
|
};
|
|
887
892
|
/** A queue band is a time from one line of a queue cell to another line, with its two bounds. */
|
|
888
893
|
interface QueueBand {
|
|
@@ -954,6 +959,46 @@ interface MemoryOomPrediction {
|
|
|
954
959
|
}
|
|
955
960
|
/** This prediction is the law of the memory controller of one cgroup. */
|
|
956
961
|
type MemoryPrediction = MemoryThrottlePrediction | MemoryOomPrediction;
|
|
962
|
+
/** This burst is one group of datagrams of an egress cell, which the client sends back to back. */
|
|
963
|
+
interface EgressBurst {
|
|
964
|
+
/** This time is the start of the burst after the start of the first burst. */
|
|
965
|
+
readonly at: Quantity;
|
|
966
|
+
readonly count: number;
|
|
967
|
+
/** This count is the bytes of the UDP payload of each datagram. An IPv4 frame has 42 bytes more. */
|
|
968
|
+
readonly payload: number;
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* This law is the end of one datagram in the qdisc. A datagram that leaves has a band from the first
|
|
972
|
+
* arrival of its burst in the qdisc. A dropped datagram names the limit that drops it.
|
|
973
|
+
*/
|
|
974
|
+
type EgressPacketLaw = {
|
|
975
|
+
readonly kind: "sent";
|
|
976
|
+
readonly left: QueueBand;
|
|
977
|
+
} | {
|
|
978
|
+
readonly kind: "dropped";
|
|
979
|
+
readonly why: "limit" | "size";
|
|
980
|
+
};
|
|
981
|
+
/**
|
|
982
|
+
* This prediction is the law of the qdisc at the root of the interface of the client. It reads the
|
|
983
|
+
* lines of the egress client. The client sets the qdisc with `tc`, and it sends bursts of UDP datagrams to
|
|
984
|
+
* the sink of the target. The kernel stamps each datagram when the qdisc takes it (SCHED) and when
|
|
985
|
+
* the device takes it from the qdisc (SND).
|
|
986
|
+
*/
|
|
987
|
+
interface EgressPrediction {
|
|
988
|
+
/** These words set the qdisc, as `tc qdisc replace dev eth0 root` takes them. */
|
|
989
|
+
readonly qdisc: string;
|
|
990
|
+
/** This name is the kind of qdisc that `tc` reads back. A run with another kind is void. */
|
|
991
|
+
readonly kind: string;
|
|
992
|
+
readonly bursts: readonly EgressBurst[];
|
|
993
|
+
/** These laws are one for each datagram, in the order of the sends. */
|
|
994
|
+
readonly packets: readonly EgressPacketLaw[];
|
|
995
|
+
/** This time is the most that the arrivals of one burst spread. A run with a wider burst is void. */
|
|
996
|
+
readonly spread: Quantity;
|
|
997
|
+
/** This time is the most that a later burst starts off its time. A run with a burst further off is void. */
|
|
998
|
+
readonly jitter: Quantity;
|
|
999
|
+
/** This share is the least part of the departures that the judge reads. A run with less is void. */
|
|
1000
|
+
readonly read: number;
|
|
1001
|
+
}
|
|
957
1002
|
/** This prediction tells how one connection of a queue cell ends. */
|
|
958
1003
|
interface QueueEnd {
|
|
959
1004
|
readonly errno: string;
|
|
@@ -1832,4 +1877,4 @@ interface RunTopology {
|
|
|
1832
1877
|
};
|
|
1833
1878
|
}>>;
|
|
1834
1879
|
}
|
|
1835
|
-
export {
|
|
1880
|
+
export { MiddleboxExpectation as $, HopPlace as A, RunPart as At, LineCount as B, StageBand as Bt, FaultPlace as C, RouterHop as Ct, GroupRole as D, RunDrill as Dt, GroupPrediction as E, RunBackup as Et, ImageSource as F, SentinelEvent as Ft, LoadStream as G, WsProbe as Gt, LoadBand as H, Target as Ht, Jitter as I, SentinelStage as It, MemoryOomTask as J, latestEndOf as Jt, MemoryLimits as K, environmentProblems as Kt, Kafka as L, Shipped as Lt, HopWrite as M, RunRoute as Mt, HostSysctl as N, RunStream as Nt, Hop as O, RunFabric as Ot, HttpProbe as P, RunTopology as Pt, MiddleboxEvent as Q, KafkaPause as R, ShippedImage as Rt, Fault as S, RequestPrediction as St, GroupPlace as T, Run as Tt, LoadPlan as U, Topology as Ut, LineMatch as V, Subject as Vt, LoadPrediction as W, Toxic as Wt, MemoryStep as X, MemoryPrediction as Y, MemoryThrottlePrediction as Z, EgressBurst as _, Recovers as _t, ClientCapability as a, PausePrediction as at, Fabric as b, ReplicaSetStage as bt, ClusterClientAt as c, Prediction as ct, CountBand as d, ProxyTime as dt, MiddleboxForm as et, DeliveryPrediction as f, QueueBand as ft, DriverStep as g, Reconnects as gt, DriverBand as h, QueuePrediction as ht, Client as i, PauseBand as it, HopSignal as j, RunPause as jt, HopEvent as k, RunGroup as kt, ClusterStage as l, ProbeEvent as lt, DrillRoom as m, QueueEnd as mt, CLIENT_CAPABILITIES as n, Outcomes as nt, ClientImage as o, PinnedImage as ot, Drill as p, QueueConnection as pt, MemoryOomPrediction as q, isHopPlace as qt, Cell as r, Pair as rt, Cluster as s, PortsPrediction as st, BuildImage as t, Observer as tt, ConntrackPrediction as u, ProxyHop as ut, EgressPacketLaw as v, Reference as vt, Group as w, RttRange as wt, FabricManifest as x, Replies as xt, EgressPrediction as y, ReplicaSet as yt, KernelRecord as z, Stage as zt };
|