@mark1russell7/harness 0.15.10 → 0.16.1
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 +1692 -1692
- package/build/index.js +25 -4
- package/build/index.js.map +1 -1
- package/package.json +3 -3
package/build/index.d.ts
CHANGED
|
@@ -471,1539 +471,1830 @@ export declare const namesGroup: (line: string, group: string) => boolean;
|
|
|
471
471
|
/** This function reads one run of a paused consumer against its law. */
|
|
472
472
|
export declare const measurePause: (run: Run, prediction: PausePrediction) => Measured;
|
|
473
473
|
/**
|
|
474
|
-
*
|
|
475
|
-
* of
|
|
476
|
-
*
|
|
474
|
+
* A fabric is a routed network between the client and the target, on layer E3 (docs/S7.md). Four
|
|
475
|
+
* routers of FRRouting, two leaves and two spines, run real BGP over veth pairs that containerlab
|
|
476
|
+
* makes. The client hangs off leaf1 and the target off leaf2. The path between them goes through
|
|
477
|
+
* spine1 by a weight, and spine2 holds the other path. A cell silences spine1, and the routes of
|
|
478
|
+
* the leaves move to spine2 when a detector of the routers fires.
|
|
477
479
|
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
* time, thus the highest sequence number is also the latest write.
|
|
482
|
-
*/
|
|
483
|
-
/** This size is one document of generated data. A tenant holds as many documents as its size needs. */
|
|
484
|
-
export declare const SEED_DOCUMENT = 65536;
|
|
485
|
-
/** This count is how far the lost writes can be from the writes after the last backup: the writes in flight at the fault. */
|
|
486
|
-
export declare const LOSS_MARGIN = 2;
|
|
487
|
-
/**
|
|
488
|
-
* This function gives the most disk that a drill needs, from the disk that it can use. The peak comes
|
|
489
|
-
* before the fault. Then each member holds the data and its oplog, and the backup host holds the
|
|
490
|
-
* dump. The seed goes through the oplog, thus each oplog holds the data up to its own size. The
|
|
491
|
-
* slices are small: the writes of one client in a few seconds.
|
|
480
|
+
* This file holds the plan of the fabric as pure functions, and `openFabric` that starts it. A lab
|
|
481
|
+
* opens a fabric with `Topology.fabric`. Thus the client, the target, the prober and the verdict
|
|
482
|
+
* stay the same as on layer E1. The fabric needs a Linux host with containerlab and sudo.
|
|
492
483
|
*/
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
484
|
+
/** This image is FRRouting 10.7.1, pinned by digest. */
|
|
485
|
+
export declare const FRR_IMAGE = "quay.io/frrouting/frr:10.7.1@sha256:e995beaa50fdc9edb35eadcfefa29b7f062cc06f2b812613789b68fa541554d2";
|
|
486
|
+
/** This device is the side of the fabric in the client and in the target. Docker keeps eth0. */
|
|
487
|
+
export declare const FABRIC_DEVICE = "eth1";
|
|
488
|
+
/** This address is the client on its network behind leaf1. */
|
|
489
|
+
export declare const FABRIC_CLIENT = "10.1.0.2";
|
|
490
|
+
/** This address is the target on its network behind leaf2. */
|
|
491
|
+
export declare const FABRIC_TARGET = "10.2.0.2";
|
|
492
|
+
/** A router is one box of the fabric, as data. */
|
|
493
|
+
interface Router {
|
|
494
|
+
readonly name: string;
|
|
495
|
+
readonly as: number;
|
|
496
|
+
readonly id: string;
|
|
497
|
+
readonly interfaces: Readonly<Record<string, string>>;
|
|
498
|
+
readonly neighbors: ReadonlyArray<{
|
|
499
|
+
readonly address: string;
|
|
500
|
+
readonly as: number;
|
|
501
|
+
readonly weight?: number;
|
|
502
|
+
}>;
|
|
503
|
+
/** This prefix is the network behind a leaf, which its BGP advertises. */
|
|
504
|
+
readonly network?: string;
|
|
505
|
+
/** This prefix is the network behind the other leaf. A move is a change of its route. */
|
|
506
|
+
readonly remote?: string;
|
|
507
|
+
}
|
|
508
|
+
/** These are the routers. Each leaf prefers spine1 by a weight of 100, thus the path of each run is known. */
|
|
509
|
+
export declare const ROUTERS: readonly Router[];
|
|
510
|
+
/** This text is the `daemons` file of each router: BGP and BFD, on top of what FRRouting always starts. */
|
|
511
|
+
export declare const DAEMONS: string;
|
|
500
512
|
/**
|
|
501
|
-
* This
|
|
502
|
-
*
|
|
513
|
+
* This function gives the configuration of a router. Graceful restart is off: after a hold expiry,
|
|
514
|
+
* a helper can keep the stale routes, and the move that a cell measures does not come.
|
|
515
|
+
* `maximum-paths 1` keeps one path, thus a move is one change of one route.
|
|
503
516
|
*/
|
|
504
|
-
export declare const
|
|
505
|
-
/** This script prints the hash of the collection `tenants`. It takes locks, thus a run reads it with no writer. */
|
|
506
|
-
export declare const HASH_SCRIPT: string;
|
|
507
|
-
/** This function gives the hash from the output of `HASH_SCRIPT`. */
|
|
508
|
-
export declare const hashOf: (text: string) => string;
|
|
509
|
-
/** This function gives the command of a server with no set, on its own port. A client of the set cannot reach that server, and a restore writes to it. */
|
|
510
|
-
export declare const standaloneCommand: (set: ReplicaSet, port: number) => string;
|
|
517
|
+
export declare const frrConf: (router: Router, fabric: Fabric) => string;
|
|
511
518
|
/**
|
|
512
|
-
* This
|
|
513
|
-
*
|
|
514
|
-
*
|
|
519
|
+
* This function gives the topology file of containerlab. The client and the target are containers
|
|
520
|
+
* of the lab, and the fabric adds a device to each. Each link has the MTU of a Docker network, thus
|
|
521
|
+
* a segment is as long as on layer E1. The default of containerlab is 9500. The management network
|
|
522
|
+
* belongs to the lab, and Docker chooses its subnet.
|
|
515
523
|
*/
|
|
516
|
-
export declare const
|
|
517
|
-
/**
|
|
518
|
-
interface
|
|
519
|
-
readonly
|
|
520
|
-
readonly
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
readonly last: OplogTime | null;
|
|
525
|
-
readonly highest: number | null;
|
|
524
|
+
export declare const topologyOf: (lab: string, dir: string, client: string, target: string) => string;
|
|
525
|
+
/** A route line is one line of `ip -ts -o monitor route`, with its time on the wall clock in ms. */
|
|
526
|
+
interface RouteLine {
|
|
527
|
+
readonly wall: number;
|
|
528
|
+
readonly deleted: boolean;
|
|
529
|
+
readonly prefix: string;
|
|
530
|
+
readonly via: string | null;
|
|
531
|
+
readonly dev: string | null;
|
|
526
532
|
}
|
|
527
|
-
/** This function reads
|
|
528
|
-
export declare const
|
|
529
|
-
/**
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
/** A recovery measurement is what a drill found, beside the writes of the run. */
|
|
534
|
-
interface RecoveryMeasured {
|
|
535
|
-
/** This time is from the reply to the last accepted write that the store kept to the fault, or null with no such write. */
|
|
536
|
-
readonly rpo: Quantity | null;
|
|
537
|
-
/** This time is `rpo` less the age of the drill: what a schedule adds to its interval. It is null for a control and for an election. */
|
|
538
|
-
readonly excess: Quantity | null;
|
|
539
|
-
/** These are the accepted writes that the store lost, below a write that it kept. A restore must leave none. */
|
|
540
|
-
readonly holes: readonly number[];
|
|
541
|
-
/** This count is the number of accepted writes after the last write of the last backup, or null without a backup. */
|
|
542
|
-
readonly afterBackup: number | null;
|
|
543
|
-
/** This flag tells if the tenants have the same data after the recovery, or null when that is not known. */
|
|
544
|
-
readonly sameData: boolean | null;
|
|
533
|
+
/** This function reads a line of `ip -ts -o monitor route`, or it gives null for another line. The clock of a container is UTC. */
|
|
534
|
+
export declare const routeLine: (text: string) => RouteLine | null;
|
|
535
|
+
/** A clock pair is one instant on the monotonic clock in ns and on the wall clock in ms. */
|
|
536
|
+
interface ClockPair {
|
|
537
|
+
readonly mono: number;
|
|
538
|
+
readonly wall: number;
|
|
545
539
|
}
|
|
546
|
-
/** This function gives the measurement of a drill, from its run. `t0` is the fault. */
|
|
547
|
-
export declare const recoveryOf: (drill: Drill, run: Run, t0: number) => RecoveryMeasured;
|
|
548
|
-
/** This function gives the findings of a drill: each rule of a recovery that its run broke. */
|
|
549
|
-
export declare const recoveryFindings: (measured: RecoveryMeasured, writes: Writes) => string[];
|
|
550
540
|
/**
|
|
551
|
-
* This
|
|
552
|
-
*
|
|
553
|
-
* The
|
|
554
|
-
* module also gives what became of each write.
|
|
541
|
+
* This function takes a time on the wall clock to the monotonic clock. The harness runs on the host
|
|
542
|
+
* of the containers, thus `process.hrtime` reads the CLOCK_MONOTONIC of the injector and the
|
|
543
|
+
* prober. The error of the pair is approximately 1 ms, the step of `Date.now`.
|
|
555
544
|
*/
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
readonly
|
|
561
|
-
|
|
562
|
-
|
|
545
|
+
export declare const monotonicAt: (wall: number, pair: ClockPair) => number;
|
|
546
|
+
/** This function gives the state of the BGP sessions from `show bgp neighbors json`. */
|
|
547
|
+
export declare const sessionsOf: (json: string) => {
|
|
548
|
+
readonly up: number;
|
|
549
|
+
readonly established: number;
|
|
550
|
+
};
|
|
551
|
+
/** These are the views of a leaf that tell if a run can start on it. */
|
|
552
|
+
interface LeafViews {
|
|
553
|
+
readonly neighbors: string;
|
|
554
|
+
/** This text is the kernel's route to the far network, from `ip -o route show`. */
|
|
555
|
+
readonly route: string;
|
|
556
|
+
/** This text is `show bgp ipv4 unicast PREFIX json`. */
|
|
557
|
+
readonly paths: string;
|
|
558
|
+
/** This text is `show bfd peers json`, or null when the fabric has no BFD. */
|
|
559
|
+
readonly bfd: string | null;
|
|
563
560
|
}
|
|
564
561
|
/**
|
|
565
|
-
*
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
* - `lost` are the writes that a primary accepted and the group did not keep. They are the cost
|
|
569
|
-
* of a split brain. It is null when the group did not converge after the run.
|
|
570
|
-
* - `unknown` are the writes that the client sent and did not see accepted: an error, or no answer.
|
|
571
|
-
* `held` tells if the group kept each one, or null when it did not converge.
|
|
572
|
-
* - `duplicates` has one entry for each extra copy that the group holds: a write held three times
|
|
573
|
-
* has two entries. It is null when the group did not converge. A key holds one copy by
|
|
574
|
-
* construction, thus only a list can show a copy.
|
|
562
|
+
* This function tells what a leaf still lacks before a run, or it gives null. The two sessions must
|
|
563
|
+
* be up and the route must be on spine1. Spine2 must hold the other path. Without these, the fault
|
|
564
|
+
* of a run acts on another path, or nothing can take over.
|
|
575
565
|
*/
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
566
|
+
export declare const leafLacks: (views: LeafViews) => string | null;
|
|
567
|
+
/**
|
|
568
|
+
* This function gives the later move of the leaves after an instant: for each leaf, the first route
|
|
569
|
+
* to its far network that leaves spine1. It gives null when a leaf has no move. The later move ends
|
|
570
|
+
* the outage in the two directions.
|
|
571
|
+
*/
|
|
572
|
+
export declare const laterMove: (routes: readonly RunRoute[], after: number) => number | null;
|
|
573
|
+
/** A fabric lab is the open fabric of a lab. */
|
|
574
|
+
interface FabricLab {
|
|
575
|
+
/** These are the lines of the route monitors of the leaves, on the monotonic clock. */
|
|
576
|
+
readonly routes: readonly RunRoute[];
|
|
577
|
+
/** This method drops each packet of spine1 in one commit, and the links stay up. */
|
|
578
|
+
silence(): Promise<{
|
|
579
|
+
t0: number;
|
|
580
|
+
t1: number;
|
|
584
581
|
}>;
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
582
|
+
/** This method ends a silence. */
|
|
583
|
+
clear(): Promise<{
|
|
584
|
+
t0: number;
|
|
585
|
+
t1: number;
|
|
586
|
+
}>;
|
|
587
|
+
/** This method waits until each leaf is on spine1 with each session up. */
|
|
588
|
+
ready(): Promise<void>;
|
|
589
|
+
/** This method gives the count of established sessions of each leaf so far. */
|
|
590
|
+
sessions(): Promise<Readonly<Record<string, number>>>;
|
|
591
|
+
/** This method gives the record of the fabric for a manifest. */
|
|
592
|
+
manifest(): FabricManifest;
|
|
593
|
+
/** This method destroys the routers. */
|
|
594
|
+
close(): Promise<void>;
|
|
597
595
|
}
|
|
598
|
-
/**
|
|
599
|
-
interface
|
|
600
|
-
|
|
601
|
-
readonly
|
|
602
|
-
readonly
|
|
603
|
-
|
|
604
|
-
readonly
|
|
605
|
-
readonly
|
|
606
|
-
readonly
|
|
607
|
-
|
|
608
|
-
readonly lags?: readonly Quantity[];
|
|
609
|
-
/** This is what a recovery drill measured, for a drill only. */
|
|
610
|
-
readonly recovery?: RecoveryMeasured;
|
|
596
|
+
/** These are the parts of a lab that a fabric uses. */
|
|
597
|
+
interface FabricParts {
|
|
598
|
+
readonly fabric: Fabric;
|
|
599
|
+
readonly image: string;
|
|
600
|
+
readonly client: StartedTestContainer;
|
|
601
|
+
readonly server: StartedTestContainer;
|
|
602
|
+
readonly admin: StartedTestContainer;
|
|
603
|
+
readonly injector: StartedTestContainer;
|
|
604
|
+
readonly opened: StartedTestContainer[];
|
|
605
|
+
readonly output: (container: StartedTestContainer, argv: string[]) => Promise<string>;
|
|
611
606
|
}
|
|
612
|
-
/** This function gives the time of each stage of a timeline from an instant: the first announcement of each, after the instant. */
|
|
613
|
-
export declare const stagesOf: (timeline: readonly SentinelEvent[], from: number) => Partial<Record<Stage, Quantity>>;
|
|
614
|
-
/** These are the stages of the timeline of a replica set, in their usual sequence after a fault. */
|
|
615
|
-
export declare const REPLICA_SET_STAGES: readonly ReplicaSetStage[];
|
|
616
607
|
/**
|
|
617
|
-
*
|
|
618
|
-
*
|
|
619
|
-
* the
|
|
608
|
+
* This function deploys the routers of a lab and joins the client and the target to them. It also
|
|
609
|
+
* starts the sidecars: the injector of spine1 and a route monitor on each leaf. The caller stops the
|
|
610
|
+
* sidecars with the other containers of the lab, and it calls `close` first.
|
|
620
611
|
*/
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
export declare const
|
|
612
|
+
export declare const openFabric: (parts: FabricParts) => Promise<FabricLab>;
|
|
613
|
+
/** These are the names of the images that the harness ships. */
|
|
614
|
+
export declare const SHIPPED_NAMES: readonly [Shipped, ...Shipped[]];
|
|
615
|
+
/** This function gives the source of a shipped image. */
|
|
616
|
+
export declare const shippedSource: (name: Shipped) => ImageSource;
|
|
617
|
+
/** This function gives the version of the package of the harness, from its package.json. */
|
|
618
|
+
export declare const harnessVersion: () => string;
|
|
628
619
|
/**
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
* monotonic clock. The stages of the client come from its lines:
|
|
632
|
-
* - `discovered`: a member other than the old primary becomes RSPrimary in the view of the client.
|
|
633
|
-
* - `written-off`: the first heartbeat of the client to the old primary that fails.
|
|
634
|
-
* - `first-write`: the first write that a primary accepts, of a write that the client sent after
|
|
635
|
-
* the commit of the fault (`sentAfter`). It is on a new primary when `lands` is `new`.
|
|
620
|
+
* These are the clients that the harness ships, by their names (`Client`): the image of each, and
|
|
621
|
+
* its command. A cell that names a client gets this image and this command.
|
|
636
622
|
*/
|
|
637
|
-
export declare const
|
|
638
|
-
/** These are the
|
|
639
|
-
export declare const
|
|
623
|
+
export declare const SHIPPED_CLIENTS: Readonly<Record<Client, ClientImage>>;
|
|
624
|
+
/** These are the names of the clients that the harness ships. */
|
|
625
|
+
export declare const CLIENT_NAMES: readonly [Client, ...Client[]];
|
|
626
|
+
/** This function gives the command of a program of a subject by its role. It fails when the subject has no such program. */
|
|
627
|
+
export declare const programOf: (subject: Subject, role: string) => readonly string[];
|
|
640
628
|
/**
|
|
641
|
-
*
|
|
642
|
-
*
|
|
643
|
-
*
|
|
629
|
+
* This function gives the client of a subject for a cell (`Cell.client`): the image of the subject,
|
|
630
|
+
* with the command of a program. A client that the harness ships goes by its name, thus its records
|
|
631
|
+
* stay the same.
|
|
644
632
|
*/
|
|
645
|
-
export declare const
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
633
|
+
export declare const subjectClient: (subject: Subject, role?: string) => Client | ClientImage;
|
|
634
|
+
/** This pattern matches an image pinned by digest: a name, a tag or none, then `@sha256:` and 64 hex digits. */
|
|
635
|
+
export declare const PINNED: RegExp;
|
|
636
|
+
/** This pattern matches the repository of a tag that the harness builds. Its parts are lower case, with `/` between them. */
|
|
637
|
+
export declare const REPOSITORY: RegExp;
|
|
638
|
+
/** This function tells if a path stays in its context: relative, with `/` between its parts, and no `..`. */
|
|
639
|
+
export declare const inContext: (path: string) => boolean;
|
|
649
640
|
/**
|
|
650
|
-
* This function gives the
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
* the fault (`sentAfter`), through any node.
|
|
641
|
+
* This function gives the problems of the source of an image, as data. A pinned image names a
|
|
642
|
+
* digest. A build names a repository, a context, and paths that stay in the context. A shipped image
|
|
643
|
+
* is one that the harness ships.
|
|
654
644
|
*/
|
|
655
|
-
export declare const
|
|
656
|
-
/** This function gives what became of each write of a run, from the lines of the client and the keys that the group kept. */
|
|
657
|
-
export declare const writesOf: (run: Run, after: number, primary: string) => Writes;
|
|
658
|
-
/** This function gives the errors that the client met after an instant: each kind, its first time, and its count. */
|
|
659
|
-
export declare const errorsOf: (events: readonly ProbeEvent[], after: number) => ErrorOnTheWay[];
|
|
645
|
+
export declare const imageProblems: (source: ImageSource) => string[];
|
|
660
646
|
/**
|
|
661
|
-
* This function gives the
|
|
662
|
-
*
|
|
663
|
-
* at the stamp or before it. The prober records each write (`tx`) on the clock of the stamps.
|
|
647
|
+
* This function gives the problems of a subject, as data. A subject has a name and a base that a
|
|
648
|
+
* digest pins. Its image source has no problems, and each of its programs is a command.
|
|
664
649
|
*/
|
|
665
|
-
export declare const
|
|
666
|
-
/** This type is the measurement of observe.ts, which a group run fills. */
|
|
667
|
-
interface GroupReading {
|
|
668
|
-
readonly outcome: {
|
|
669
|
-
readonly kind: "answered";
|
|
670
|
-
} | {
|
|
671
|
-
readonly kind: "silent";
|
|
672
|
-
};
|
|
673
|
-
readonly elapsed: Quantity | null;
|
|
674
|
-
readonly socket: Quantity | null;
|
|
675
|
-
readonly noticed: Quantity | null;
|
|
676
|
-
readonly void: string | null;
|
|
677
|
-
readonly finding: string | null;
|
|
678
|
-
readonly group: GroupMeasured;
|
|
679
|
-
}
|
|
650
|
+
export declare const subjectProblems: (subject: Subject) => string[];
|
|
680
651
|
/**
|
|
681
|
-
* This function
|
|
682
|
-
*
|
|
683
|
-
*
|
|
684
|
-
* - The outcome is the first write that a primary accepted after the fault. The prediction says
|
|
685
|
-
* which primary: a new one, or the same one after the lift. In a replica set, it is the first
|
|
686
|
-
* accepted write of a write that the client sent after the commit of the fault.
|
|
687
|
-
* - The stages come from the Sentinels, or from the logs of the members of a replica set and the
|
|
688
|
-
* lines of its client (`replicaSetStagesOf`).
|
|
689
|
-
* - Its time is the last segment with data that the client's socket to that primary received
|
|
690
|
-
* before the client saw the acceptance. The stamp of the client is the fallback.
|
|
691
|
-
* - A run is void when the prober lost records, or when the client did not become ready. It is
|
|
692
|
-
* also void when a Sentinel entered its TILT mode, or when the election split its votes. A band
|
|
693
|
-
* from the fault whose commit took longer than δ_abs is void too. So is a band whose hold lifted
|
|
694
|
-
* more than δ_abs late.
|
|
652
|
+
* This function gives each `FROM` of a Dockerfile that no digest pins. A `FROM` of an earlier stage
|
|
653
|
+
* by its name, or of `scratch`, needs no digest. A base from an `ARG` has no digest that the harness
|
|
654
|
+
* can read, thus it is in the list too.
|
|
695
655
|
*/
|
|
696
|
-
export declare const
|
|
697
|
-
/** This record is what a run of a port cell measured. */
|
|
698
|
-
interface PortsReading {
|
|
699
|
-
/** This count is the rounds of the run, each destination once. */
|
|
700
|
-
readonly rounds: number;
|
|
701
|
-
/** This record gives the count of searches for each count of connects, by that count. */
|
|
702
|
-
readonly counts: Readonly<Record<string, number>>;
|
|
703
|
-
/** These offsets from the low port are the ports that the run used, in rising order. */
|
|
704
|
-
readonly seen: readonly number[];
|
|
705
|
-
/** These errnos ended the searches of the run, each one time. */
|
|
706
|
-
readonly errnos: readonly string[];
|
|
707
|
-
/** This time is the longest connect that failed. */
|
|
708
|
-
readonly refusal: Quantity;
|
|
709
|
-
/** This time is from the `closing` line to the first `freed` line. */
|
|
710
|
-
readonly firstFreed: Quantity | null;
|
|
711
|
-
/** This time is from the `closing` line to the last `freed` line. */
|
|
712
|
-
readonly lastFreed: Quantity | null;
|
|
713
|
-
/** This count is the `freed` lines of the run. */
|
|
714
|
-
readonly freed: number;
|
|
715
|
-
/** This count is the connects that failed before the last `freed` line. */
|
|
716
|
-
readonly tries: number;
|
|
717
|
-
}
|
|
656
|
+
export declare const unpinnedBases: (dockerfile: string) => string[];
|
|
718
657
|
/**
|
|
719
|
-
* This function
|
|
720
|
-
* `
|
|
721
|
-
* retransmissions.
|
|
658
|
+
* This function gives each base of a Dockerfile, in the sequence of the file. A base is the image of
|
|
659
|
+
* a `FROM` that is not `scratch` or an earlier stage by its name.
|
|
722
660
|
*/
|
|
723
|
-
export declare const
|
|
724
|
-
/** This record is what one connection of a queue cell did, from its lines and the records of its socket. */
|
|
725
|
-
interface QueueConnectionReading {
|
|
726
|
-
readonly name: string;
|
|
727
|
-
readonly connected: boolean;
|
|
728
|
-
/** These times are the waits of the SYN. The first one counts from the dial. */
|
|
729
|
-
readonly syns: readonly Quantity[];
|
|
730
|
-
/** These times are the waits of each SYN-ACK sent again. The first one counts from the dial. */
|
|
731
|
-
readonly synAcks: readonly Quantity[];
|
|
732
|
-
/** This count is the segments that the socket sent again. */
|
|
733
|
-
readonly retransmissions: number;
|
|
734
|
-
readonly errno: string | null;
|
|
735
|
-
/** This time is from the line of the prediction to the end of the connection. It is null for a live connection, or with no prediction. */
|
|
736
|
-
readonly ended: Quantity | null;
|
|
737
|
-
/** This time is from the last retransmission to the end of the connection. */
|
|
738
|
-
readonly afterLast: Quantity | null;
|
|
739
|
-
/** This count is the segments of the socket with no acknowledgment at the end of the run. */
|
|
740
|
-
readonly unacked: number | null;
|
|
741
|
-
}
|
|
742
|
-
/** This record is what a run of a queue cell measured. The counts are the changes in the run. */
|
|
743
|
-
interface QueueReading {
|
|
744
|
-
readonly max: number;
|
|
745
|
-
readonly held: number;
|
|
746
|
-
readonly connected: number;
|
|
747
|
-
readonly overflows: number;
|
|
748
|
-
readonly drops: number;
|
|
749
|
-
readonly cookies: number;
|
|
750
|
-
readonly timeouts: number;
|
|
751
|
-
readonly resets: number;
|
|
752
|
-
readonly drained: number;
|
|
753
|
-
/** This time is from the first dial of the burst to the last `TCPTimeouts` of the prediction. */
|
|
754
|
-
readonly expiry: Quantity | null;
|
|
755
|
-
/** This time is from the first dial of the burst to the rise of the count of the queue. */
|
|
756
|
-
readonly rise: Quantity | null;
|
|
757
|
-
readonly connections: readonly QueueConnectionReading[];
|
|
758
|
-
}
|
|
661
|
+
export declare const basesOf: (dockerfile: string) => string[];
|
|
759
662
|
/**
|
|
760
|
-
* This function
|
|
761
|
-
*
|
|
762
|
-
* the prober give the waits of each socket.
|
|
663
|
+
* This function gives each manifest of packages in a context (`package.json`, `Cargo.toml`) that
|
|
664
|
+
* has no lockfile in its folder or in a folder above it. The paths are the paths in the context.
|
|
763
665
|
*/
|
|
764
|
-
export declare const
|
|
765
|
-
/** This function gives the words of the outcome of a second request: its connection, a retry, and its end. */
|
|
766
|
-
export declare const requestWords: (outcome: {
|
|
767
|
-
readonly connection: "reused" | "new";
|
|
768
|
-
readonly retried: boolean;
|
|
769
|
-
readonly error: string | null;
|
|
770
|
-
readonly pending?: boolean | undefined;
|
|
771
|
-
}) => string;
|
|
666
|
+
export declare const unlockedManifests: (paths: readonly string[]) => string[];
|
|
772
667
|
/**
|
|
773
|
-
*
|
|
774
|
-
*
|
|
775
|
-
* minimum is one jiffy. On 2026-10-12 the worst of 60 resets at 1 and 4 environments took
|
|
776
|
-
* 1.141 ms, thus the minimum sets it to 4 ms. The calibration occurs again after each change to
|
|
777
|
-
* the harness, the kernel or Docker.
|
|
668
|
+
* An image plan tells how the harness gets the image of a source. It is a pull of an image by its
|
|
669
|
+
* name, or a build of a context. A build has its tag, its Dockerfile, and each file with its path.
|
|
778
670
|
*/
|
|
779
|
-
|
|
671
|
+
type ImagePlan = {
|
|
672
|
+
readonly kind: "pull";
|
|
673
|
+
readonly image: string;
|
|
674
|
+
} | {
|
|
675
|
+
readonly kind: "build";
|
|
676
|
+
readonly tag: string;
|
|
677
|
+
readonly dockerfile: string;
|
|
678
|
+
readonly files: ReadonlyArray<{
|
|
679
|
+
readonly file: string;
|
|
680
|
+
readonly at: string;
|
|
681
|
+
}>;
|
|
682
|
+
/** This record tells what the image holds, for the manifest of a run. */
|
|
683
|
+
readonly record: BuildRecord;
|
|
684
|
+
};
|
|
780
685
|
/**
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
*
|
|
686
|
+
* A build record tells what an image that the harness builds holds, for the manifest of a run. The
|
|
687
|
+
* tag is a sha256 of each file of the context. The bases are pinned by digest, and each lockfile
|
|
688
|
+
* has its sha256. Thus the record pins each program of the image. The versions are the part that a
|
|
689
|
+
* person reads.
|
|
784
690
|
*/
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
readonly
|
|
789
|
-
|
|
790
|
-
readonly
|
|
691
|
+
interface BuildRecord {
|
|
692
|
+
readonly tag: string;
|
|
693
|
+
/** These are the bases of its Dockerfile, each pinned by digest (`basesOf`). */
|
|
694
|
+
readonly bases: readonly string[];
|
|
695
|
+
/** These are the lockfiles of its context by their path, each with the sha256 of its content (`locksOf`). */
|
|
696
|
+
readonly locks: Readonly<Record<string, string>>;
|
|
697
|
+
/** These are the versions of the packages that its manifests name directly, by their names (`versionsOf`). */
|
|
698
|
+
readonly versions: Readonly<Record<string, string>>;
|
|
791
699
|
}
|
|
792
700
|
/**
|
|
793
|
-
* This function gives the
|
|
794
|
-
*
|
|
795
|
-
*
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
*
|
|
701
|
+
* This function gives the plan of the image of a source. A stock image by its name, or a pinned
|
|
702
|
+
* image, is a pull. A build or a shipped image is a build. Its tag is its name, then 12 digits of a
|
|
703
|
+
* sha256. The sha256 reads the path of the Dockerfile, and the path and the content of each file.
|
|
704
|
+
* Thus a changed program cannot operate as an old one.
|
|
705
|
+
*
|
|
706
|
+
* A build fails before it starts on a problem of its source. It also fails on a `FROM` that no
|
|
707
|
+
* digest pins, and on a manifest of packages without a lockfile.
|
|
799
708
|
*/
|
|
800
|
-
export declare const
|
|
801
|
-
/** This function gives the δ_abs of a cell: its own, or `NOISE` for a cell that gives none. */
|
|
802
|
-
export declare const noiseOf: (cell: {
|
|
803
|
-
readonly noise?: Quantity | undefined;
|
|
804
|
-
}) => Quantity;
|
|
709
|
+
export declare const planOf: (source: string | ImageSource) => ImagePlan;
|
|
805
710
|
/**
|
|
806
|
-
*
|
|
807
|
-
* of
|
|
808
|
-
*
|
|
711
|
+
* This function gives an image that a lab can start, from its source. It is the name of a stock
|
|
712
|
+
* image or of a pinned image, which the lab pulls, or the tag of a build. A build goes through the CLI
|
|
713
|
+
* of Docker.
|
|
809
714
|
*/
|
|
810
|
-
|
|
811
|
-
readonly bound: Quantity | null;
|
|
812
|
-
readonly delta: Quantity;
|
|
813
|
-
}
|
|
715
|
+
export declare const imageOf: (source: string | ImageSource) => Promise<string>;
|
|
814
716
|
/**
|
|
815
|
-
* This function gives the
|
|
816
|
-
*
|
|
817
|
-
* (`Run.jitter`), and its own measurement widens its window. A run without a jitter record is
|
|
818
|
-
* from before SYS-25. It reads as a bound of null, thus its window is δ_abs. The decision of
|
|
819
|
-
* 2026-10-19 keeps the rule of one miss: a pair that a window misses is still a finding.
|
|
717
|
+
* This function gives the build record of the image of a source, for the manifest of a run. A
|
|
718
|
+
* stock image by its name, or a pinned image, is a pull, and it has no build record.
|
|
820
719
|
*/
|
|
821
|
-
export declare const
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
/**
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
*/
|
|
829
|
-
export declare const
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
720
|
+
export declare const buildRecordOf: (source: string | ImageSource) => BuildRecord | undefined;
|
|
721
|
+
/** This function gives the image of the harness: the prober, the TCP client, the injector and the namespace admin. */
|
|
722
|
+
export declare const harnessImage: () => Promise<string>;
|
|
723
|
+
/** This function gives the image of the Node client. */
|
|
724
|
+
export declare const nodeClientImage: () => Promise<string>;
|
|
725
|
+
/** This function gives the image of the router. */
|
|
726
|
+
export declare const routerImage: () => Promise<string>;
|
|
727
|
+
/** This function gives the image of the Go HTTP client. */
|
|
728
|
+
export declare const goHttpImage: () => Promise<string>;
|
|
729
|
+
/** This function gives the image of the Node HTTP clients. */
|
|
730
|
+
export declare const nodeHttpImage: () => Promise<string>;
|
|
731
|
+
/** This function gives the image of the MongoDB client. */
|
|
732
|
+
export declare const mongoClientImage: () => Promise<string>;
|
|
733
|
+
/** This function gives the image of the PostgreSQL client. */
|
|
734
|
+
export declare const pgClientImage: () => Promise<string>;
|
|
735
|
+
/** This function gives the image of the client of HikariCP over pgjdbc. */
|
|
736
|
+
export declare const hikariClientImage: () => Promise<string>;
|
|
737
|
+
/** This function gives the image of the RabbitMQ client: amqplib, with the client and the admin of a cluster cell. */
|
|
738
|
+
export declare const amqpClientImage: () => Promise<string>;
|
|
739
|
+
/** This function gives the image of the Kafka client: kafka-clients on Java, with the client and the admin of a Kafka cell. */
|
|
740
|
+
export declare const kafkaClientImage: () => Promise<string>;
|
|
741
|
+
/** This function gives the image of the gRPC client of the harness: grpc-js 1.14.6 on Node 24.21.0, with its client. */
|
|
742
|
+
export declare const grpcClientImage: () => Promise<string>;
|
|
834
743
|
/**
|
|
835
|
-
* This function
|
|
836
|
-
*
|
|
837
|
-
* the rule is in time: the delay must also reach δ_abs, because each band already includes that
|
|
838
|
-
* noise. At HZ 250 two jiffies are 8 ms, more than a δ_abs of 4 ms. At HZ 1000 they are 2 ms.
|
|
744
|
+
* This function gives the source of the image that a target operates. It is the image of its
|
|
745
|
+
* subject (`Target.subject`), or its stock image.
|
|
839
746
|
*/
|
|
840
|
-
export declare const
|
|
841
|
-
/** This
|
|
842
|
-
export declare const
|
|
843
|
-
/** These are the run counts of a cell: 11, then 22 and 44 while its median crosses the edge of the band. */
|
|
844
|
-
export declare const STEPS: readonly [11, 22, 44];
|
|
747
|
+
export declare const targetSourceOf: (target: Target) => string | ImageSource;
|
|
748
|
+
/** This function gives the image that a target operates: the image of its subject, or its stock image. */
|
|
749
|
+
export declare const targetImageOf: (target: Target) => Promise<string>;
|
|
845
750
|
/**
|
|
846
|
-
* A
|
|
847
|
-
*
|
|
751
|
+
* A layer is a rung of the laboratory (`docs/S7.md`). E1 is containers on one kernel, and E2 is a
|
|
752
|
+
* cluster of containers on one kernel. A lab with `Topology.fabric` writes E3: routers in containers.
|
|
753
|
+
* A lab in a guest of QEMU writes E4 (`substrateHere`). The other layers do not have a runner at this
|
|
754
|
+
* time.
|
|
848
755
|
*/
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
readonly
|
|
858
|
-
|
|
859
|
-
readonly
|
|
860
|
-
|
|
861
|
-
readonly
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
readonly
|
|
866
|
-
readonly counted: number;
|
|
867
|
-
readonly voided: number;
|
|
868
|
-
/** This band is where each run must land: [T_lo − δ_abs, T_hi + δ_abs]. It is null for a silent prediction. */
|
|
869
|
-
readonly band: Interval | null;
|
|
870
|
-
/** These are the runs outside the band, and the reason for each. Each is a finding. */
|
|
871
|
-
readonly outside: ReadonlyArray<{
|
|
872
|
-
readonly run: string;
|
|
873
|
-
readonly why: string;
|
|
874
|
-
}>;
|
|
875
|
-
readonly median: Quantity | null;
|
|
876
|
-
/** This interval is the order-statistic interval of the median at 95 %, or the whole range for fewer than six runs. */
|
|
877
|
-
readonly medianInterval: Interval | null;
|
|
878
|
-
/** This time is the slowest reply of a cell that measures a distribution. A closed loop hides the sends in a stall, thus a quantile is a lower bound, and this maximum is not. */
|
|
879
|
-
readonly slowest?: Quantity;
|
|
880
|
-
/** This record is the sum of what reordering did in each counted run of a measurement-only cell. */
|
|
881
|
-
readonly reordering?: Reordering;
|
|
882
|
-
/** This record is the load of an open-loop cell over its counted runs. */
|
|
883
|
-
readonly load?: LoadVerdict;
|
|
884
|
-
/** This record is the estimate of the open loop of a closed-loop stream over its counted runs (SYS-91). */
|
|
885
|
-
readonly estimate?: EstimateVerdict;
|
|
886
|
-
/** This record is the time of the proxy of a calibration cell, in each direction. */
|
|
887
|
-
readonly proxy?: {
|
|
888
|
-
readonly hop: string;
|
|
889
|
-
readonly up: Spread | null;
|
|
890
|
-
readonly down: Spread | null;
|
|
891
|
-
};
|
|
892
|
-
/** This record is what the group of a group cell did over the counted runs: its stages, and its writes. */
|
|
893
|
-
readonly group?: GroupVerdict;
|
|
894
|
-
/**
|
|
895
|
-
* These are the outcomes of the second request of an HTTP client over the counted runs, each
|
|
896
|
-
* with its count: for example "reused, a retry, a reply". An outcome other than the predicted
|
|
897
|
-
* one is a finding of its run.
|
|
898
|
-
*/
|
|
899
|
-
readonly requests?: Readonly<Record<string, number>>;
|
|
900
|
-
/** This record is what the client did after the detection over the counted runs, for a prediction that says when it reconnects. */
|
|
901
|
-
readonly reconnect?: ReconnectVerdict;
|
|
902
|
-
/** These are the outcomes of the call in flight of a WebSocket client over the counted runs, each with its count. */
|
|
903
|
-
readonly calls?: Readonly<Record<string, number>>;
|
|
904
|
-
/**
|
|
905
|
-
* This record is the time from a drop of the program to the close of its socket by its own side,
|
|
906
|
-
* over the counted runs. It also counts the runs where the socket did not close itself.
|
|
907
|
-
* `exited` is the spread of the end of the client process, for the runs where the socket stayed
|
|
908
|
-
* open until that end (`Measured.exited`).
|
|
909
|
-
*/
|
|
910
|
-
readonly left?: {
|
|
911
|
-
readonly spread: Spread | null;
|
|
912
|
-
readonly stayed: number;
|
|
913
|
-
readonly exited?: Spread | null;
|
|
914
|
-
};
|
|
915
|
-
readonly why: string;
|
|
756
|
+
export declare const LAYERS: readonly ["E0", "E1", "E2", "E3", "E4", "E5", "E6"];
|
|
757
|
+
type Layer = (typeof LAYERS)[number];
|
|
758
|
+
/** A cloud is where the runner operates. GitHub can schedule a standard Linux job on Azure or on AWS. */
|
|
759
|
+
export declare const CLOUDS: readonly ["azure", "aws", "unknown"];
|
|
760
|
+
type Cloud = (typeof CLOUDS)[number];
|
|
761
|
+
/** A host is what a process reads about its own machine. */
|
|
762
|
+
interface Host {
|
|
763
|
+
/** This text is the kernel release. */
|
|
764
|
+
readonly kernel: string | null;
|
|
765
|
+
/** This number is `CONFIG_HZ` from the configuration of the kernel, or null without that file. */
|
|
766
|
+
readonly hz: number | null;
|
|
767
|
+
/** This text is the DMI system vendor, for example `Microsoft Corporation`, or null without that file. */
|
|
768
|
+
readonly vendor: string | null;
|
|
769
|
+
/** This value tells if `/dev/kvm` exists. A later VM layer needs it. */
|
|
770
|
+
readonly kvm: boolean;
|
|
771
|
+
/** This text is `$ImageOS $ImageVersion` of a hosted runner, or null elsewhere. */
|
|
772
|
+
readonly image: string | null;
|
|
916
773
|
}
|
|
917
774
|
/**
|
|
918
|
-
* A
|
|
919
|
-
*
|
|
920
|
-
*
|
|
921
|
-
* - `established` is the time from the detection to the first new socket that became ESTABLISHED.
|
|
922
|
-
* - `connect` is the time from a `dial` line to the SYN of its socket: the work of the program.
|
|
775
|
+
* A substrate tells where a record comes from. The rules of comparison in `docs/S7.md` read it: no
|
|
776
|
+
* statistic pools two layers, two kernels or two clouds. The digest of each image stays in the
|
|
777
|
+
* manifest. A value is null in a record from before this block.
|
|
923
778
|
*/
|
|
924
|
-
interface
|
|
925
|
-
readonly
|
|
926
|
-
readonly
|
|
927
|
-
readonly
|
|
928
|
-
readonly
|
|
779
|
+
interface Substrate {
|
|
780
|
+
readonly layer: Layer;
|
|
781
|
+
readonly cloud: Cloud;
|
|
782
|
+
readonly vendor: string | null;
|
|
783
|
+
readonly kernel: string | null;
|
|
784
|
+
readonly hz: number | null;
|
|
785
|
+
readonly kvm: boolean | null;
|
|
786
|
+
readonly image: string | null;
|
|
929
787
|
}
|
|
788
|
+
/** GitHub announced Linux jobs on AWS on this date. Each earlier hosted job ran on Azure. */
|
|
789
|
+
export declare const AWS_FROM = "2026-10-28";
|
|
790
|
+
/** This function gives the cloud of a DMI vendor. A kernel name does not tell: one image can start on each cloud. */
|
|
791
|
+
export declare const cloudOf: (vendor: string | null) => Cloud;
|
|
792
|
+
/** This function reads the host. `root` and `env` are for tests. */
|
|
793
|
+
export declare const readHost: (root?: string, env?: Readonly<Record<string, string | undefined>>, kernel?: string) => Host;
|
|
794
|
+
/** This function gives the substrate of a layer on a host. */
|
|
795
|
+
export declare const substrateOn: (layer: Layer, host?: Host) => Substrate;
|
|
930
796
|
/**
|
|
931
|
-
*
|
|
932
|
-
*
|
|
933
|
-
*
|
|
797
|
+
* This function gives the substrate of a lab at this place. A guest cannot read its own runner: its
|
|
798
|
+
* DMI vendor is QEMU, and `ImageOS` is not set. Thus the runner writes its host to `LAB_RUNNER`, and
|
|
799
|
+
* the guest keeps only its own kernel and HZ. A value of that variable makes the layer E4.
|
|
934
800
|
*/
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
readonly
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
}>;
|
|
943
|
-
readonly decision: "holds" | "fails";
|
|
801
|
+
export declare const substrateHere: (layer: Layer, host?: Host, env?: Readonly<Record<string, string | undefined>>) => Substrate;
|
|
802
|
+
/** A CPU reading is two counters of `/proc/stat`, in ticks of the clock. */
|
|
803
|
+
interface CpuTime {
|
|
804
|
+
/** This count is the time that the host gave to another guest while this one had work. */
|
|
805
|
+
readonly steal: number;
|
|
806
|
+
/** This count is the sum of all states of each CPU. */
|
|
807
|
+
readonly total: number;
|
|
944
808
|
}
|
|
809
|
+
/** This function reads the CPU time of this machine, or gives null without `/proc/stat`. `root` is for tests. */
|
|
810
|
+
export declare const readCpu: (root?: string) => CpuTime | null;
|
|
945
811
|
/**
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
-
* - `lost` counts the writes that a primary accepted and the group did not keep, in each run.
|
|
950
|
-
* - `old` counts the writes that the old primary accepted after the fault, in each run.
|
|
951
|
-
* - `unknown` counts the writes whose outcome the client did not see, and how many the group kept.
|
|
952
|
-
* - `errors` are the errors on the way: the runs that met each, and the median of its first time.
|
|
953
|
-
* - `lags` is the spread of the delays of the stamps, for a calibration.
|
|
954
|
-
* - `duplicates` counts the extra copies that the group holds, in each run. A cell with no band of
|
|
955
|
-
* copies has no such count.
|
|
812
|
+
* This function gives the share of the CPU time between two readings that the host took. The share
|
|
813
|
+
* goes from zero to one. It is null if no tick passed. A guest sees only the host above it. On a hosted
|
|
814
|
+
* runner that host is itself a guest, and this number does not show the contention of the layer below it.
|
|
956
815
|
*/
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
readonly
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
readonly median: number | null;
|
|
964
|
-
readonly max: number | null;
|
|
965
|
-
};
|
|
966
|
-
readonly old: {
|
|
967
|
-
readonly median: number | null;
|
|
968
|
-
readonly max: number | null;
|
|
969
|
-
};
|
|
970
|
-
readonly unknown: {
|
|
971
|
-
readonly total: number;
|
|
972
|
-
readonly held: number;
|
|
973
|
-
};
|
|
974
|
-
readonly errors: ReadonlyArray<{
|
|
975
|
-
readonly name: string;
|
|
976
|
-
readonly runs: number;
|
|
977
|
-
readonly first: Quantity;
|
|
978
|
-
}>;
|
|
979
|
-
readonly lags?: Spread | null;
|
|
980
|
-
readonly duplicates?: {
|
|
981
|
-
readonly runs: number;
|
|
982
|
-
readonly total: number;
|
|
983
|
-
readonly median: number | null;
|
|
984
|
-
readonly max: number | null;
|
|
985
|
-
};
|
|
816
|
+
export declare const stealShare: (before: CpuTime, after: CpuTime) => number | null;
|
|
817
|
+
/** A part of a record that can hold a substrate: a manifest of the harness, or the fields of a kind manifest. */
|
|
818
|
+
interface SubstrateSource {
|
|
819
|
+
readonly substrate?: Substrate;
|
|
820
|
+
readonly kernel?: string;
|
|
821
|
+
readonly hz?: string | null;
|
|
986
822
|
}
|
|
987
823
|
/**
|
|
988
|
-
* This function
|
|
989
|
-
*
|
|
824
|
+
* This function reads the substrate of a record, the upgrade of a record from before this block.
|
|
825
|
+
* Nothing rewrites such a record. It reads as the given layer. Its cloud is Azure if the record is
|
|
826
|
+
* from before `AWS_FROM`, and unknown after that date, because its runner did not record the cloud.
|
|
990
827
|
*/
|
|
991
|
-
export declare const
|
|
992
|
-
/** This function gives the spread of a set of times, or null for none. */
|
|
993
|
-
export declare const spreadOf: (times: readonly Quantity[]) => Spread | null;
|
|
828
|
+
export declare const substrateOf: (source: SubstrateSource, at: string, layer?: Layer) => Substrate;
|
|
994
829
|
/**
|
|
995
|
-
* This function
|
|
996
|
-
*
|
|
997
|
-
*
|
|
998
|
-
* empty list throws a RangeError.
|
|
830
|
+
* This function tells if a statistic can pool two substrates. They must have one layer, one kernel
|
|
831
|
+
* and one cloud. An unknown value does not refuse a pair, because an old record cannot tell. The
|
|
832
|
+
* reader of such a pair says so with `substrateKey`.
|
|
999
833
|
*/
|
|
1000
|
-
export declare const
|
|
834
|
+
export declare const comparable: (a: Substrate, b: Substrate) => boolean;
|
|
835
|
+
/** This function gives the one-line name of a substrate, for a summary. */
|
|
836
|
+
export declare const substrateKey: (substrate: Substrate) => string;
|
|
1001
837
|
/**
|
|
1002
|
-
* This function gives the
|
|
1003
|
-
*
|
|
1004
|
-
*
|
|
1005
|
-
* interval outside the band fails. An interval across its edge extends the cell to 22 runs, then
|
|
1006
|
-
* 44, and then the verdict is inconclusive.
|
|
1007
|
-
*
|
|
1008
|
-
* A silent prediction holds only if no run detected the fault in its window. After a stall, the
|
|
1009
|
-
* return of the reply gets the same test as a detection, by its interval, and a detection is a
|
|
1010
|
-
* finding. The distribution test (a DKW band) needs a predicted distribution from a simulator,
|
|
1011
|
-
* which does not exist at this time.
|
|
838
|
+
* This function gives the first two substrates that a statistic cannot pool, or undefined. It
|
|
839
|
+
* examines each pair. An unknown value matches Azure and AWS, thus one comparison with the first
|
|
840
|
+
* substrate can miss a pair.
|
|
1012
841
|
*/
|
|
1013
|
-
export declare const
|
|
1014
|
-
/** This function sums what the group of a group cell did in its counted runs, and tests each stage that has a band. */
|
|
1015
|
-
export declare const groupVerdictOf: (prediction: Prediction, counted: readonly Measured[], delta?: Quantity) => GroupVerdict;
|
|
842
|
+
export declare const unpoolable: (substrates: readonly Substrate[]) => readonly [Substrate, Substrate] | undefined;
|
|
1016
843
|
/**
|
|
1017
|
-
*
|
|
1018
|
-
*
|
|
1019
|
-
* close the connection itself (`closed`), or its program can drop it on its own timer (`dropped`).
|
|
844
|
+
* This time is the interval of the listing of a router, when its hop does not set one. A listing
|
|
845
|
+
* evicts each expired flow that it walks past, and the DESTROY event of that flow follows.
|
|
1020
846
|
*/
|
|
1021
|
-
|
|
1022
|
-
readonly kind: "error";
|
|
1023
|
-
readonly errno: string;
|
|
1024
|
-
} | {
|
|
1025
|
-
readonly kind: "eof";
|
|
1026
|
-
} | {
|
|
1027
|
-
readonly kind: "silent";
|
|
1028
|
-
} | {
|
|
1029
|
-
readonly kind: "answered";
|
|
1030
|
-
} | {
|
|
1031
|
-
readonly kind: "closed";
|
|
1032
|
-
} | {
|
|
1033
|
-
readonly kind: "dropped";
|
|
1034
|
-
};
|
|
847
|
+
export declare const PUMP: Quantity;
|
|
1035
848
|
/**
|
|
1036
|
-
*
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
849
|
+
* This time is the longest listing of the conntrack table of a router that a prediction assumes.
|
|
850
|
+
* A DESTROY follows an expiry within the interval of the pump and two listings. On 2026-10-15,
|
|
851
|
+
* the slowest of 500 listings in an idle router took 19.4 ms, and the median took 5.5 ms. A
|
|
852
|
+
* longer listing writes a `pump-slow` line, and a run with one near its detection is void.
|
|
1039
853
|
*/
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
854
|
+
export declare const LISTING: Quantity;
|
|
855
|
+
/**
|
|
856
|
+
* This time is how late the pump of a router can be beyond its interval and its two listings. The
|
|
857
|
+
* pump sleeps after each listing, and the sleep can end late. The watcher also reads and stamps each
|
|
858
|
+
* event within a millisecond. Thus a DESTROY follows an expiry within the interval of the pump, two
|
|
859
|
+
* listings and this slack. It is an assumption: in run 39116866471, two of 11 forgets came 1.6 ms
|
|
860
|
+
* and 2.2 ms after the pump and two listings.
|
|
861
|
+
*/
|
|
862
|
+
export declare const PUMP_SLACK: Quantity;
|
|
863
|
+
/**
|
|
864
|
+
* A network fault is a fault that the injector applies as a filter rule. It is a black hole (both
|
|
865
|
+
* directions, or one), or a reset on the next segment. It can also be an ICMP unreachable for each
|
|
866
|
+
* segment, or a drop of each segment that is longer than a length. It can also be a drop of the
|
|
867
|
+
* first ACK of each FIN that the namespace sends.
|
|
868
|
+
*/
|
|
869
|
+
type NetworkFault = "blackhole" | "rst" | "reject" | "mtu" | "fin-ack";
|
|
870
|
+
/** These are the options of a network fault: the direction of a black hole, the code of a reject, the length of an MTU drop. */
|
|
871
|
+
interface FaultOptions {
|
|
872
|
+
/** This direction is relative to the namespace of the rule: `in` drops what comes from the peer, `out` what goes to it. */
|
|
873
|
+
readonly direction?: "in" | "out";
|
|
874
|
+
readonly code?: "host" | "net" | "port" | "admin";
|
|
875
|
+
/** This length is the longest segment in bytes that an MTU drop lets through. */
|
|
876
|
+
readonly above?: number;
|
|
877
|
+
/** These are the addresses that the rule faces, in place of the peer of its place. */
|
|
878
|
+
readonly peers?: readonly string[];
|
|
1046
879
|
}
|
|
1047
|
-
/**
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
readonly
|
|
1059
|
-
|
|
1060
|
-
readonly
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
readonly
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
readonly
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
readonly
|
|
1081
|
-
/** This count is the number of bytes that the client read after the request. */
|
|
1082
|
-
readonly bytes?: number;
|
|
1083
|
-
/**
|
|
1084
|
-
* This time is when a router of the topology forgot the flow of the client. It counts from the
|
|
1085
|
-
* last segment that the client received before the fault. It is null when no router forgot the flow.
|
|
1086
|
-
*/
|
|
1087
|
-
readonly forgot?: Quantity | null;
|
|
880
|
+
/**
|
|
881
|
+
* A fault side is the namespace that gets the rules of a fault: the namespace of the peer of the
|
|
882
|
+
* observer. For the client, it is the namespace of the target (the injector). For the server, it
|
|
883
|
+
* is the namespace of the client (its privileged admin). Rules in the namespace of the observer
|
|
884
|
+
* make its sends fail locally, with EPERM, and the network does not lose them. Thus its
|
|
885
|
+
* retransmissions do not go out. The retransmission tracepoint of the kernel then records none,
|
|
886
|
+
* because it fires only for a retransmission that went out.
|
|
887
|
+
*/
|
|
888
|
+
type FaultSide = "target" | "client";
|
|
889
|
+
/** A hop of a manifest is one hop of a topology, as the lab started it. */
|
|
890
|
+
interface ManifestHop {
|
|
891
|
+
readonly name: string;
|
|
892
|
+
readonly kind: "router" | "proxy";
|
|
893
|
+
readonly image: string;
|
|
894
|
+
readonly id: string;
|
|
895
|
+
/** These are the settings of the hop: the form and the idle timeout of a router, the files and settings of a proxy. */
|
|
896
|
+
readonly settings: Readonly<Record<string, string>>;
|
|
897
|
+
/** These are the sysctls of the namespace of the hop, as read back after the harness set them. */
|
|
898
|
+
readonly sysctls: Readonly<Record<string, string>>;
|
|
899
|
+
}
|
|
900
|
+
/** This record is one sysctl of the host for one environment, as the harness read it. */
|
|
901
|
+
interface HostSetting {
|
|
902
|
+
readonly name: string;
|
|
903
|
+
readonly before: string;
|
|
904
|
+
readonly set: string;
|
|
905
|
+
/** This value is the read after the restore. It is null until the restore. */
|
|
906
|
+
readonly restored: string | null;
|
|
907
|
+
}
|
|
908
|
+
/** A manifest is what a lab records about its machine, its images and its settings. */
|
|
909
|
+
interface Manifest {
|
|
910
|
+
readonly kernel: string;
|
|
911
|
+
/** This text is the architecture of the machine, as uname -m gives it: x86_64. */
|
|
912
|
+
readonly architecture: string;
|
|
913
|
+
readonly hz: string | null;
|
|
1088
914
|
/**
|
|
1089
|
-
* This
|
|
1090
|
-
*
|
|
915
|
+
* This text tells where the HZ came from: the configuration of the kernel, or a measurement. A
|
|
916
|
+
* host without /proc/config.gz (a hosted runner) gets a measurement of jiffies against the clock.
|
|
1091
917
|
*/
|
|
1092
|
-
readonly
|
|
1093
|
-
|
|
1094
|
-
readonly
|
|
1095
|
-
/**
|
|
1096
|
-
readonly
|
|
1097
|
-
/** This record is
|
|
1098
|
-
readonly
|
|
1099
|
-
/** This record is
|
|
1100
|
-
readonly
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
918
|
+
readonly hzFrom?: "config" | "measured";
|
|
919
|
+
readonly boot_id: string;
|
|
920
|
+
readonly docker: string;
|
|
921
|
+
/** This block tells the layer, the cloud and the kernel of the record. A record from before it reads through `substrateOf`. */
|
|
922
|
+
readonly substrate?: Substrate;
|
|
923
|
+
/** This record is the fabric of a cell with `Topology.fabric`. */
|
|
924
|
+
readonly fabric?: FabricManifest;
|
|
925
|
+
/** This record is the target, and its settings as it read them back. */
|
|
926
|
+
readonly target: {
|
|
927
|
+
readonly image: string;
|
|
928
|
+
/** This source is the image of the subject that the target operates (`Target.subject`), with its stock base. */
|
|
929
|
+
readonly subject?: ImageSource;
|
|
930
|
+
readonly base?: string;
|
|
931
|
+
readonly id: string;
|
|
932
|
+
readonly settings: Readonly<Record<string, string>>;
|
|
933
|
+
/** These are the sysctls of its namespace, as read back after the harness set them. */
|
|
934
|
+
readonly sysctls: Readonly<Record<string, string>>;
|
|
935
|
+
/** These are the files that went into the target, by their path, each with the sha256 of its content. */
|
|
936
|
+
readonly files?: Readonly<Record<string, string>>;
|
|
937
|
+
/** This line is the first line of a target that writes them: a server that tells its settings as it reads them. */
|
|
938
|
+
readonly first?: ProbeEvent;
|
|
939
|
+
/** This record tells what the image of a target holds when the harness builds it: the image of a subject (`buildRecordOf`). */
|
|
940
|
+
readonly build?: BuildRecord;
|
|
1110
941
|
};
|
|
1111
|
-
/** This record is what the client did after the detection, for a prediction that says when it reconnects. */
|
|
1112
|
-
readonly reconnect?: ReconnectReading;
|
|
1113
|
-
/** This record is what the call in flight of a WebSocket client met. */
|
|
1114
|
-
readonly call?: CallReading;
|
|
1115
|
-
/** This record is what a stream that crossed the fault delivered, for a prediction with a delivery law. */
|
|
1116
|
-
readonly delivery?: DeliveryReading;
|
|
1117
|
-
/**
|
|
1118
|
-
* This time is from the drop line of the program to the close of its socket by its own side: a
|
|
1119
|
-
* FIN or an abort. A prediction that says how the program drops (`drop`) gets it. It is null
|
|
1120
|
-
* when the socket did not close itself in the run. A prediction can say that the client process
|
|
1121
|
-
* ends with the run (`exits`). Then a close at that end is no close by the program, and `left` is null.
|
|
1122
|
-
*/
|
|
1123
|
-
readonly left?: Quantity | null;
|
|
1124
942
|
/**
|
|
1125
|
-
* This
|
|
1126
|
-
*
|
|
943
|
+
* This record is the harness: its image, the id of that image and its Alpine packages. It also
|
|
944
|
+
* has the version of the package of the harness, and the build of its image. The record of a
|
|
945
|
+
* cell gives the commit of the code that operated.
|
|
1127
946
|
*/
|
|
1128
|
-
readonly
|
|
947
|
+
readonly harness: {
|
|
948
|
+
readonly image: string;
|
|
949
|
+
readonly id: string;
|
|
950
|
+
readonly packages: string[];
|
|
951
|
+
readonly version?: string;
|
|
952
|
+
readonly build?: BuildRecord;
|
|
953
|
+
};
|
|
1129
954
|
/**
|
|
1130
|
-
* This record is the
|
|
1131
|
-
*
|
|
1132
|
-
* reader can check each pairing of the run again.
|
|
955
|
+
* This record is the client of each run: the TCP client of the harness, a driver, or an image that
|
|
956
|
+
* the cell gives. `source` is the source of its image, when it is not a stock image by its name.
|
|
1133
957
|
*/
|
|
1134
|
-
readonly
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
958
|
+
readonly client: {
|
|
959
|
+
readonly kind: Client | "image";
|
|
960
|
+
readonly image: string;
|
|
961
|
+
readonly capabilities?: readonly ClientCapability[];
|
|
962
|
+
readonly source?: ImageSource;
|
|
963
|
+
readonly build?: BuildRecord;
|
|
964
|
+
};
|
|
965
|
+
/** These are the namespaces that the prober watched, by inode. */
|
|
966
|
+
readonly netns: {
|
|
967
|
+
readonly client: number;
|
|
968
|
+
readonly target: number;
|
|
969
|
+
readonly hops?: Readonly<Record<string, number>>;
|
|
970
|
+
};
|
|
971
|
+
/** These are the sysctls of the client namespace, as read back after the harness set them. */
|
|
972
|
+
readonly sysctls: Readonly<Record<string, string>>;
|
|
973
|
+
/** These are the sysctls of the host that the cell set: each value before, as set, and as restored. */
|
|
974
|
+
readonly host?: readonly HostSetting[];
|
|
975
|
+
/** These are the hops of a topology, in sequence from the client. */
|
|
976
|
+
readonly hops?: readonly ManifestHop[];
|
|
977
|
+
/** These are the parts of a group, with their settings as each part read them back. */
|
|
978
|
+
readonly group?: {
|
|
979
|
+
readonly members: ReadonlyArray<{
|
|
980
|
+
readonly name: string;
|
|
981
|
+
readonly ip: string;
|
|
982
|
+
readonly id: string;
|
|
983
|
+
readonly settings: Readonly<Record<string, string>>;
|
|
984
|
+
}>;
|
|
985
|
+
readonly sentinels: ReadonlyArray<{
|
|
986
|
+
readonly name: string;
|
|
987
|
+
readonly ip: string;
|
|
988
|
+
readonly id: string;
|
|
989
|
+
readonly settings: Readonly<Record<string, string>>;
|
|
990
|
+
}>;
|
|
991
|
+
readonly observer: {
|
|
992
|
+
readonly image: string;
|
|
993
|
+
};
|
|
994
|
+
};
|
|
1167
995
|
}
|
|
1168
|
-
/**
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
*/
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
996
|
+
/** These are the JSON lines of a program, as they arrive. */
|
|
997
|
+
interface Lines<T extends {
|
|
998
|
+
readonly ev: string;
|
|
999
|
+
}> {
|
|
1000
|
+
readonly seen: T[];
|
|
1001
|
+
/** These are the other lines that it wrote, for example an error. They explain a program that stopped its output. */
|
|
1002
|
+
readonly other: string[];
|
|
1003
|
+
consume: (stream: NodeJS.ReadableStream) => void;
|
|
1004
|
+
/** This method gives the first line of one of these kinds, or it rejects after `within` ms. */
|
|
1005
|
+
until(kinds: readonly string[], within: number, who: string): Promise<T>;
|
|
1178
1006
|
}
|
|
1179
|
-
/** A
|
|
1180
|
-
interface
|
|
1007
|
+
/** A probe is the client container of one run. */
|
|
1008
|
+
interface Probe {
|
|
1009
|
+
/** This method gives the first event of one of these kinds, or it rejects after `within` ms. */
|
|
1010
|
+
until(kinds: readonly string[], within: number): Promise<ProbeEvent>;
|
|
1011
|
+
/** This method lets an in-flight probe send its request. */
|
|
1012
|
+
go(): Promise<void>;
|
|
1013
|
+
/** This method freezes the client with the cgroup freezer: its process stops, and its kernel continues to answer. */
|
|
1014
|
+
freeze(): Promise<void>;
|
|
1015
|
+
thaw(): Promise<void>;
|
|
1016
|
+
/** This method stops the process of the client with SIGKILL. Its kernel then closes its socket with a FIN, or a reset. */
|
|
1017
|
+
kill(): Promise<void>;
|
|
1018
|
+
readonly events: readonly ProbeEvent[];
|
|
1019
|
+
stop(): Promise<void>;
|
|
1020
|
+
}
|
|
1021
|
+
/** An agent is a container that a lab starts in the namespaces of the target, for example a Node process that signals the server. */
|
|
1022
|
+
interface Agent {
|
|
1023
|
+
/** These are the JSON lines that it wrote, as they arrive. */
|
|
1024
|
+
readonly lines: Lines<{
|
|
1025
|
+
readonly ev: string;
|
|
1026
|
+
}>;
|
|
1027
|
+
/** This method starts a command in the agent, and gives its standard output. */
|
|
1028
|
+
exec(argv: readonly string[]): Promise<string>;
|
|
1029
|
+
stop(): Promise<void>;
|
|
1030
|
+
}
|
|
1031
|
+
/** A sibling is a server that a lab starts on the network of the target, for example a standby. */
|
|
1032
|
+
interface Sibling {
|
|
1033
|
+
readonly ip: string;
|
|
1181
1034
|
readonly netns: number;
|
|
1182
|
-
|
|
1035
|
+
/** This method starts a command in the sibling, and gives its standard output. */
|
|
1036
|
+
exec(argv: readonly string[]): Promise<string>;
|
|
1037
|
+
}
|
|
1038
|
+
/** A lab is one environment: the target, the client, the hops of a topology, the injectors and the prober. */
|
|
1039
|
+
interface Lab {
|
|
1040
|
+
/** This address is the address of the target on its own network. */
|
|
1041
|
+
readonly serverIp: string;
|
|
1042
|
+
/** This address is the address that the client connects to: the target, or the first proxy of a topology. */
|
|
1043
|
+
readonly targetIp: string;
|
|
1044
|
+
/** This port is the port that the client connects to. */
|
|
1045
|
+
readonly targetPort: number;
|
|
1046
|
+
readonly clientIp: string;
|
|
1047
|
+
readonly netns: {
|
|
1048
|
+
readonly client: number;
|
|
1049
|
+
readonly target: number;
|
|
1050
|
+
readonly hops?: Readonly<Record<string, number>>;
|
|
1051
|
+
};
|
|
1052
|
+
/** This record is where each socket of a topology is, or null for a direct pair. */
|
|
1053
|
+
readonly topology: RunTopology | null;
|
|
1054
|
+
/** These are the lines of the routers of a topology, in sequence, each with the name of its hop. A direct pair has none. */
|
|
1055
|
+
readonly middlebox: readonly MiddleboxEvent[];
|
|
1056
|
+
/** These are the lines of a target that writes them (`Target.lines`), in sequence. Another target has none. */
|
|
1057
|
+
readonly server: readonly ProbeEvent[];
|
|
1058
|
+
/** This method adds a toxic to the Toxiproxy hop of a topology, or removes it with null. The stamps of the injector bracket it. */
|
|
1059
|
+
toxic(toxic: Toxic | null): Promise<{
|
|
1060
|
+
t0: number;
|
|
1061
|
+
t1: number;
|
|
1062
|
+
}>;
|
|
1063
|
+
/** This method makes the target close the connection of each client, with the command of the target. */
|
|
1064
|
+
serverClose(): Promise<void>;
|
|
1065
|
+
/**
|
|
1066
|
+
* This method starts an agent in the network namespace of the target, and in its process
|
|
1067
|
+
* namespace with `pid`. Its command keeps it up, for example `sleep infinity`.
|
|
1068
|
+
*/
|
|
1069
|
+
agent(image: string, command: readonly string[], options?: {
|
|
1070
|
+
readonly pid?: boolean;
|
|
1071
|
+
}): Promise<Agent>;
|
|
1072
|
+
/** This method starts a sibling, and waits for a line of its log. */
|
|
1073
|
+
sibling(image: string, command: readonly string[], ready: string): Promise<Sibling>;
|
|
1074
|
+
/** This method starts a command in the target, and gives its standard output. */
|
|
1075
|
+
exec(argv: readonly string[]): Promise<string>;
|
|
1076
|
+
/** These are all the records that the prober wrote, in sequence. */
|
|
1077
|
+
readonly kernel: readonly KernelRecord[];
|
|
1078
|
+
/** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
|
|
1079
|
+
sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
|
|
1080
|
+
/** This method sets the settings of the target in it before a client connects, and reads them back. */
|
|
1081
|
+
configure(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
|
|
1082
|
+
/** This method sets the sysctls of the target namespace through a privileged sidecar there, and reads them back. */
|
|
1083
|
+
targetSysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
|
|
1084
|
+
/** This method runs each command in the namespace of the client and in the namespace of the target. */
|
|
1085
|
+
namespaceSetup(commands: readonly (readonly string[])[]): Promise<void>;
|
|
1086
|
+
/** This method sets sysctls of the host through a privileged sidecar on the network of the host, and reads them back. */
|
|
1087
|
+
hostSysctl(settings: readonly HostSysctl[]): Promise<void>;
|
|
1088
|
+
/** This method puts back each value that `hostSysctl` changed, once, and gives the record of each. Closing the lab also does it. */
|
|
1089
|
+
restoreHost(): Promise<readonly HostSetting[]>;
|
|
1090
|
+
/**
|
|
1091
|
+
* This method applies a fault between the client and the target, by default from the namespace
|
|
1092
|
+
* of the target. The fault is a black hole, or a reset that answers the next segment of the
|
|
1093
|
+
* client. At a proxy of a topology, the rules face the peer of the proxy on one side. The stamps
|
|
1094
|
+
* of the injector bracket it.
|
|
1095
|
+
*/
|
|
1096
|
+
fault(kind: NetworkFault, at?: FaultPlace, options?: FaultOptions): Promise<{
|
|
1097
|
+
t0: number;
|
|
1098
|
+
t1: number;
|
|
1099
|
+
}>;
|
|
1100
|
+
/** This method removes a fault. */
|
|
1101
|
+
lift(kind: NetworkFault, at?: FaultPlace, options?: FaultOptions): Promise<void>;
|
|
1102
|
+
/**
|
|
1103
|
+
* This method puts tc netem on the egress of a namespace, for example "delay 20ms" or "loss 5%",
|
|
1104
|
+
* or removes it with null. At a hop, it is the egress of the device of the hop toward one side.
|
|
1105
|
+
* The stamps of the injector bracket it.
|
|
1106
|
+
*/
|
|
1107
|
+
netem(spec: string | null, at?: FaultPlace): Promise<{
|
|
1108
|
+
t0: number;
|
|
1109
|
+
t1: number;
|
|
1110
|
+
}>;
|
|
1111
|
+
/**
|
|
1112
|
+
* This method sets the TSO, GSO and GRO of a namespace. With them off, netem and a length match
|
|
1113
|
+
* act on segments, not on GSO super-packets of up to 64 KB. At a hop, it sets the two devices of the hop.
|
|
1114
|
+
*/
|
|
1115
|
+
offload(on: boolean, at?: FaultPlace): Promise<void>;
|
|
1116
|
+
/** This method stops the server process in the target with SIGKILL, with the command of the target. */
|
|
1117
|
+
kill(): Promise<void>;
|
|
1118
|
+
/**
|
|
1119
|
+
* This method resolves the neighbors of the path in the two directions, with a ping from each
|
|
1120
|
+
* namespace. Without it, the first connection of an environment waits for ARP. Under a netem
|
|
1121
|
+
* delay, that wait is one more delayed round, and its round trip and RTO are longer.
|
|
1122
|
+
*/
|
|
1123
|
+
warm(): Promise<void>;
|
|
1124
|
+
/** This method runs commands in the target before a client connects, each as argv. */
|
|
1125
|
+
setup(commands: ReadonlyArray<readonly string[]>): Promise<void>;
|
|
1126
|
+
/**
|
|
1127
|
+
* This method stops a black hole at an instant on the monotonic clock of the VM. The injector
|
|
1128
|
+
* waits for that instant in the VM, thus the length of a stall does not include the latency of
|
|
1129
|
+
* a docker exec. Stamps bracket it, as for a fault.
|
|
1130
|
+
*/
|
|
1131
|
+
heal(at: FaultPlace, when: number): Promise<{
|
|
1132
|
+
t0: number;
|
|
1133
|
+
t1: number;
|
|
1134
|
+
}>;
|
|
1135
|
+
/**
|
|
1136
|
+
* This method removes what the two kernels learned from their earlier connections. These are
|
|
1137
|
+
* the TCP metrics that each kernel keeps for a peer address when a connection closes. These metrics set the
|
|
1138
|
+
* first round trip of the next connection, and thus its RTO. A run with these metrics is not
|
|
1139
|
+
* independent of the run before it.
|
|
1140
|
+
*/
|
|
1141
|
+
forget(): Promise<void>;
|
|
1142
|
+
/** This part is the routed fabric of a lab with `Topology.fabric`. */
|
|
1143
|
+
readonly fabric?: FabricLab;
|
|
1144
|
+
/** This method freezes the target with the cgroup freezer: its process stops, and its kernel continues to answer. */
|
|
1145
|
+
freeze(): Promise<void>;
|
|
1146
|
+
thaw(): Promise<void>;
|
|
1147
|
+
/**
|
|
1148
|
+
* This method sends a signal to the server process of the target (`Target.program`), at once or
|
|
1149
|
+
* at an instant of the VM. A sidecar in the network and process namespaces of the target sends
|
|
1150
|
+
* it, and the injector stamps it. The lab starts that sidecar at the first signal.
|
|
1151
|
+
*/
|
|
1152
|
+
signal(signal: "STOP" | "CONT" | "KILL", at?: number): Promise<{
|
|
1153
|
+
t0: number;
|
|
1154
|
+
t1: number;
|
|
1155
|
+
}>;
|
|
1156
|
+
/**
|
|
1157
|
+
* This method applies an event at a proxy hop (`HopEvent`), or its undo. A signal goes from a
|
|
1158
|
+
* sidecar in the network and process namespaces of the hop. The lab starts that sidecar at the
|
|
1159
|
+
* first signal of the hop. A query goes from the injector of the hop to its console on 127.0.0.1. The
|
|
1160
|
+
* injector stamps each one. An event with no undo gives null for its undo. A signal can wait for an
|
|
1161
|
+
* instant on CLOCK_MONOTONIC (`at`), as the thaw at the end of a hold does.
|
|
1162
|
+
*/
|
|
1163
|
+
event(event: HopEvent, undo?: boolean, at?: number): Promise<{
|
|
1164
|
+
t0: number;
|
|
1165
|
+
t1: number;
|
|
1166
|
+
} | null>;
|
|
1167
|
+
/** This method starts the client with `args`. Each file is in its container before it starts. */
|
|
1168
|
+
probe(args: readonly string[], files?: ReadonlyArray<{
|
|
1169
|
+
readonly content: string;
|
|
1170
|
+
readonly target: string;
|
|
1171
|
+
}>): Promise<Probe>;
|
|
1172
|
+
/**
|
|
1173
|
+
* This method waits for the next clock line of the prober, which gives the count of lost
|
|
1174
|
+
* records. It gives null when no clock line comes in 5 s, because then nothing tells the count.
|
|
1175
|
+
*/
|
|
1176
|
+
settle(): Promise<number | null>;
|
|
1177
|
+
manifest(sysctls: Readonly<Record<string, string>>, settings?: Readonly<Record<string, string>>, targetSysctls?: Readonly<Record<string, string>>): Promise<Manifest>;
|
|
1178
|
+
close(): Promise<void>;
|
|
1183
1179
|
}
|
|
1184
1180
|
/**
|
|
1185
|
-
* This function
|
|
1186
|
-
*
|
|
1187
|
-
* - the socket of the target for the same connection, in its namespace.
|
|
1188
|
-
* - a socket of a proxy of the topology, toward the client or toward the target. Toward the target,
|
|
1189
|
-
* it is the socket that carries the request, else the first socket that the run opens.
|
|
1181
|
+
* This function gives the content of a file of a proxy. Each {{next}} becomes the address and the
|
|
1182
|
+
* port of the next hop. Each {{next.host}} and {{next.port}} becomes one of the two.
|
|
1190
1183
|
*/
|
|
1191
|
-
export declare const
|
|
1192
|
-
/** This function gives
|
|
1193
|
-
export declare const
|
|
1184
|
+
export declare const templated: (content: string, next: string) => string;
|
|
1185
|
+
/** This function gives the JSON body of a toxic for the API of Toxiproxy. Each toxic of a cell has the name `fault`. */
|
|
1186
|
+
export declare const toxicBody: (toxic: Toxic) => string;
|
|
1194
1187
|
/**
|
|
1195
|
-
* This function gives the
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1198
|
-
|
|
1199
|
-
|
|
1188
|
+
* This function gives the routes of a chain: for each router, the networks after it, which the
|
|
1189
|
+
* element before it reaches through it. Element 0 is the client, and element k is hop k - 1. Network
|
|
1190
|
+
* j is the network between element j and element j + 1.
|
|
1191
|
+
*/
|
|
1192
|
+
export declare const routesOf: (hops: readonly Pick<Hop, "kind">[]) => Array<{
|
|
1193
|
+
readonly from: number;
|
|
1194
|
+
readonly via: number;
|
|
1195
|
+
readonly networks: readonly number[];
|
|
1196
|
+
}>;
|
|
1197
|
+
/**
|
|
1198
|
+
* This function gives the endpoint that an element connects to: the first element after it that
|
|
1199
|
+
* is not a router. Element 0 is the client, element k is hop k - 1, and the last element is the target.
|
|
1200
|
+
*/
|
|
1201
|
+
export declare const endpointAfter: (hops: readonly Pick<Hop, "kind">[], element: number) => number;
|
|
1202
|
+
/**
|
|
1203
|
+
* This function gives HZ from two readings of /proc/timer_list, one second apart: its `now at`
|
|
1204
|
+
* time in ns and its jiffies. It gives the nearest rate that Linux offers, or null when the
|
|
1205
|
+
* measurement is more than 5 % from each of them.
|
|
1206
|
+
*/
|
|
1207
|
+
export declare const hzOf: (first: {
|
|
1208
|
+
now: number;
|
|
1209
|
+
jiffies: number;
|
|
1210
|
+
}, second: {
|
|
1211
|
+
now: number;
|
|
1212
|
+
jiffies: number;
|
|
1213
|
+
}) => string | null;
|
|
1214
|
+
/** This function gives the build record of a source as a part of a manifest: `{ build }`, or nothing for an image that the harness pulls. */
|
|
1215
|
+
export declare const buildOf: (source: Parameters<typeof buildRecordOf>[0]) => {
|
|
1216
|
+
readonly build?: BuildRecord;
|
|
1217
|
+
};
|
|
1218
|
+
/** This function gives the version of the harness and the build of its image, as a part of the harness record of a manifest. */
|
|
1219
|
+
export declare const harnessRecord: () => {
|
|
1220
|
+
readonly version: string;
|
|
1221
|
+
readonly build?: BuildRecord;
|
|
1222
|
+
};
|
|
1223
|
+
/**
|
|
1224
|
+
* This function gives the record of the client of a run that the harness ships, for a manifest:
|
|
1225
|
+
* its kind, its image, and its build.
|
|
1226
|
+
*/
|
|
1227
|
+
export declare const shippedClientRecord: (kind: Client, image: string) => Manifest["client"];
|
|
1228
|
+
/** This function gives the device of a route from its line in `ip -o route get`: "10.0.0.2 dev eth0 src …". */
|
|
1229
|
+
export declare const deviceOf: (route: string) => string;
|
|
1230
|
+
/**
|
|
1231
|
+
* This function opens one environment:
|
|
1232
|
+
* - a chain of new networks, and the stock target on the last one. A direct pair has one network.
|
|
1233
|
+
* - a client that holds its own network namespace, with a privileged sidecar in it for its
|
|
1234
|
+
* sysctls and its routes. Docker Desktop keeps /proc/sys read-only in a container that operates
|
|
1235
|
+
* without privileges.
|
|
1236
|
+
* - each hop of the topology, on the network of each of its sides. A hop is a router, or a stock
|
|
1237
|
+
* proxy with an injector sidecar in its namespace.
|
|
1238
|
+
* - an injector sidecar in the namespace of the target.
|
|
1239
|
+
* - the prober, a privileged container that loads the kernel program and watches the namespace of
|
|
1240
|
+
* the client, of the target and of each hop.
|
|
1241
|
+
*
|
|
1242
|
+
* The client of each run is its own container in the namespace of the client. It is the TCP
|
|
1243
|
+
* client of the harness, a driver from its own image (ioredis on Node), or an image that the
|
|
1244
|
+
* caller gives. Each prints the same lines.
|
|
1245
|
+
*
|
|
1246
|
+
* The client reaches the networks after a router through that router, by a route that its
|
|
1247
|
+
* privileged sidecar adds. A router translates the address of the side of the client, thus the
|
|
1248
|
+
* target and each later hop see the router as the peer.
|
|
1200
1249
|
*/
|
|
1201
|
-
export declare const
|
|
1250
|
+
export declare const openLab: (target: Target, kind?: Client | ClientImage, topology?: Topology) => Promise<Lab>;
|
|
1202
1251
|
/**
|
|
1203
|
-
* This
|
|
1204
|
-
*
|
|
1205
|
-
*
|
|
1206
|
-
*
|
|
1207
|
-
*
|
|
1208
|
-
*
|
|
1209
|
-
* prober lost is also void.
|
|
1210
|
-
* - For an HTTP client, it also reads what the second request met (`requestOf`). An outcome other
|
|
1211
|
-
* than the one that the prediction gives is a finding.
|
|
1252
|
+
* This module is the lab of a replicated group: a primary and its replicas, and the Sentinels
|
|
1253
|
+
* that decide which member is the primary. It opens one environment for a group cell, and it does
|
|
1254
|
+
* the runs of the cell in it. Each member and each Sentinel is a container from the stock image of
|
|
1255
|
+
* the group, in its own network namespace. An injector sidecar shares its network and process
|
|
1256
|
+
* namespaces. The client of each run is ioredis in Sentinel mode. An observer subscribes to the
|
|
1257
|
+
* events of each Sentinel, and the prober watches the namespace of the client.
|
|
1212
1258
|
*/
|
|
1213
|
-
|
|
1259
|
+
/** A stamp is the time of the injector around one commit, on CLOCK_MONOTONIC in nanoseconds. */
|
|
1260
|
+
interface Stamp {
|
|
1261
|
+
readonly t0: number;
|
|
1262
|
+
readonly t1: number;
|
|
1263
|
+
}
|
|
1264
|
+
/** A group network fault is a black hole between a part and its peers, or a reset of each segment from them. */
|
|
1265
|
+
type GroupNetworkFault = "blackhole" | "rst";
|
|
1266
|
+
/** A group client is the client container of one run of a group cell. */
|
|
1267
|
+
interface GroupClient {
|
|
1268
|
+
readonly events: readonly ProbeEvent[];
|
|
1269
|
+
until(kinds: readonly string[], within: number): Promise<ProbeEvent>;
|
|
1270
|
+
stop(): Promise<void>;
|
|
1271
|
+
}
|
|
1272
|
+
/** A group lab is one environment of a group cell. */
|
|
1273
|
+
interface GroupLab {
|
|
1274
|
+
readonly group: Group;
|
|
1275
|
+
readonly clientIp: string;
|
|
1276
|
+
readonly observerIp: string;
|
|
1277
|
+
readonly members: Readonly<Record<string, RunPart>>;
|
|
1278
|
+
readonly sentinels: Readonly<Record<string, RunPart>>;
|
|
1279
|
+
/** These are the namespaces that the prober watches: the client, and the Sentinels for a calibration. */
|
|
1280
|
+
readonly netns: {
|
|
1281
|
+
readonly client: number;
|
|
1282
|
+
readonly watched: readonly number[];
|
|
1283
|
+
};
|
|
1284
|
+
/** These are all the records that the prober wrote, in sequence. */
|
|
1285
|
+
readonly kernel: readonly KernelRecord[];
|
|
1286
|
+
/** These are all the lines of the observer of the Sentinels, in sequence. */
|
|
1287
|
+
readonly timeline: readonly SentinelEvent[];
|
|
1288
|
+
/** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
|
|
1289
|
+
sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
|
|
1290
|
+
/** This method waits until the group is whole and calm, and gives the name of its primary. */
|
|
1291
|
+
converge(within?: number): Promise<string>;
|
|
1292
|
+
/** This method removes each key from the group, and waits until each replica has the removal. */
|
|
1293
|
+
flush(primary: string): Promise<void>;
|
|
1294
|
+
/** This method makes each Sentinel forget the state of the group (`SENTINEL RESET`): an aborted failover then holds off no later failover. */
|
|
1295
|
+
reset(): Promise<void>;
|
|
1296
|
+
/** This method gives the sequence numbers that the group holds, from its primary. */
|
|
1297
|
+
holds(primary: string): Promise<number[]>;
|
|
1298
|
+
/** This method gives the part that has a role in the group, when `primary` is the primary. */
|
|
1299
|
+
partOf(role: GroupRole, primary: string): string;
|
|
1300
|
+
/** This method starts the client of a run, with the arguments of `client-sentinel.mjs`. */
|
|
1301
|
+
client(args: readonly string[]): Promise<GroupClient>;
|
|
1302
|
+
/** This method applies a network fault between a part and some of its peers, at once or at an instant of the VM. */
|
|
1303
|
+
fault(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
|
|
1304
|
+
/** This method removes a network fault, at once or at an instant of the VM. */
|
|
1305
|
+
lift(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
|
|
1306
|
+
/** This method sends a signal to the server process of a part, at once or at an instant of the VM. */
|
|
1307
|
+
signal(part: string, signal: "KILL" | "STOP" | "CONT", at?: number): Promise<Stamp>;
|
|
1308
|
+
/** This method starts the server of a member again, after a fin. */
|
|
1309
|
+
restart(member: string): Promise<void>;
|
|
1310
|
+
/** This method asks the first Sentinel for a failover of the group. */
|
|
1311
|
+
failover(coordinated: boolean): Promise<Stamp>;
|
|
1312
|
+
/** This method removes the TCP metrics of the client namespace: each run starts from a kernel that keeps nothing. */
|
|
1313
|
+
forget(): Promise<void>;
|
|
1314
|
+
/** This method waits for the next clock line of the prober, which gives the count of lost records. */
|
|
1315
|
+
settle(): Promise<number | null>;
|
|
1316
|
+
manifest(sysctls: Readonly<Record<string, string>>): Promise<Manifest>;
|
|
1317
|
+
close(): Promise<void>;
|
|
1318
|
+
}
|
|
1319
|
+
/** This function gives the configuration file of a member: its port, its settings, and the primary that a replica follows. */
|
|
1320
|
+
export declare const memberConfig: (group: Group, primary: string | null) => string;
|
|
1321
|
+
/** This function gives the configuration file of a Sentinel: its port, the group that it monitors, and the settings of the group. */
|
|
1322
|
+
export declare const sentinelConfig: (group: Group, primary: string) => string;
|
|
1214
1323
|
/**
|
|
1215
|
-
* This function
|
|
1216
|
-
*
|
|
1217
|
-
* the
|
|
1324
|
+
* This function gives the peers that a fault on a part cuts it from, by their addresses. `all` is
|
|
1325
|
+
* each other part and the client, `group` is the other parts, and `clients` and `to-clients` are
|
|
1326
|
+
* the client. `one` and `one-way` are the first other member. The observer is not a peer, thus the timeline of the
|
|
1327
|
+
* group stays whole.
|
|
1218
1328
|
*/
|
|
1219
|
-
export declare const
|
|
1329
|
+
export declare const peersOf: (parts: {
|
|
1330
|
+
readonly members: Readonly<Record<string, RunPart>>;
|
|
1331
|
+
readonly sentinels: Readonly<Record<string, RunPart>>;
|
|
1332
|
+
}, client: string, part: string, cuts: NonNullable<GroupPlace["cuts"]>) => string[];
|
|
1333
|
+
/** This function reads the flat reply of a command line client into its fields: name, value, name, value. */
|
|
1334
|
+
export declare const fieldsOf: (text: string) => Array<Record<string, string>>;
|
|
1335
|
+
/** This function reads the INFO of a server into its fields. */
|
|
1336
|
+
export declare const infoOf: (text: string) => Record<string, string>;
|
|
1220
1337
|
/**
|
|
1221
|
-
*
|
|
1222
|
-
*
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1225
|
-
* A new try that gets no connection writes no `retry` line. Its dial writes a `dial-error` line.
|
|
1226
|
-
* Thus a `dial-error` line after the first try and before the end is also a new try.
|
|
1338
|
+
* A view of the group is what its parts tell at one time. `healthy` tells if each Sentinel agrees
|
|
1339
|
+
* on one primary with no flag but `master`, and knows each replica and each other Sentinel. Each
|
|
1340
|
+
* replica must follow that primary with its link up, and the primary must have each replica online,
|
|
1341
|
+
* with no failover in progress.
|
|
1227
1342
|
*/
|
|
1228
|
-
|
|
1343
|
+
interface GroupView {
|
|
1344
|
+
readonly primary: string | null;
|
|
1345
|
+
readonly healthy: boolean;
|
|
1346
|
+
readonly why: string;
|
|
1347
|
+
}
|
|
1348
|
+
/** This function judges the views of the Sentinels and of the members: the primary that they agree on, if the group is healthy. */
|
|
1349
|
+
export declare const viewOf: (group: Group, ips: Readonly<Record<string, string>>, sentinels: ReadonlyArray<{
|
|
1350
|
+
readonly master: Record<string, string>;
|
|
1351
|
+
readonly replicas: ReadonlyArray<Record<string, string>>;
|
|
1352
|
+
}>, members: Readonly<Record<string, Record<string, string>>>) => GroupView;
|
|
1353
|
+
/** This time is the longest that a group takes to converge before a run, or after it. */
|
|
1354
|
+
export declare const CONVERGE_MS = 24e4;
|
|
1229
1355
|
/**
|
|
1230
|
-
*
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
1233
|
-
*
|
|
1234
|
-
* the
|
|
1235
|
-
*
|
|
1236
|
-
*
|
|
1237
|
-
*
|
|
1238
|
-
*
|
|
1356
|
+
* This function opens one environment of a group cell:
|
|
1357
|
+
* - one new network, with each member, each Sentinel, the client and the observer on it.
|
|
1358
|
+
* - each member: the stock image, its server as the child of a shell, thus a fin can stop the
|
|
1359
|
+
* server and the container stays up. The first member is the primary, and the others follow it.
|
|
1360
|
+
* - each Sentinel: the stock image, its Sentinel as the child of a shell, which monitors the first member.
|
|
1361
|
+
* - an injector sidecar for each part, in its network and process namespaces.
|
|
1362
|
+
* - a client that holds its own network namespace, with a privileged sidecar for its sysctls.
|
|
1363
|
+
* - the observer of the Sentinels, in a namespace of its own.
|
|
1364
|
+
* - the prober, which watches the namespace of the client, and of each Sentinel for a calibration.
|
|
1239
1365
|
*/
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
export declare const FABRIC_TARGET = "10.2.0.2";
|
|
1248
|
-
/** A router is one box of the fabric, as data. */
|
|
1249
|
-
interface Router {
|
|
1250
|
-
readonly name: string;
|
|
1251
|
-
readonly as: number;
|
|
1252
|
-
readonly id: string;
|
|
1253
|
-
readonly interfaces: Readonly<Record<string, string>>;
|
|
1254
|
-
readonly neighbors: ReadonlyArray<{
|
|
1255
|
-
readonly address: string;
|
|
1256
|
-
readonly as: number;
|
|
1257
|
-
readonly weight?: number;
|
|
1258
|
-
}>;
|
|
1259
|
-
/** This prefix is the network behind a leaf, which its BGP advertises. */
|
|
1260
|
-
readonly network?: string;
|
|
1261
|
-
/** This prefix is the network behind the other leaf. A move is a change of its route. */
|
|
1262
|
-
readonly remote?: string;
|
|
1263
|
-
}
|
|
1264
|
-
/** These are the routers. Each leaf prefers spine1 by a weight of 100, thus the path of each run is known. */
|
|
1265
|
-
export declare const ROUTERS: readonly Router[];
|
|
1266
|
-
/** This text is the `daemons` file of each router: BGP and BFD, on top of what FRRouting always starts. */
|
|
1267
|
-
export declare const DAEMONS: string;
|
|
1366
|
+
export declare const openGroupLab: (group: Group, options?: {
|
|
1367
|
+
readonly watchSentinels?: boolean;
|
|
1368
|
+
}) => Promise<GroupLab>;
|
|
1369
|
+
/** This function gives the latest time that a group cell waits for its outcome, in ms from the fault. */
|
|
1370
|
+
export declare const deadlineOf: (cell: Cell) => number;
|
|
1371
|
+
/** This function gives the latest subscription of the observer to each Sentinel, in some lines of the observer. */
|
|
1372
|
+
export declare const subscriptionsOf: (timeline: readonly SentinelEvent[]) => SentinelEvent[];
|
|
1268
1373
|
/**
|
|
1269
|
-
* This function
|
|
1270
|
-
*
|
|
1271
|
-
*
|
|
1374
|
+
* This function does one run of a group cell:
|
|
1375
|
+
* - The group converges, and its keys go. The client connects through the Sentinels, and its
|
|
1376
|
+
* stream of writes gets steady.
|
|
1377
|
+
* - The fault occurs on its part, as the primary of this run makes the roles. A fault with a
|
|
1378
|
+
* hold lifts at its instant in the VM. A stall lifts at its length after the first write into it.
|
|
1379
|
+
* - The run waits for its outcome: the first write that a new primary accepts, or the first one
|
|
1380
|
+
* after the lift on the same primary. Then it continues for a moment.
|
|
1381
|
+
* - Each fault goes, the client stops, and the group converges again. The keys that it then holds
|
|
1382
|
+
* tell which writes it kept.
|
|
1272
1383
|
*/
|
|
1273
|
-
export declare const
|
|
1384
|
+
export declare const groupOnce: (lab: GroupLab, cell: Cell, environment: number, index: number) => Promise<Run>;
|
|
1274
1385
|
/**
|
|
1275
|
-
* This
|
|
1276
|
-
*
|
|
1277
|
-
*
|
|
1278
|
-
*
|
|
1386
|
+
* This module is the lab of a replica set: a replicated group with no external authority, whose
|
|
1387
|
+
* members elect their own primary. It opens one environment for a replica set cell, for the runs
|
|
1388
|
+
* of the cell. Each member is a container from the stock image of the set, in its own network
|
|
1389
|
+
* namespace. An injector sidecar shares its network and process namespaces.
|
|
1390
|
+
*
|
|
1391
|
+
* The client of each run is the MongoDB driver, which finds the primary with its own monitors. The
|
|
1392
|
+
* timeline comes from the log of each member and from the lines of the client. The prober watches
|
|
1393
|
+
* the namespace of the client.
|
|
1279
1394
|
*/
|
|
1280
|
-
export declare const topologyOf: (lab: string, dir: string, client: string, target: string) => string;
|
|
1281
|
-
/** A route line is one line of `ip -ts -o monitor route`, with its time on the wall clock in ms. */
|
|
1282
|
-
interface RouteLine {
|
|
1283
|
-
readonly wall: number;
|
|
1284
|
-
readonly deleted: boolean;
|
|
1285
|
-
readonly prefix: string;
|
|
1286
|
-
readonly via: string | null;
|
|
1287
|
-
readonly dev: string | null;
|
|
1288
|
-
}
|
|
1289
|
-
/** This function reads a line of `ip -ts -o monitor route`, or it gives null for another line. The clock of a container is UTC. */
|
|
1290
|
-
export declare const routeLine: (text: string) => RouteLine | null;
|
|
1291
|
-
/** A clock pair is one instant on the monotonic clock in ns and on the wall clock in ms. */
|
|
1292
|
-
interface ClockPair {
|
|
1293
|
-
readonly mono: number;
|
|
1294
|
-
readonly wall: number;
|
|
1295
|
-
}
|
|
1296
1395
|
/**
|
|
1297
|
-
*
|
|
1298
|
-
*
|
|
1299
|
-
*
|
|
1396
|
+
* A member line is one log line of a member, as mongod writes it in JSON. `real` is its time on
|
|
1397
|
+
* the wall clock in ms, and `t` is its time on the monotonic clock. The run gives `t` from the
|
|
1398
|
+
* clock lines of its client.
|
|
1300
1399
|
*/
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
readonly
|
|
1305
|
-
readonly
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
readonly neighbors: string;
|
|
1310
|
-
/** This text is the kernel's route to the far network, from `ip -o route show`. */
|
|
1311
|
-
readonly route: string;
|
|
1312
|
-
/** This text is `show bgp ipv4 unicast PREFIX json`. */
|
|
1313
|
-
readonly paths: string;
|
|
1314
|
-
/** This text is `show bfd peers json`, or null when the fabric has no BFD. */
|
|
1315
|
-
readonly bfd: string | null;
|
|
1400
|
+
interface MemberLine extends SentinelEvent {
|
|
1401
|
+
readonly ev: "mongod";
|
|
1402
|
+
readonly member: string;
|
|
1403
|
+
readonly real: number;
|
|
1404
|
+
readonly id: number;
|
|
1405
|
+
readonly c: string;
|
|
1406
|
+
readonly msg: string;
|
|
1407
|
+
readonly attr: Readonly<Record<string, unknown>>;
|
|
1316
1408
|
}
|
|
1409
|
+
/** These are the components of the log of mongod that a run keeps: replication, its heartbeats, the elections, the rollbacks and the commands. */
|
|
1410
|
+
export declare const KEPT: ReadonlySet<string>;
|
|
1411
|
+
/** This function reads one log line of a member, or gives null for a line of another component or a line that is not JSON. */
|
|
1412
|
+
export declare const memberLineOf: (member: string, text: string) => MemberLine | null;
|
|
1317
1413
|
/**
|
|
1318
|
-
* This function
|
|
1319
|
-
*
|
|
1320
|
-
*
|
|
1414
|
+
* This function gives the offset of the wall clock from the monotonic clock, in ns, from the clock
|
|
1415
|
+
* lines of a client. Each line pairs its stamp with the wall clock in whole ms, which truncates.
|
|
1416
|
+
* Thus each pair is the offset or less, and the largest pair is the nearest. It is null without a clock line.
|
|
1321
1417
|
*/
|
|
1322
|
-
export declare const
|
|
1418
|
+
export declare const clockOffsetOf: (events: readonly ProbeEvent[]) => number | null;
|
|
1419
|
+
/** This function puts the log lines of the members on the monotonic clock, with the offset of a client. */
|
|
1420
|
+
export declare const onMonotonic: (log: readonly MemberLine[], offset: number | null) => MemberLine[];
|
|
1421
|
+
/** A cut is the peers that a network fault on a part cuts it from, by their addresses, and the direction of the rules. */
|
|
1422
|
+
interface Cut {
|
|
1423
|
+
readonly peers: readonly string[];
|
|
1424
|
+
readonly direction?: "out";
|
|
1425
|
+
}
|
|
1323
1426
|
/**
|
|
1324
|
-
* This function gives the
|
|
1325
|
-
*
|
|
1326
|
-
* the
|
|
1427
|
+
* This function gives the peers that a fault on a member of a replica set cuts it from. `all` is
|
|
1428
|
+
* each other member and the client, `group` is the other members, and `clients` is the client.
|
|
1429
|
+
* `one` is the first other member in the sequence of the set, and `one-way` is the same member for
|
|
1430
|
+
* the segments from the part only.
|
|
1327
1431
|
*/
|
|
1328
|
-
export declare const
|
|
1329
|
-
/**
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1432
|
+
export declare const cutOf: (set: ReplicaSet, members: Readonly<Record<string, RunPart>>, client: string, part: string, cuts: NonNullable<GroupPlace["cuts"]>) => Cut;
|
|
1433
|
+
/** This function gives the command of the server of each member. The server is the child of a shell, thus a fin can stop it and the container stays up. */
|
|
1434
|
+
export declare const memberCommand: (set: ReplicaSet) => string;
|
|
1435
|
+
/** This function gives the script of the shell that starts the set: each member by its address, and the settings of the set. */
|
|
1436
|
+
export declare const initiateScript: (set: ReplicaSet, ips: Readonly<Record<string, string>>) => string;
|
|
1437
|
+
/** This script prints the view of a member: itself, if it accepts writes, and the state of each member as it sees them. */
|
|
1438
|
+
export declare const STATUS_SCRIPT: string;
|
|
1439
|
+
/** A status is the view of one member, as `STATUS_SCRIPT` prints it. */
|
|
1440
|
+
interface Status {
|
|
1441
|
+
readonly me: string;
|
|
1442
|
+
readonly writable: boolean;
|
|
1443
|
+
readonly members: ReadonlyArray<{
|
|
1444
|
+
readonly name: string;
|
|
1445
|
+
readonly state: string;
|
|
1446
|
+
readonly health: number;
|
|
1447
|
+
readonly optime: number | null;
|
|
1342
1448
|
}>;
|
|
1343
|
-
/** This method waits until each leaf is on spine1 with each session up. */
|
|
1344
|
-
ready(): Promise<void>;
|
|
1345
|
-
/** This method gives the count of established sessions of each leaf so far. */
|
|
1346
|
-
sessions(): Promise<Readonly<Record<string, number>>>;
|
|
1347
|
-
/** This method gives the record of the fabric for a manifest. */
|
|
1348
|
-
manifest(): FabricManifest;
|
|
1349
|
-
/** This method destroys the routers. */
|
|
1350
|
-
close(): Promise<void>;
|
|
1351
|
-
}
|
|
1352
|
-
/** These are the parts of a lab that a fabric uses. */
|
|
1353
|
-
interface FabricParts {
|
|
1354
|
-
readonly fabric: Fabric;
|
|
1355
|
-
readonly image: string;
|
|
1356
|
-
readonly client: StartedTestContainer;
|
|
1357
|
-
readonly server: StartedTestContainer;
|
|
1358
|
-
readonly admin: StartedTestContainer;
|
|
1359
|
-
readonly injector: StartedTestContainer;
|
|
1360
|
-
readonly opened: StartedTestContainer[];
|
|
1361
|
-
readonly output: (container: StartedTestContainer, argv: string[]) => Promise<string>;
|
|
1362
1449
|
}
|
|
1363
1450
|
/**
|
|
1364
|
-
* This function
|
|
1365
|
-
*
|
|
1366
|
-
*
|
|
1451
|
+
* This function judges the view of a member: the primary of the set, and if the set is healthy.
|
|
1452
|
+
* The set is healthy when the member is the one primary and accepts writes. Each other member must
|
|
1453
|
+
* be a healthy secondary at the optime of the primary.
|
|
1367
1454
|
*/
|
|
1368
|
-
export declare const
|
|
1369
|
-
/**
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1455
|
+
export declare const statusViewOf: (set: ReplicaSet, ips: Readonly<Record<string, string>>, status: Status) => GroupView;
|
|
1456
|
+
/** A replica set lab is one environment of a replica set cell. */
|
|
1457
|
+
interface ReplicaSetLab {
|
|
1458
|
+
readonly set: ReplicaSet;
|
|
1459
|
+
readonly clientIp: string;
|
|
1460
|
+
readonly members: Readonly<Record<string, RunPart>>;
|
|
1461
|
+
readonly netns: {
|
|
1462
|
+
readonly client: number;
|
|
1463
|
+
};
|
|
1464
|
+
/** These are all the records that the prober wrote, in sequence. */
|
|
1465
|
+
readonly kernel: readonly KernelRecord[];
|
|
1466
|
+
/** These are the log lines of the members that a run keeps, in the sequence of their arrival, with `t` at 0. */
|
|
1467
|
+
readonly log: readonly MemberLine[];
|
|
1468
|
+
/** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
|
|
1469
|
+
sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
|
|
1470
|
+
/** This method waits until the set is whole and calm, and gives the name of its primary. */
|
|
1471
|
+
converge(within?: number): Promise<string>;
|
|
1472
|
+
/** This method removes each write from the set, and waits until each member has the removal. */
|
|
1473
|
+
flush(primary: string): Promise<void>;
|
|
1474
|
+
/**
|
|
1475
|
+
* This method lets each secondary stand for election again (`rs.freeze(0)`). A step-down holds its
|
|
1476
|
+
* old primary out of the elections for `STEP_DOWN.seconds`. Without it, a run inherits that hold.
|
|
1477
|
+
*/
|
|
1478
|
+
unfreeze(primary: string): Promise<void>;
|
|
1479
|
+
/** This method gives the sequence numbers that the set holds, from its primary. */
|
|
1480
|
+
holds(primary: string): Promise<number[]>;
|
|
1481
|
+
/** This method gives the member that has a role in the set, when `primary` is the primary. */
|
|
1482
|
+
partOf(role: GroupRole, primary: string): string;
|
|
1483
|
+
/** This method starts the client of a run, with the arguments of `client-mongo.mjs`. */
|
|
1484
|
+
client(args: readonly string[]): Promise<GroupClient>;
|
|
1485
|
+
/** This method applies a network fault between a member and some of its peers, at once or at an instant of the VM. */
|
|
1486
|
+
fault(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
|
|
1487
|
+
/** This method removes a network fault, at once or at an instant of the VM. */
|
|
1488
|
+
lift(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
|
|
1489
|
+
/** This method sends a signal to the server process of a member, at once or at an instant of the VM. */
|
|
1490
|
+
signal(part: string, signal: "KILL" | "STOP" | "CONT", at?: number): Promise<Stamp>;
|
|
1491
|
+
/** This method starts the server of a member again, after a fin. */
|
|
1492
|
+
restart(member: string): Promise<void>;
|
|
1493
|
+
/** This method runs a command in the box of a member, and gives its output. */
|
|
1494
|
+
exec(member: string, argv: string[]): Promise<string>;
|
|
1495
|
+
/** This method runs a script of the shell on a member, against its own server only, and gives its output. Another port reads a server with no set. */
|
|
1496
|
+
script(member: string, script: string, port?: number): Promise<string>;
|
|
1497
|
+
/** This method runs a command on the backup host of a drill, and gives its output. A lab without that host refuses it. */
|
|
1498
|
+
vault(argv: string[]): Promise<string>;
|
|
1499
|
+
/** This method sends replSetStepDown to the primary. */
|
|
1500
|
+
stepDown(primary: string): Promise<Stamp>;
|
|
1501
|
+
/** This method removes the TCP metrics of the client namespace: each run starts from a kernel that keeps nothing. */
|
|
1502
|
+
forget(): Promise<void>;
|
|
1503
|
+
/** This method waits for the next clock line of the prober, which gives the count of lost records. */
|
|
1504
|
+
settle(): Promise<number | null>;
|
|
1505
|
+
manifest(sysctls: Readonly<Record<string, string>>): Promise<Manifest>;
|
|
1506
|
+
close(): Promise<void>;
|
|
1507
|
+
}
|
|
1508
|
+
/** This function waits for a time, in ms. */
|
|
1509
|
+
/** These are the arguments of replSetStepDown: the time that the old primary cannot stand again, and the wait for a secondary to catch up. */
|
|
1510
|
+
export declare const STEP_DOWN: {
|
|
1511
|
+
readonly seconds: 60;
|
|
1512
|
+
readonly catchUp: 10;
|
|
1513
|
+
};
|
|
1375
1514
|
/**
|
|
1376
|
-
*
|
|
1377
|
-
*
|
|
1515
|
+
* This function opens one environment of a replica set cell:
|
|
1516
|
+
* - one new network, with each member, the client and the sender of a step-down on it.
|
|
1517
|
+
* - each member: the stock image, its server as the child of a shell. A log consumer reads its
|
|
1518
|
+
* JSON log. The first member starts the set with the address of each member, and the lab
|
|
1519
|
+
* waits for a primary.
|
|
1520
|
+
* - an injector sidecar for each member, in its network and process namespaces.
|
|
1521
|
+
* - a client that holds its own network namespace, with a privileged sidecar for its sysctls.
|
|
1522
|
+
* - the prober, which watches the namespace of the client.
|
|
1523
|
+
* - a backup host for a recovery drill: the stock image, for its tools, with no server.
|
|
1378
1524
|
*/
|
|
1379
|
-
export declare const
|
|
1380
|
-
/**
|
|
1381
|
-
export declare const
|
|
1382
|
-
/** This function gives the command of a program of a subject by its role. It fails when the subject has no such program. */
|
|
1383
|
-
export declare const programOf: (subject: Subject, role: string) => readonly string[];
|
|
1525
|
+
export declare const openReplicaSetLab: (set: ReplicaSet, backups?: boolean) => Promise<ReplicaSetLab>;
|
|
1526
|
+
/** This function gives the arguments of the client of a replica set cell: each member, and the stream of writes. */
|
|
1527
|
+
export declare const replicaSetArgs: (cell: Cell, members: Readonly<Record<string, RunPart>>) => string[];
|
|
1384
1528
|
/**
|
|
1385
|
-
* This function
|
|
1386
|
-
*
|
|
1387
|
-
*
|
|
1529
|
+
* This function does one run of a replica set cell:
|
|
1530
|
+
* - The set converges, and its writes go. The client finds the primary with its monitors, and its
|
|
1531
|
+
* stream of writes gets steady.
|
|
1532
|
+
* - The fault occurs on its member, as the primary of this run makes the roles. A fault with a
|
|
1533
|
+
* hold lifts at its instant in the VM. A stall lifts at its length after the first write into
|
|
1534
|
+
* it. A step-down is replSetStepDown to the primary.
|
|
1535
|
+
* - The run waits for its outcome: the first accepted write of a write sent after the commit of
|
|
1536
|
+
* the fault. It is on a new primary, or on any primary. Then the run waits for the end of the
|
|
1537
|
+
* hold, thus the record shows what the set did in the whole hold.
|
|
1538
|
+
* - Each fault goes, the client stops, and the set converges again. The writes that it then holds
|
|
1539
|
+
* tell which writes it kept. The log lines of the members go onto the monotonic clock.
|
|
1388
1540
|
*/
|
|
1389
|
-
export declare const
|
|
1390
|
-
/** This pattern matches an image pinned by digest: a name, a tag or none, then `@sha256:` and 64 hex digits. */
|
|
1391
|
-
export declare const PINNED: RegExp;
|
|
1392
|
-
/** This pattern matches the repository of a tag that the harness builds. Its parts are lower case, with `/` between them. */
|
|
1393
|
-
export declare const REPOSITORY: RegExp;
|
|
1394
|
-
/** This function tells if a path stays in its context: relative, with `/` between its parts, and no `..`. */
|
|
1395
|
-
export declare const inContext: (path: string) => boolean;
|
|
1541
|
+
export declare const replicaSetOnce: (lab: ReplicaSetLab, cell: Cell, environment: number, index: number) => Promise<Run>;
|
|
1396
1542
|
/**
|
|
1397
|
-
* This
|
|
1398
|
-
*
|
|
1399
|
-
*
|
|
1543
|
+
* This module holds the pure parts of a recovery drill. These are the scripts of the shell, the reader
|
|
1544
|
+
* of the output of `bsondump`, and the set check of a recovery. It has no container, thus unit tests
|
|
1545
|
+
* run it. `drill.ts` does the drill on a lab.
|
|
1546
|
+
*
|
|
1547
|
+
* A dump with `--oplog` reads the oplog from the start of the dump to its end. A slice reads the
|
|
1548
|
+
* oplog after the last entry of the backup before it. Thus the backups together hold each write up
|
|
1549
|
+
* to the last entry of the last backup, and no write after it. One writer sends the writes one at a
|
|
1550
|
+
* time, thus the highest sequence number is also the latest write.
|
|
1400
1551
|
*/
|
|
1401
|
-
|
|
1552
|
+
/** This size is one document of generated data. A tenant holds as many documents as its size needs. */
|
|
1553
|
+
export declare const SEED_DOCUMENT = 65536;
|
|
1554
|
+
/** This count is how far the lost writes can be from the writes after the last backup: the writes in flight at the fault. */
|
|
1555
|
+
export declare const LOSS_MARGIN = 2;
|
|
1402
1556
|
/**
|
|
1403
|
-
* This function gives the
|
|
1404
|
-
*
|
|
1557
|
+
* This function gives the most disk that a drill needs, from the disk that it can use. The peak comes
|
|
1558
|
+
* before the fault. Then each member holds the data and its oplog, and the backup host holds the
|
|
1559
|
+
* dump. The seed goes through the oplog, thus each oplog holds the data up to its own size. The
|
|
1560
|
+
* slices are small: the writes of one client in a few seconds.
|
|
1405
1561
|
*/
|
|
1406
|
-
export declare const
|
|
1562
|
+
export declare const roomNeeded: (drill: Drill, members: number, disk: Quantity) => Quantity;
|
|
1563
|
+
/** This function gives MemAvailable from the text of `/proc/meminfo`. */
|
|
1564
|
+
export declare const memAvailableOf: (meminfo: string) => Quantity;
|
|
1565
|
+
/** This function gives the reason that a drill has no room on its runner, or null. A record from before SYS-97 has no room, and it is not void for this reason. */
|
|
1566
|
+
export declare const roomVoidOf: (room: DrillRoom | undefined) => string | null;
|
|
1567
|
+
/** This function gives the time of a drill from the start of the backups to the fault, in seconds. */
|
|
1568
|
+
export declare const drillSpan: (drill: Drill) => number;
|
|
1407
1569
|
/**
|
|
1408
|
-
* This
|
|
1409
|
-
*
|
|
1410
|
-
* can read, thus it is in the list too.
|
|
1570
|
+
* This script writes the generated data of each tenant into the collection `tenants`. Each write
|
|
1571
|
+
* waits for `copies` members, thus each member holds the data when the script ends.
|
|
1411
1572
|
*/
|
|
1412
|
-
export declare const
|
|
1573
|
+
export declare const seedScript: (drill: Drill, copies: number) => string;
|
|
1574
|
+
/** This script prints the hash of the collection `tenants`. It takes locks, thus a run reads it with no writer. */
|
|
1575
|
+
export declare const HASH_SCRIPT: string;
|
|
1576
|
+
/** This function gives the hash from the output of `HASH_SCRIPT`. */
|
|
1577
|
+
export declare const hashOf: (text: string) => string;
|
|
1578
|
+
/** This function gives the command of a server with no set, on its own port. A client of the set cannot reach that server, and a restore writes to it. */
|
|
1579
|
+
export declare const standaloneCommand: (set: ReplicaSet, port: number) => string;
|
|
1413
1580
|
/**
|
|
1414
|
-
* This
|
|
1415
|
-
* a
|
|
1581
|
+
* This script waits for the end of the server of a box, and it can stop the server first. `kill -0`
|
|
1582
|
+
* also succeeds on a zombie, and the shell of the box can leave its child as a zombie for a long
|
|
1583
|
+
* time. Thus the script reads the state of the process, and a zombie has ended.
|
|
1416
1584
|
*/
|
|
1417
|
-
export declare const
|
|
1585
|
+
export declare const stopScript: (terminate: boolean) => string;
|
|
1586
|
+
/** An oplog time is the `ts` of an oplog entry: a time in seconds, and the count of the entry in that second. */
|
|
1587
|
+
interface OplogTime {
|
|
1588
|
+
readonly t: number;
|
|
1589
|
+
readonly i: number;
|
|
1590
|
+
}
|
|
1591
|
+
/** An oplog read is what an oplog file holds: its last entry, and the highest sequence number that it inserts. */
|
|
1592
|
+
interface OplogRead {
|
|
1593
|
+
readonly last: OplogTime | null;
|
|
1594
|
+
readonly highest: number | null;
|
|
1595
|
+
}
|
|
1596
|
+
/** This function reads an oplog file from the output of `bsondump`. Only an insert into `cells.w` is a write of a client. */
|
|
1597
|
+
export declare const readOplog: (text: string) => OplogRead;
|
|
1598
|
+
/** This function gives the highest sequence number of the file of the writes in a dump, from the output of `bsondump`, or null. */
|
|
1599
|
+
export declare const highestHeld: (text: string) => number | null;
|
|
1600
|
+
/** This function gives the query of a slice of the oplog: each entry after an oplog time, in Extended JSON. */
|
|
1601
|
+
export declare const sliceQuery: (after: OplogTime) => string;
|
|
1602
|
+
/** A recovery measurement is what a drill found, beside the writes of the run. */
|
|
1603
|
+
interface RecoveryMeasured {
|
|
1604
|
+
/** This time is from the reply to the last accepted write that the store kept to the fault, or null with no such write. */
|
|
1605
|
+
readonly rpo: Quantity | null;
|
|
1606
|
+
/** This time is `rpo` less the age of the drill: what a schedule adds to its interval. It is null for a control and for an election. */
|
|
1607
|
+
readonly excess: Quantity | null;
|
|
1608
|
+
/** These are the accepted writes that the store lost, below a write that it kept. A restore must leave none. */
|
|
1609
|
+
readonly holes: readonly number[];
|
|
1610
|
+
/** This count is the number of accepted writes after the last write of the last backup, or null without a backup. */
|
|
1611
|
+
readonly afterBackup: number | null;
|
|
1612
|
+
/** This flag tells if the tenants have the same data after the recovery, or null when that is not known. */
|
|
1613
|
+
readonly sameData: boolean | null;
|
|
1614
|
+
}
|
|
1615
|
+
/** This function gives the measurement of a drill, from its run. `t0` is the fault. */
|
|
1616
|
+
export declare const recoveryOf: (drill: Drill, run: Run, t0: number) => RecoveryMeasured;
|
|
1617
|
+
/** This function gives the findings of a drill: each rule of a recovery that its run broke. */
|
|
1618
|
+
export declare const recoveryFindings: (measured: RecoveryMeasured, writes: Writes) => string[];
|
|
1418
1619
|
/**
|
|
1419
|
-
* This
|
|
1420
|
-
*
|
|
1620
|
+
* This module measures a run of a group cell. It gives the first write that a primary accepted
|
|
1621
|
+
* after the fault, and the timeline of the group. The Sentinels of a group announce its timeline.
|
|
1622
|
+
* The logs of the members of a replica set or of the nodes of a cluster, and its client, tell it. The
|
|
1623
|
+
* module also gives what became of each write.
|
|
1421
1624
|
*/
|
|
1422
|
-
|
|
1625
|
+
/** These are the stages of a timeline under Sentinels, in their sequence after a fault. */
|
|
1626
|
+
export declare const STAGES: readonly SentinelStage[];
|
|
1627
|
+
/** An error on the way is one kind of error that the client met after the fault. It has its first time from the fault, and its count. */
|
|
1628
|
+
interface ErrorOnTheWay {
|
|
1629
|
+
readonly name: string;
|
|
1630
|
+
readonly first: Quantity;
|
|
1631
|
+
readonly count: number;
|
|
1632
|
+
}
|
|
1423
1633
|
/**
|
|
1424
|
-
*
|
|
1425
|
-
*
|
|
1634
|
+
* A writes record tells what became of the writes of a run, by their sequence numbers:
|
|
1635
|
+
* - `old` counts the writes that the primary of the start of the run accepted after the fault. A
|
|
1636
|
+
* cluster counts none: its client publishes through one node, not through the leader of the queue.
|
|
1637
|
+
* - `lost` are the writes that a primary accepted and the group did not keep. They are the cost
|
|
1638
|
+
* of a split brain. It is null when the group did not converge after the run.
|
|
1639
|
+
* - `unknown` are the writes that the client sent and did not see accepted: an error, or no answer.
|
|
1640
|
+
* `held` tells if the group kept each one, or null when it did not converge.
|
|
1641
|
+
* - `duplicates` has one entry for each extra copy that the group holds: a write held three times
|
|
1642
|
+
* has two entries. It is null when the group did not converge. A key holds one copy by
|
|
1643
|
+
* construction, thus only a list can show a copy.
|
|
1426
1644
|
*/
|
|
1427
|
-
|
|
1428
|
-
readonly
|
|
1429
|
-
readonly
|
|
1430
|
-
|
|
1431
|
-
readonly
|
|
1432
|
-
readonly
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
readonly file: string;
|
|
1436
|
-
readonly at: string;
|
|
1645
|
+
interface Writes {
|
|
1646
|
+
readonly sent: number;
|
|
1647
|
+
readonly acked: number;
|
|
1648
|
+
readonly old: number;
|
|
1649
|
+
readonly lost: readonly number[] | null;
|
|
1650
|
+
readonly unknown: ReadonlyArray<{
|
|
1651
|
+
readonly n: number;
|
|
1652
|
+
readonly held: boolean | null;
|
|
1437
1653
|
}>;
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
readonly
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
/** These are the
|
|
1454
|
-
readonly
|
|
1654
|
+
readonly duplicates?: readonly number[] | null;
|
|
1655
|
+
/** These are the counts of a pair (`Cell.pair`), from its two final reads. */
|
|
1656
|
+
readonly sets?: PairSets;
|
|
1657
|
+
}
|
|
1658
|
+
/** These are the counts that the bands of `Outcomes` judge: each one has the same name there. */
|
|
1659
|
+
interface PairSets {
|
|
1660
|
+
readonly unknown: number;
|
|
1661
|
+
readonly kept: number;
|
|
1662
|
+
readonly stranded: number;
|
|
1663
|
+
readonly absent: number;
|
|
1664
|
+
readonly missing: number;
|
|
1665
|
+
readonly warnings: number;
|
|
1666
|
+
}
|
|
1667
|
+
/** A group measurement is what one run of a group cell measured, beside its time. */
|
|
1668
|
+
interface GroupMeasured {
|
|
1669
|
+
/** These are the member that was the primary at the start, and the member of the first accepted write after the fault. */
|
|
1670
|
+
readonly from: string;
|
|
1671
|
+
readonly to: string | null;
|
|
1672
|
+
/** These are the times of each stage from the fault: the first announcement by any Sentinel. A stage that no Sentinel announced is absent. */
|
|
1673
|
+
readonly stages: Partial<Record<Stage, Quantity>>;
|
|
1674
|
+
readonly writes: Writes;
|
|
1675
|
+
readonly errors: readonly ErrorOnTheWay[];
|
|
1676
|
+
/** These are the delays of the stamps of the observer after the writes of the Sentinels, for a calibration. */
|
|
1677
|
+
readonly lags?: readonly Quantity[];
|
|
1678
|
+
/** This is what a recovery drill measured, for a drill only. */
|
|
1679
|
+
readonly recovery?: RecoveryMeasured;
|
|
1455
1680
|
}
|
|
1681
|
+
/** This function gives the time of each stage of a timeline from an instant: the first announcement of each, after the instant. */
|
|
1682
|
+
export declare const stagesOf: (timeline: readonly SentinelEvent[], from: number) => Partial<Record<Stage, Quantity>>;
|
|
1683
|
+
/** These are the stages of the timeline of a replica set, in their usual sequence after a fault. */
|
|
1684
|
+
export declare const REPLICA_SET_STAGES: readonly ReplicaSetStage[];
|
|
1456
1685
|
/**
|
|
1457
|
-
*
|
|
1458
|
-
*
|
|
1459
|
-
*
|
|
1460
|
-
* Thus a changed program cannot operate as an old one.
|
|
1461
|
-
*
|
|
1462
|
-
* A build fails before it starts on a problem of its source. It also fails on a `FROM` that no
|
|
1463
|
-
* digest pins, and on a manifest of packages without a lockfile.
|
|
1686
|
+
* A member mark is how a log line of mongod marks a stage: by its id, or by its message. The
|
|
1687
|
+
* message is the fallback for a version whose ids differ. `at` tells where the line comes from:
|
|
1688
|
+
* the old primary, or another member.
|
|
1464
1689
|
*/
|
|
1465
|
-
|
|
1690
|
+
interface MemberMark {
|
|
1691
|
+
readonly ids: readonly number[];
|
|
1692
|
+
readonly message: RegExp;
|
|
1693
|
+
readonly at: "old" | "other";
|
|
1694
|
+
}
|
|
1695
|
+
/** These are the log lines of mongod that mark each stage of a member. */
|
|
1696
|
+
export declare const MEMBER_MARKS: Readonly<Record<Exclude<ReplicaSetStage, "discovered" | "written-off" | "first-write">, MemberMark>>;
|
|
1466
1697
|
/**
|
|
1467
|
-
* This function gives
|
|
1468
|
-
*
|
|
1469
|
-
* of
|
|
1698
|
+
* This function gives the time of each stage of a replica set from an instant, in a run. The stages
|
|
1699
|
+
* of the members come from their log lines (`ev` "mongod"), whose times the lab puts on the
|
|
1700
|
+
* monotonic clock. The stages of the client come from its lines:
|
|
1701
|
+
* - `discovered`: a member other than the old primary becomes RSPrimary in the view of the client.
|
|
1702
|
+
* - `written-off`: the first heartbeat of the client to the old primary that fails.
|
|
1703
|
+
* - `first-write`: the first write that a primary accepts, of a write that the client sent after
|
|
1704
|
+
* the commit of the fault (`sentAfter`). It is on a new primary when `lands` is `new`.
|
|
1470
1705
|
*/
|
|
1471
|
-
export declare const
|
|
1706
|
+
export declare const replicaSetStagesOf: (run: Run, from: number, sentAfter: number, lands: "new" | "same") => Partial<Record<Stage, Quantity>>;
|
|
1707
|
+
/** These are the stages of the timeline of a cluster of RabbitMQ, in their usual sequence after a fault. */
|
|
1708
|
+
export declare const CLUSTER_STAGES: readonly ClusterStage[];
|
|
1472
1709
|
/**
|
|
1473
|
-
*
|
|
1474
|
-
*
|
|
1710
|
+
* These are the log lines of RabbitMQ that mark each stage of a cluster, by their message (ra 3.1.10,
|
|
1711
|
+
* ra_server_proc.erl:871, :1336-1345 and :1974). `at` tells where the line comes from: the node of the
|
|
1712
|
+
* old leader, or another node.
|
|
1475
1713
|
*/
|
|
1476
|
-
export declare const
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
export declare const nodeClientImage: () => Promise<string>;
|
|
1481
|
-
/** This function gives the image of the router. */
|
|
1482
|
-
export declare const routerImage: () => Promise<string>;
|
|
1483
|
-
/** This function gives the image of the Go HTTP client. */
|
|
1484
|
-
export declare const goHttpImage: () => Promise<string>;
|
|
1485
|
-
/** This function gives the image of the Node HTTP clients. */
|
|
1486
|
-
export declare const nodeHttpImage: () => Promise<string>;
|
|
1487
|
-
/** This function gives the image of the MongoDB client. */
|
|
1488
|
-
export declare const mongoClientImage: () => Promise<string>;
|
|
1489
|
-
/** This function gives the image of the PostgreSQL client. */
|
|
1490
|
-
export declare const pgClientImage: () => Promise<string>;
|
|
1491
|
-
/** This function gives the image of the client of HikariCP over pgjdbc. */
|
|
1492
|
-
export declare const hikariClientImage: () => Promise<string>;
|
|
1493
|
-
/** This function gives the image of the RabbitMQ client: amqplib, with the client and the admin of a cluster cell. */
|
|
1494
|
-
export declare const amqpClientImage: () => Promise<string>;
|
|
1495
|
-
/** This function gives the image of the Kafka client: kafka-clients on Java, with the client and the admin of a Kafka cell. */
|
|
1496
|
-
export declare const kafkaClientImage: () => Promise<string>;
|
|
1497
|
-
/** This function gives the image of the gRPC client of the harness: grpc-js 1.14.6 on Node 24.21.0, with its client. */
|
|
1498
|
-
export declare const grpcClientImage: () => Promise<string>;
|
|
1714
|
+
export declare const NODE_MARKS: Readonly<Record<Exclude<ClusterStage, "first-write">, {
|
|
1715
|
+
readonly message: RegExp;
|
|
1716
|
+
readonly at: "old" | "other";
|
|
1717
|
+
}>>;
|
|
1499
1718
|
/**
|
|
1500
|
-
* This function gives the
|
|
1501
|
-
*
|
|
1719
|
+
* This function gives the time of each stage of a cluster from an instant, in a run. The stages of
|
|
1720
|
+
* the nodes come from their log lines (`ev` "rabbit"), whose times the lab puts on the monotonic
|
|
1721
|
+
* clock. `first-write` is the first confirm of a publish that the client sent after the commit of
|
|
1722
|
+
* the fault (`sentAfter`), through any node.
|
|
1502
1723
|
*/
|
|
1503
|
-
export declare const
|
|
1504
|
-
/** This function gives
|
|
1505
|
-
export declare const
|
|
1724
|
+
export declare const clusterStagesOf: (run: Run, from: number, sentAfter: number) => Partial<Record<Stage, Quantity>>;
|
|
1725
|
+
/** This function gives what became of each write of a run, from the lines of the client and the keys that the group kept. */
|
|
1726
|
+
export declare const writesOf: (run: Run, after: number, primary: string) => Writes;
|
|
1727
|
+
/** This function gives the errors that the client met after an instant: each kind, its first time, and its count. */
|
|
1728
|
+
export declare const errorsOf: (events: readonly ProbeEvent[], after: number) => ErrorOnTheWay[];
|
|
1506
1729
|
/**
|
|
1507
|
-
*
|
|
1508
|
-
*
|
|
1509
|
-
*
|
|
1510
|
-
* time.
|
|
1730
|
+
* This function gives the delay of each stamp of the observer after the write of its Sentinel that
|
|
1731
|
+
* the observer read. That write is the latest write of the Sentinel's socket toward the observer,
|
|
1732
|
+
* at the stamp or before it. The prober records each write (`tx`) on the clock of the stamps.
|
|
1511
1733
|
*/
|
|
1512
|
-
export declare const
|
|
1513
|
-
type
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
readonly
|
|
1521
|
-
|
|
1522
|
-
readonly
|
|
1523
|
-
|
|
1524
|
-
readonly
|
|
1525
|
-
|
|
1526
|
-
readonly kvm: boolean;
|
|
1527
|
-
/** This text is `$ImageOS $ImageVersion` of a hosted runner, or null elsewhere. */
|
|
1528
|
-
readonly image: string | null;
|
|
1734
|
+
export declare const lagsOf: (run: Run, kernel: readonly KernelRecord[]) => Quantity[];
|
|
1735
|
+
/** This type is the measurement of observe.ts, which a group run fills. */
|
|
1736
|
+
interface GroupReading {
|
|
1737
|
+
readonly outcome: {
|
|
1738
|
+
readonly kind: "answered";
|
|
1739
|
+
} | {
|
|
1740
|
+
readonly kind: "silent";
|
|
1741
|
+
};
|
|
1742
|
+
readonly elapsed: Quantity | null;
|
|
1743
|
+
readonly socket: Quantity | null;
|
|
1744
|
+
readonly noticed: Quantity | null;
|
|
1745
|
+
readonly void: string | null;
|
|
1746
|
+
readonly finding: string | null;
|
|
1747
|
+
readonly group: GroupMeasured;
|
|
1529
1748
|
}
|
|
1530
1749
|
/**
|
|
1531
|
-
*
|
|
1532
|
-
*
|
|
1533
|
-
*
|
|
1750
|
+
* This function reads one run of a group cell.
|
|
1751
|
+
* - The reference is the start of the commit of the fault, as the injector stamped it. For a
|
|
1752
|
+
* stall, it is the first write into the fault, as for the stall of a direct pair.
|
|
1753
|
+
* - The outcome is the first write that a primary accepted after the fault. The prediction says
|
|
1754
|
+
* which primary: a new one, or the same one after the lift. In a replica set, it is the first
|
|
1755
|
+
* accepted write of a write that the client sent after the commit of the fault.
|
|
1756
|
+
* - The stages come from the Sentinels, or from the logs of the members of a replica set and the
|
|
1757
|
+
* lines of its client (`replicaSetStagesOf`).
|
|
1758
|
+
* - Its time is the last segment with data that the client's socket to that primary received
|
|
1759
|
+
* before the client saw the acceptance. The stamp of the client is the fallback.
|
|
1760
|
+
* - A run is void when the prober lost records, or when the client did not become ready. It is
|
|
1761
|
+
* also void when a Sentinel entered its TILT mode, or when the election split its votes. A band
|
|
1762
|
+
* from the fault whose commit took longer than δ_abs is void too. So is a band whose hold lifted
|
|
1763
|
+
* more than δ_abs late.
|
|
1534
1764
|
*/
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
readonly
|
|
1540
|
-
|
|
1541
|
-
readonly
|
|
1542
|
-
|
|
1765
|
+
export declare const measureGroup: (cell: Cell, run: Run) => GroupReading;
|
|
1766
|
+
/** This record is what a run of a port cell measured. */
|
|
1767
|
+
interface PortsReading {
|
|
1768
|
+
/** This count is the rounds of the run, each destination once. */
|
|
1769
|
+
readonly rounds: number;
|
|
1770
|
+
/** This record gives the count of searches for each count of connects, by that count. */
|
|
1771
|
+
readonly counts: Readonly<Record<string, number>>;
|
|
1772
|
+
/** These offsets from the low port are the ports that the run used, in rising order. */
|
|
1773
|
+
readonly seen: readonly number[];
|
|
1774
|
+
/** These errnos ended the searches of the run, each one time. */
|
|
1775
|
+
readonly errnos: readonly string[];
|
|
1776
|
+
/** This time is the longest connect that failed. */
|
|
1777
|
+
readonly refusal: Quantity;
|
|
1778
|
+
/** This time is from the `closing` line to the first `freed` line. */
|
|
1779
|
+
readonly firstFreed: Quantity | null;
|
|
1780
|
+
/** This time is from the `closing` line to the last `freed` line. */
|
|
1781
|
+
readonly lastFreed: Quantity | null;
|
|
1782
|
+
/** This count is the `freed` lines of the run. */
|
|
1783
|
+
readonly freed: number;
|
|
1784
|
+
/** This count is the connects that failed before the last `freed` line. */
|
|
1785
|
+
readonly tries: number;
|
|
1543
1786
|
}
|
|
1544
|
-
/** GitHub announced Linux jobs on AWS on this date. Each earlier hosted job ran on Azure. */
|
|
1545
|
-
export declare const AWS_FROM = "2026-10-28";
|
|
1546
|
-
/** This function gives the cloud of a DMI vendor. A kernel name does not tell: one image can start on each cloud. */
|
|
1547
|
-
export declare const cloudOf: (vendor: string | null) => Cloud;
|
|
1548
|
-
/** This function reads the host. `root` and `env` are for tests. */
|
|
1549
|
-
export declare const readHost: (root?: string, env?: Readonly<Record<string, string | undefined>>, kernel?: string) => Host;
|
|
1550
|
-
/** This function gives the substrate of a layer on a host. */
|
|
1551
|
-
export declare const substrateOn: (layer: Layer, host?: Host) => Substrate;
|
|
1552
1787
|
/**
|
|
1553
|
-
* This function
|
|
1554
|
-
*
|
|
1555
|
-
*
|
|
1788
|
+
* This function reads one run of a port cell. The `round` lines give each search. The `closing` and
|
|
1789
|
+
* `freed` lines give when each held port comes back. The records of the prober give the
|
|
1790
|
+
* retransmissions.
|
|
1556
1791
|
*/
|
|
1557
|
-
export declare const
|
|
1558
|
-
/**
|
|
1559
|
-
interface
|
|
1560
|
-
|
|
1561
|
-
readonly
|
|
1562
|
-
/**
|
|
1563
|
-
readonly
|
|
1792
|
+
export declare const measurePorts: (run: Run, expected: PortsPrediction) => Measured;
|
|
1793
|
+
/** This record is what one connection of a queue cell did, from its lines and the records of its socket. */
|
|
1794
|
+
interface QueueConnectionReading {
|
|
1795
|
+
readonly name: string;
|
|
1796
|
+
readonly connected: boolean;
|
|
1797
|
+
/** These times are the waits of the SYN. The first one counts from the dial. */
|
|
1798
|
+
readonly syns: readonly Quantity[];
|
|
1799
|
+
/** These times are the waits of each SYN-ACK sent again. The first one counts from the dial. */
|
|
1800
|
+
readonly synAcks: readonly Quantity[];
|
|
1801
|
+
/** This count is the segments that the socket sent again. */
|
|
1802
|
+
readonly retransmissions: number;
|
|
1803
|
+
readonly errno: string | null;
|
|
1804
|
+
/** This time is from the line of the prediction to the end of the connection. It is null for a live connection, or with no prediction. */
|
|
1805
|
+
readonly ended: Quantity | null;
|
|
1806
|
+
/** This time is from the last retransmission to the end of the connection. */
|
|
1807
|
+
readonly afterLast: Quantity | null;
|
|
1808
|
+
/** This count is the segments of the socket with no acknowledgment at the end of the run. */
|
|
1809
|
+
readonly unacked: number | null;
|
|
1810
|
+
}
|
|
1811
|
+
/** This record is what a run of a queue cell measured. The counts are the changes in the run. */
|
|
1812
|
+
interface QueueReading {
|
|
1813
|
+
readonly max: number;
|
|
1814
|
+
readonly held: number;
|
|
1815
|
+
readonly connected: number;
|
|
1816
|
+
readonly overflows: number;
|
|
1817
|
+
readonly drops: number;
|
|
1818
|
+
readonly cookies: number;
|
|
1819
|
+
readonly timeouts: number;
|
|
1820
|
+
readonly resets: number;
|
|
1821
|
+
readonly drained: number;
|
|
1822
|
+
/** This time is from the first dial of the burst to the last `TCPTimeouts` of the prediction. */
|
|
1823
|
+
readonly expiry: Quantity | null;
|
|
1824
|
+
/** This time is from the first dial of the burst to the rise of the count of the queue. */
|
|
1825
|
+
readonly rise: Quantity | null;
|
|
1826
|
+
readonly connections: readonly QueueConnectionReading[];
|
|
1564
1827
|
}
|
|
1565
|
-
/** This function reads the CPU time of this machine, or gives null without `/proc/stat`. `root` is for tests. */
|
|
1566
|
-
export declare const readCpu: (root?: string) => CpuTime | null;
|
|
1567
1828
|
/**
|
|
1568
|
-
* This function
|
|
1569
|
-
*
|
|
1570
|
-
*
|
|
1829
|
+
* This function reads one run of a queue cell. The client lines give the connections and the
|
|
1830
|
+
* counters at the two ends of the run. The target lines give the count of the queue. The records of
|
|
1831
|
+
* the prober give the waits of each socket.
|
|
1571
1832
|
*/
|
|
1572
|
-
export declare const
|
|
1573
|
-
/**
|
|
1574
|
-
|
|
1575
|
-
readonly
|
|
1576
|
-
readonly
|
|
1577
|
-
readonly
|
|
1578
|
-
|
|
1833
|
+
export declare const measureQueue: (run: Run, expected: QueuePrediction) => Measured;
|
|
1834
|
+
/** This function gives the words of the outcome of a second request: its connection, a retry, and its end. */
|
|
1835
|
+
export declare const requestWords: (outcome: {
|
|
1836
|
+
readonly connection: "reused" | "new";
|
|
1837
|
+
readonly retried: boolean;
|
|
1838
|
+
readonly error: string | null;
|
|
1839
|
+
readonly pending?: boolean | undefined;
|
|
1840
|
+
}) => string;
|
|
1579
1841
|
/**
|
|
1580
|
-
* This
|
|
1581
|
-
*
|
|
1582
|
-
*
|
|
1842
|
+
* This amount is the noise of the pipeline itself, δ_abs, as the calibration measured it. It is
|
|
1843
|
+
* the 99.9th percentile of the whole latency of a reset, at the concurrency cap or less. Its
|
|
1844
|
+
* minimum is one jiffy. On 2026-10-12 the worst of 60 resets at 1 and 4 environments took
|
|
1845
|
+
* 1.141 ms, thus the minimum sets it to 4 ms. The calibration occurs again after each change to
|
|
1846
|
+
* the harness, the kernel or Docker.
|
|
1583
1847
|
*/
|
|
1584
|
-
export declare const
|
|
1848
|
+
export declare const NOISE: Quantity;
|
|
1585
1849
|
/**
|
|
1586
|
-
* This
|
|
1587
|
-
*
|
|
1588
|
-
*
|
|
1850
|
+
* This time is how late the injector can commit or lift a fault before the run is void. Stage 0
|
|
1851
|
+
* measures the commit apart from δ_abs, and the commit is longer. On a hosted runner it took up to
|
|
1852
|
+
* 2.75 ms at 4 environments, where δ_abs is 1 ms. Thus a cell's δ_abs does not change it.
|
|
1589
1853
|
*/
|
|
1590
|
-
export declare const
|
|
1591
|
-
/**
|
|
1592
|
-
|
|
1854
|
+
export declare const INJECT: Quantity;
|
|
1855
|
+
/** A time from the fault is one time of a run from the start of the commit of its fault. It has the edges of the band that judges it. */
|
|
1856
|
+
interface TimeFromFault {
|
|
1857
|
+
readonly at: Quantity;
|
|
1858
|
+
readonly low: Quantity;
|
|
1859
|
+
readonly high: Quantity;
|
|
1860
|
+
}
|
|
1593
1861
|
/**
|
|
1594
|
-
* This function gives the
|
|
1595
|
-
*
|
|
1596
|
-
*
|
|
1862
|
+
* This function gives the void of a run from the commit of its fault, or null (SYS-99). A fault
|
|
1863
|
+
* starts somewhere in its commit, thus each time from the start of the commit is too long by the
|
|
1864
|
+
* commit or less. A commit up to `INJECT` is in the noise. A longer commit voids the run only when
|
|
1865
|
+
* that shift can move a time across an edge of its band. Thus a drill with a band of minutes keeps
|
|
1866
|
+
* a run with a commit of 8 ms. `times` holds each time that a band judges, with the edges of the
|
|
1867
|
+
* verdict. A run with no time is void.
|
|
1597
1868
|
*/
|
|
1598
|
-
export declare const
|
|
1869
|
+
export declare const commitVoid: (commit: Quantity, times: readonly TimeFromFault[]) => string | null;
|
|
1870
|
+
/** This function gives the δ_abs of a cell: its own, or `NOISE` for a cell that gives none. */
|
|
1871
|
+
export declare const noiseOf: (cell: {
|
|
1872
|
+
readonly noise?: Quantity | undefined;
|
|
1873
|
+
}) => Quantity;
|
|
1599
1874
|
/**
|
|
1600
|
-
*
|
|
1601
|
-
*
|
|
1875
|
+
* A pairing is the window of a run in which a line of its program pairs with the kernel's record
|
|
1876
|
+
* of its act. `bound` is the jitter of the program that the run measured, or null. `delta` is the
|
|
1877
|
+
* window: δ_abs of the cell, or the bound when the bound is longer.
|
|
1602
1878
|
*/
|
|
1603
|
-
|
|
1879
|
+
interface Pairing {
|
|
1880
|
+
readonly bound: Quantity | null;
|
|
1881
|
+
readonly delta: Quantity;
|
|
1882
|
+
}
|
|
1604
1883
|
/**
|
|
1605
|
-
* This
|
|
1606
|
-
*
|
|
1607
|
-
*
|
|
1608
|
-
*
|
|
1884
|
+
* This function gives the pairing window of a run (SYS-25). On a runner of GitHub, the jitter of
|
|
1885
|
+
* a program can be longer than the δ_abs of 1 ms. Thus each run measures it before its fault
|
|
1886
|
+
* (`Run.jitter`), and its own measurement widens its window. A run without a jitter record is
|
|
1887
|
+
* from before SYS-25. It reads as a bound of null, thus its window is δ_abs. The decision of
|
|
1888
|
+
* 2026-10-19 keeps the rule of one miss: a pair that a window misses is still a finding.
|
|
1609
1889
|
*/
|
|
1610
|
-
export declare const
|
|
1890
|
+
export declare const pairingOf: (cell: {
|
|
1891
|
+
readonly noise?: Quantity | undefined;
|
|
1892
|
+
}, run: Pick<Run, "jitter">) => Pairing;
|
|
1611
1893
|
/**
|
|
1612
|
-
* This
|
|
1613
|
-
*
|
|
1614
|
-
*
|
|
1615
|
-
* listings and this slack. It is an assumption: in run 39116866471, two of 11 forgets came 1.6 ms
|
|
1616
|
-
* and 2.2 ms after the pump and two listings.
|
|
1894
|
+
* This function sums the pairings of the measurements of a cell. It gives the longest bound and
|
|
1895
|
+
* the longest window. It also counts the pairings whose window is longer than δ_abs (`noise`). It
|
|
1896
|
+
* is null when no measurement has a pairing.
|
|
1617
1897
|
*/
|
|
1618
|
-
export declare const
|
|
1898
|
+
export declare const pairingsOf: (runs: readonly Measured[], noise?: Quantity) => {
|
|
1899
|
+
readonly bound: Quantity | null;
|
|
1900
|
+
readonly delta: Quantity;
|
|
1901
|
+
readonly widened: number;
|
|
1902
|
+
} | null;
|
|
1619
1903
|
/**
|
|
1620
|
-
*
|
|
1621
|
-
*
|
|
1622
|
-
*
|
|
1623
|
-
*
|
|
1904
|
+
* This function tells if a timer firing came late enough to void a run. A firing two jiffies or
|
|
1905
|
+
* more behind its wheel slot came late because the host stopped a vCPU. With the HZ of the run,
|
|
1906
|
+
* the rule is in time: the delay must also reach δ_abs, because each band already includes that
|
|
1907
|
+
* noise. At HZ 250 two jiffies are 8 ms, more than a δ_abs of 4 ms. At HZ 1000 they are 2 ms.
|
|
1624
1908
|
*/
|
|
1625
|
-
|
|
1626
|
-
/**
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
readonly code?: "host" | "net" | "port" | "admin";
|
|
1631
|
-
/** This length is the longest segment in bytes that an MTU drop lets through. */
|
|
1632
|
-
readonly above?: number;
|
|
1633
|
-
/** These are the addresses that the rule faces, in place of the peer of its place. */
|
|
1634
|
-
readonly peers?: readonly string[];
|
|
1635
|
-
}
|
|
1909
|
+
export declare const delayVoids: (behind: number, hz: number | undefined, noise: Quantity) => boolean;
|
|
1910
|
+
/** This fraction, δ_rel, is how far the median of a cell can be outside the prediction and stay equivalent. */
|
|
1911
|
+
export declare const RELATIVE = .05;
|
|
1912
|
+
/** These are the run counts of a cell: 11, then 22 and 44 while its median crosses the edge of the band. */
|
|
1913
|
+
export declare const STEPS: readonly [11, 22, 44];
|
|
1636
1914
|
/**
|
|
1637
|
-
* A
|
|
1638
|
-
*
|
|
1639
|
-
* is the namespace of the client (its privileged admin). Rules in the namespace of the observer
|
|
1640
|
-
* make its sends fail locally, with EPERM, and the network does not lose them. Thus its
|
|
1641
|
-
* retransmissions do not go out. The retransmission tracepoint of the kernel then records none,
|
|
1642
|
-
* because it fires only for a retransmission that went out.
|
|
1915
|
+
* A decision is the result of a verdict. A cell whose outcome is a distribution has no band, and
|
|
1916
|
+
* its decision is `measured`: a record, not a test.
|
|
1643
1917
|
*/
|
|
1644
|
-
type
|
|
1645
|
-
/**
|
|
1646
|
-
interface
|
|
1647
|
-
readonly
|
|
1648
|
-
readonly
|
|
1649
|
-
readonly image: string;
|
|
1650
|
-
readonly id: string;
|
|
1651
|
-
/** These are the settings of the hop: the form and the idle timeout of a router, the files and settings of a proxy. */
|
|
1652
|
-
readonly settings: Readonly<Record<string, string>>;
|
|
1653
|
-
/** These are the sysctls of the namespace of the hop, as read back after the harness set them. */
|
|
1654
|
-
readonly sysctls: Readonly<Record<string, string>>;
|
|
1655
|
-
}
|
|
1656
|
-
/** This record is one sysctl of the host for one environment, as the harness read it. */
|
|
1657
|
-
interface HostSetting {
|
|
1658
|
-
readonly name: string;
|
|
1659
|
-
readonly before: string;
|
|
1660
|
-
readonly set: string;
|
|
1661
|
-
/** This value is the read after the restore. It is null until the restore. */
|
|
1662
|
-
readonly restored: string | null;
|
|
1918
|
+
type Decision = "holds" | "fails" | "extend" | "inconclusive" | "measured";
|
|
1919
|
+
/** An interval is a range of times. */
|
|
1920
|
+
interface Interval {
|
|
1921
|
+
readonly low: Quantity;
|
|
1922
|
+
readonly high: Quantity;
|
|
1663
1923
|
}
|
|
1664
|
-
/** A
|
|
1665
|
-
interface
|
|
1666
|
-
readonly
|
|
1667
|
-
|
|
1668
|
-
readonly
|
|
1669
|
-
readonly
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
readonly
|
|
1675
|
-
readonly
|
|
1676
|
-
readonly
|
|
1677
|
-
/** This
|
|
1678
|
-
readonly
|
|
1679
|
-
/**
|
|
1680
|
-
readonly
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1924
|
+
/** A spread is the distribution of a set of times: its count, its median and its upper quantiles by nearest rank. */
|
|
1925
|
+
interface Spread {
|
|
1926
|
+
readonly count: number;
|
|
1927
|
+
readonly median: Quantity;
|
|
1928
|
+
readonly p99: Quantity;
|
|
1929
|
+
readonly p999: Quantity;
|
|
1930
|
+
readonly max: Quantity;
|
|
1931
|
+
}
|
|
1932
|
+
/** A verdict is the judgement of a cell on its runs. */
|
|
1933
|
+
interface Verdict {
|
|
1934
|
+
readonly decision: Decision;
|
|
1935
|
+
readonly counted: number;
|
|
1936
|
+
readonly voided: number;
|
|
1937
|
+
/** This band is where each run must land: [T_lo − δ_abs, T_hi + δ_abs]. It is null for a silent prediction. */
|
|
1938
|
+
readonly band: Interval | null;
|
|
1939
|
+
/** These are the runs outside the band, and the reason for each. Each is a finding. */
|
|
1940
|
+
readonly outside: ReadonlyArray<{
|
|
1941
|
+
readonly run: string;
|
|
1942
|
+
readonly why: string;
|
|
1943
|
+
}>;
|
|
1944
|
+
readonly median: Quantity | null;
|
|
1945
|
+
/** This interval is the order-statistic interval of the median at 95 %, or the whole range for fewer than six runs. */
|
|
1946
|
+
readonly medianInterval: Interval | null;
|
|
1947
|
+
/** This time is the slowest reply of a cell that measures a distribution. A closed loop hides the sends in a stall, thus a quantile is a lower bound, and this maximum is not. */
|
|
1948
|
+
readonly slowest?: Quantity;
|
|
1949
|
+
/** This record is the sum of what reordering did in each counted run of a measurement-only cell. */
|
|
1950
|
+
readonly reordering?: Reordering;
|
|
1951
|
+
/** This record is the load of an open-loop cell over its counted runs. */
|
|
1952
|
+
readonly load?: LoadVerdict;
|
|
1953
|
+
/** This record is the estimate of the open loop of a closed-loop stream over its counted runs (SYS-91). */
|
|
1954
|
+
readonly estimate?: EstimateVerdict;
|
|
1955
|
+
/** This record is the time of the proxy of a calibration cell, in each direction. */
|
|
1956
|
+
readonly proxy?: {
|
|
1957
|
+
readonly hop: string;
|
|
1958
|
+
readonly up: Spread | null;
|
|
1959
|
+
readonly down: Spread | null;
|
|
1697
1960
|
};
|
|
1961
|
+
/** This record is what the group of a group cell did over the counted runs: its stages, and its writes. */
|
|
1962
|
+
readonly group?: GroupVerdict;
|
|
1698
1963
|
/**
|
|
1699
|
-
*
|
|
1700
|
-
*
|
|
1701
|
-
*
|
|
1964
|
+
* These are the outcomes of the second request of an HTTP client over the counted runs, each
|
|
1965
|
+
* with its count: for example "reused, a retry, a reply". An outcome other than the predicted
|
|
1966
|
+
* one is a finding of its run.
|
|
1702
1967
|
*/
|
|
1703
|
-
readonly
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
readonly build?: BuildRecord;
|
|
1709
|
-
};
|
|
1968
|
+
readonly requests?: Readonly<Record<string, number>>;
|
|
1969
|
+
/** This record is what the client did after the detection over the counted runs, for a prediction that says when it reconnects. */
|
|
1970
|
+
readonly reconnect?: ReconnectVerdict;
|
|
1971
|
+
/** These are the outcomes of the call in flight of a WebSocket client over the counted runs, each with its count. */
|
|
1972
|
+
readonly calls?: Readonly<Record<string, number>>;
|
|
1710
1973
|
/**
|
|
1711
|
-
* This record is the
|
|
1712
|
-
* the
|
|
1974
|
+
* This record is the time from a drop of the program to the close of its socket by its own side,
|
|
1975
|
+
* over the counted runs. It also counts the runs where the socket did not close itself.
|
|
1976
|
+
* `exited` is the spread of the end of the client process, for the runs where the socket stayed
|
|
1977
|
+
* open until that end (`Measured.exited`).
|
|
1713
1978
|
*/
|
|
1714
|
-
readonly
|
|
1715
|
-
readonly
|
|
1716
|
-
readonly
|
|
1717
|
-
readonly
|
|
1718
|
-
readonly source?: ImageSource;
|
|
1719
|
-
readonly build?: BuildRecord;
|
|
1720
|
-
};
|
|
1721
|
-
/** These are the namespaces that the prober watched, by inode. */
|
|
1722
|
-
readonly netns: {
|
|
1723
|
-
readonly client: number;
|
|
1724
|
-
readonly target: number;
|
|
1725
|
-
readonly hops?: Readonly<Record<string, number>>;
|
|
1726
|
-
};
|
|
1727
|
-
/** These are the sysctls of the client namespace, as read back after the harness set them. */
|
|
1728
|
-
readonly sysctls: Readonly<Record<string, string>>;
|
|
1729
|
-
/** These are the sysctls of the host that the cell set: each value before, as set, and as restored. */
|
|
1730
|
-
readonly host?: readonly HostSetting[];
|
|
1731
|
-
/** These are the hops of a topology, in sequence from the client. */
|
|
1732
|
-
readonly hops?: readonly ManifestHop[];
|
|
1733
|
-
/** These are the parts of a group, with their settings as each part read them back. */
|
|
1734
|
-
readonly group?: {
|
|
1735
|
-
readonly members: ReadonlyArray<{
|
|
1736
|
-
readonly name: string;
|
|
1737
|
-
readonly ip: string;
|
|
1738
|
-
readonly id: string;
|
|
1739
|
-
readonly settings: Readonly<Record<string, string>>;
|
|
1740
|
-
}>;
|
|
1741
|
-
readonly sentinels: ReadonlyArray<{
|
|
1742
|
-
readonly name: string;
|
|
1743
|
-
readonly ip: string;
|
|
1744
|
-
readonly id: string;
|
|
1745
|
-
readonly settings: Readonly<Record<string, string>>;
|
|
1746
|
-
}>;
|
|
1747
|
-
readonly observer: {
|
|
1748
|
-
readonly image: string;
|
|
1749
|
-
};
|
|
1979
|
+
readonly left?: {
|
|
1980
|
+
readonly spread: Spread | null;
|
|
1981
|
+
readonly stayed: number;
|
|
1982
|
+
readonly exited?: Spread | null;
|
|
1750
1983
|
};
|
|
1984
|
+
readonly why: string;
|
|
1751
1985
|
}
|
|
1752
|
-
/**
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1986
|
+
/**
|
|
1987
|
+
* A reconnect verdict sums the reconnect of the client over the counted runs. Each wait before a
|
|
1988
|
+
* try gets its spread. A wait outside its band is a finding of its run, thus it is in `outside`.
|
|
1989
|
+
* - `syn` is the time from the detection to the first SYN of a new socket.
|
|
1990
|
+
* - `established` is the time from the detection to the first new socket that became ESTABLISHED.
|
|
1991
|
+
* - `connect` is the time from a `dial` line to the SYN of its socket: the work of the program.
|
|
1992
|
+
*/
|
|
1993
|
+
interface ReconnectVerdict {
|
|
1994
|
+
readonly waits: ReadonlyArray<Spread | null>;
|
|
1995
|
+
readonly syn: Spread | null;
|
|
1996
|
+
readonly established: Spread | null;
|
|
1997
|
+
readonly connect: Spread | null;
|
|
1762
1998
|
}
|
|
1763
|
-
/**
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1999
|
+
/**
|
|
2000
|
+
* A stage verdict is the test of one stage of the timeline of a group against its band. The band
|
|
2001
|
+
* is [T_lo − δ_abs, T_hi + the error of the stamps + δ_abs]. A run that did not announce the stage
|
|
2002
|
+
* is outside too.
|
|
2003
|
+
*/
|
|
2004
|
+
interface StageVerdict {
|
|
2005
|
+
readonly stage: Stage;
|
|
2006
|
+
readonly band: Interval;
|
|
2007
|
+
readonly median: Quantity | null;
|
|
2008
|
+
readonly outside: ReadonlyArray<{
|
|
2009
|
+
readonly run: string;
|
|
2010
|
+
readonly why: string;
|
|
2011
|
+
}>;
|
|
2012
|
+
readonly decision: "holds" | "fails";
|
|
1776
2013
|
}
|
|
1777
|
-
/**
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
2014
|
+
/**
|
|
2015
|
+
* A group verdict sums what the group of a group cell did in its counted runs:
|
|
2016
|
+
* - `stages` tests each stage that the prediction gives a band.
|
|
2017
|
+
* - `medians` is the median of each stage that a run announced, from the fault.
|
|
2018
|
+
* - `lost` counts the writes that a primary accepted and the group did not keep, in each run.
|
|
2019
|
+
* - `old` counts the writes that the old primary accepted after the fault, in each run.
|
|
2020
|
+
* - `unknown` counts the writes whose outcome the client did not see, and how many the group kept.
|
|
2021
|
+
* - `errors` are the errors on the way: the runs that met each, and the median of its first time.
|
|
2022
|
+
* - `lags` is the spread of the delays of the stamps, for a calibration.
|
|
2023
|
+
* - `duplicates` counts the extra copies that the group holds, in each run. A cell with no band of
|
|
2024
|
+
* copies has no such count.
|
|
2025
|
+
*/
|
|
2026
|
+
interface GroupVerdict {
|
|
2027
|
+
readonly stages: readonly StageVerdict[];
|
|
2028
|
+
readonly medians: Partial<Record<Stage, Quantity>>;
|
|
2029
|
+
readonly lost: {
|
|
2030
|
+
readonly runs: number;
|
|
2031
|
+
readonly total: number;
|
|
2032
|
+
readonly median: number | null;
|
|
2033
|
+
readonly max: number | null;
|
|
2034
|
+
};
|
|
2035
|
+
readonly old: {
|
|
2036
|
+
readonly median: number | null;
|
|
2037
|
+
readonly max: number | null;
|
|
2038
|
+
};
|
|
2039
|
+
readonly unknown: {
|
|
2040
|
+
readonly total: number;
|
|
2041
|
+
readonly held: number;
|
|
2042
|
+
};
|
|
2043
|
+
readonly errors: ReadonlyArray<{
|
|
2044
|
+
readonly name: string;
|
|
2045
|
+
readonly runs: number;
|
|
2046
|
+
readonly first: Quantity;
|
|
1782
2047
|
}>;
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
2048
|
+
readonly lags?: Spread | null;
|
|
2049
|
+
readonly duplicates?: {
|
|
2050
|
+
readonly runs: number;
|
|
2051
|
+
readonly total: number;
|
|
2052
|
+
readonly median: number | null;
|
|
2053
|
+
readonly max: number | null;
|
|
2054
|
+
};
|
|
1786
2055
|
}
|
|
1787
|
-
/**
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
2056
|
+
/**
|
|
2057
|
+
* This function gives the value at quantile p of sorted values, by nearest rank: x_(⌈p·n⌉). It is
|
|
2058
|
+
* `quantileSorted` of @mark1russell7/rigor-statistics with the method `"nearest-rank"`.
|
|
2059
|
+
*/
|
|
2060
|
+
export declare const quantileOf: (sorted: readonly number[], p: number) => number;
|
|
2061
|
+
/** This function gives the spread of a set of times, or null for none. */
|
|
2062
|
+
export declare const spreadOf: (times: readonly Quantity[]) => Spread | null;
|
|
2063
|
+
/**
|
|
2064
|
+
* This function gives the distribution-free interval of a median: [x_(k), x_(n+1−k)], for the
|
|
2065
|
+
* largest k whose two tails each hold 2.5 % or less. For eleven runs, it gives [x_(2), x_(10)],
|
|
2066
|
+
* at 98.8 %. It is `medianInterval` of @mark1russell7/rigor-statistics at the level 0.95. An
|
|
2067
|
+
* empty list throws a RangeError.
|
|
2068
|
+
*/
|
|
2069
|
+
export declare const medianInterval: (sorted: readonly number[]) => [number, number];
|
|
2070
|
+
/**
|
|
2071
|
+
* This function gives the verdict of a cell, from two tests:
|
|
2072
|
+
* - Containment: each run lands in [T_lo − δ_abs, T_hi + δ_abs]. A run outside is a finding.
|
|
2073
|
+
* - Median equivalence: the interval of the median is in the band, made wider by δ_rel. An
|
|
2074
|
+
* interval outside the band fails. An interval across its edge extends the cell to 22 runs, then
|
|
2075
|
+
* 44, and then the verdict is inconclusive.
|
|
2076
|
+
*
|
|
2077
|
+
* A silent prediction holds only if no run detected the fault in its window. After a stall, the
|
|
2078
|
+
* return of the reply gets the same test as a detection, by its interval, and a detection is a
|
|
2079
|
+
* finding. The distribution test (a DKW band) needs a predicted distribution from a simulator,
|
|
2080
|
+
* which does not exist at this time.
|
|
2081
|
+
*/
|
|
2082
|
+
export declare const verdictOf: (prediction: Prediction, runs: readonly Measured[], noise?: Quantity) => Verdict;
|
|
2083
|
+
/** This function sums what the group of a group cell did in its counted runs, and tests each stage that has a band. */
|
|
2084
|
+
export declare const groupVerdictOf: (prediction: Prediction, counted: readonly Measured[], delta?: Quantity) => GroupVerdict;
|
|
2085
|
+
/**
|
|
2086
|
+
* An outcome tells how the wait of a run ended. The socket failed with an errno, or it read the
|
|
2087
|
+
* end of the file. Or nothing came, or the reply came back after a stall. The observer can also
|
|
2088
|
+
* close the connection itself (`closed`), or its program can drop it on its own timer (`dropped`).
|
|
2089
|
+
*/
|
|
2090
|
+
type Outcome = {
|
|
2091
|
+
readonly kind: "error";
|
|
2092
|
+
readonly errno: string;
|
|
2093
|
+
} | {
|
|
2094
|
+
readonly kind: "eof";
|
|
2095
|
+
} | {
|
|
2096
|
+
readonly kind: "silent";
|
|
2097
|
+
} | {
|
|
2098
|
+
readonly kind: "answered";
|
|
2099
|
+
} | {
|
|
2100
|
+
readonly kind: "closed";
|
|
2101
|
+
} | {
|
|
2102
|
+
readonly kind: "dropped";
|
|
2103
|
+
};
|
|
2104
|
+
/**
|
|
2105
|
+
* A request reading is what the second request of an HTTP client met, from the lines of the
|
|
2106
|
+
* client. It holds the connection of its first try, a new try, and its outcome. `gap` is the time
|
|
2107
|
+
* from the end of the first reply to the send of the second request.
|
|
2108
|
+
*/
|
|
2109
|
+
interface RequestReading {
|
|
2110
|
+
readonly connection: "reused" | "new";
|
|
2111
|
+
readonly retried: boolean;
|
|
2112
|
+
readonly error: string | null;
|
|
2113
|
+
readonly pending: boolean;
|
|
2114
|
+
readonly gap: Quantity | null;
|
|
1793
2115
|
}
|
|
1794
|
-
/** A
|
|
1795
|
-
interface
|
|
1796
|
-
|
|
1797
|
-
readonly
|
|
1798
|
-
|
|
1799
|
-
readonly targetIp: string;
|
|
1800
|
-
/** This port is the port that the client connects to. */
|
|
1801
|
-
readonly targetPort: number;
|
|
1802
|
-
readonly clientIp: string;
|
|
1803
|
-
readonly netns: {
|
|
1804
|
-
readonly client: number;
|
|
1805
|
-
readonly target: number;
|
|
1806
|
-
readonly hops?: Readonly<Record<string, number>>;
|
|
1807
|
-
};
|
|
1808
|
-
/** This record is where each socket of a topology is, or null for a direct pair. */
|
|
1809
|
-
readonly topology: RunTopology | null;
|
|
1810
|
-
/** These are the lines of the routers of a topology, in sequence, each with the name of its hop. A direct pair has none. */
|
|
1811
|
-
readonly middlebox: readonly MiddleboxEvent[];
|
|
1812
|
-
/** These are the lines of a target that writes them (`Target.lines`), in sequence. Another target has none. */
|
|
1813
|
-
readonly server: readonly ProbeEvent[];
|
|
1814
|
-
/** This method adds a toxic to the Toxiproxy hop of a topology, or removes it with null. The stamps of the injector bracket it. */
|
|
1815
|
-
toxic(toxic: Toxic | null): Promise<{
|
|
1816
|
-
t0: number;
|
|
1817
|
-
t1: number;
|
|
1818
|
-
}>;
|
|
1819
|
-
/** This method makes the target close the connection of each client, with the command of the target. */
|
|
1820
|
-
serverClose(): Promise<void>;
|
|
1821
|
-
/**
|
|
1822
|
-
* This method starts an agent in the network namespace of the target, and in its process
|
|
1823
|
-
* namespace with `pid`. Its command keeps it up, for example `sleep infinity`.
|
|
1824
|
-
*/
|
|
1825
|
-
agent(image: string, command: readonly string[], options?: {
|
|
1826
|
-
readonly pid?: boolean;
|
|
1827
|
-
}): Promise<Agent>;
|
|
1828
|
-
/** This method starts a sibling, and waits for a line of its log. */
|
|
1829
|
-
sibling(image: string, command: readonly string[], ready: string): Promise<Sibling>;
|
|
1830
|
-
/** This method starts a command in the target, and gives its standard output. */
|
|
1831
|
-
exec(argv: readonly string[]): Promise<string>;
|
|
1832
|
-
/** These are all the records that the prober wrote, in sequence. */
|
|
1833
|
-
readonly kernel: readonly KernelRecord[];
|
|
1834
|
-
/** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
|
|
1835
|
-
sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
|
|
1836
|
-
/** This method sets the settings of the target in it before a client connects, and reads them back. */
|
|
1837
|
-
configure(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
|
|
1838
|
-
/** This method sets the sysctls of the target namespace through a privileged sidecar there, and reads them back. */
|
|
1839
|
-
targetSysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
|
|
1840
|
-
/** This method runs each command in the namespace of the client and in the namespace of the target. */
|
|
1841
|
-
namespaceSetup(commands: readonly (readonly string[])[]): Promise<void>;
|
|
1842
|
-
/** This method sets sysctls of the host through a privileged sidecar on the network of the host, and reads them back. */
|
|
1843
|
-
hostSysctl(settings: readonly HostSysctl[]): Promise<void>;
|
|
1844
|
-
/** This method puts back each value that `hostSysctl` changed, once, and gives the record of each. Closing the lab also does it. */
|
|
1845
|
-
restoreHost(): Promise<readonly HostSetting[]>;
|
|
1846
|
-
/**
|
|
1847
|
-
* This method applies a fault between the client and the target, by default from the namespace
|
|
1848
|
-
* of the target. The fault is a black hole, or a reset that answers the next segment of the
|
|
1849
|
-
* client. At a proxy of a topology, the rules face the peer of the proxy on one side. The stamps
|
|
1850
|
-
* of the injector bracket it.
|
|
1851
|
-
*/
|
|
1852
|
-
fault(kind: NetworkFault, at?: FaultPlace, options?: FaultOptions): Promise<{
|
|
1853
|
-
t0: number;
|
|
1854
|
-
t1: number;
|
|
1855
|
-
}>;
|
|
1856
|
-
/** This method removes a fault. */
|
|
1857
|
-
lift(kind: NetworkFault, at?: FaultPlace, options?: FaultOptions): Promise<void>;
|
|
2116
|
+
/** A measurement is what one run measured, against the prediction of its cell. */
|
|
2117
|
+
interface Measured {
|
|
2118
|
+
readonly environment: number;
|
|
2119
|
+
readonly index: number;
|
|
2120
|
+
readonly outcome: Outcome;
|
|
1858
2121
|
/**
|
|
1859
|
-
* This
|
|
1860
|
-
*
|
|
1861
|
-
* The stamps of the injector bracket it.
|
|
2122
|
+
* This time is from the reference event of the prediction to the detection, both as the kernel
|
|
2123
|
+
* stamped them in the records of the prober. It is null when nothing detected the fault.
|
|
1862
2124
|
*/
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
2125
|
+
readonly elapsed: Quantity | null;
|
|
2126
|
+
/** This time is the same interval from the TCP_INFO samples of the client, the second vantage. */
|
|
2127
|
+
readonly socket: Quantity | null;
|
|
2128
|
+
/** This time is how long the client took to see the error after the kernel reported it. */
|
|
2129
|
+
readonly noticed: Quantity | null;
|
|
1867
2130
|
/**
|
|
1868
|
-
*
|
|
1869
|
-
*
|
|
2131
|
+
* These are the steps of the kernel after the reference: each keepalive probe, or each firing of
|
|
2132
|
+
* the RTO timer. After a stall, they are each retransmission from the send, the loss probe first.
|
|
1870
2133
|
*/
|
|
1871
|
-
|
|
1872
|
-
/** This method stops the server process in the target with SIGKILL, with the command of the target. */
|
|
1873
|
-
kill(): Promise<void>;
|
|
2134
|
+
readonly steps: readonly Quantity[];
|
|
1874
2135
|
/**
|
|
1875
|
-
*
|
|
1876
|
-
*
|
|
1877
|
-
* delay, that wait is one more delayed round, and its round trip and RTO are longer.
|
|
2136
|
+
* These are the reply times of a measurement-only cell. For each request after the first, a
|
|
2137
|
+
* sample is the time from its send to the first data after it.
|
|
1878
2138
|
*/
|
|
1879
|
-
|
|
1880
|
-
/** This
|
|
1881
|
-
|
|
2139
|
+
readonly samples?: readonly Quantity[];
|
|
2140
|
+
/** This measure is the run of an open-loop cell against its schedule (`Run.schedule`), with its failed replies. Its times are in ms. */
|
|
2141
|
+
readonly load?: RunLoad;
|
|
2142
|
+
/** This estimate is the open loop that a closed-loop stream of the client of the harness hid (SYS-91). Its times are in ms. */
|
|
2143
|
+
readonly estimate?: RunEstimate;
|
|
2144
|
+
/** This count is the number of keepalive probes that the kernel sent. */
|
|
2145
|
+
readonly probes: number;
|
|
2146
|
+
/** This count is the number of segments that the kernel sent again. */
|
|
2147
|
+
readonly retransmissions: number;
|
|
2148
|
+
/** This count is the number of segments that the socket received after the request. */
|
|
2149
|
+
readonly acks: number;
|
|
2150
|
+
/** This count is the number of bytes that the client read after the request. */
|
|
2151
|
+
readonly bytes?: number;
|
|
1882
2152
|
/**
|
|
1883
|
-
* This
|
|
1884
|
-
*
|
|
1885
|
-
* a docker exec. Stamps bracket it, as for a fault.
|
|
2153
|
+
* This time is when a router of the topology forgot the flow of the client. It counts from the
|
|
2154
|
+
* last segment that the client received before the fault. It is null when no router forgot the flow.
|
|
1886
2155
|
*/
|
|
1887
|
-
|
|
1888
|
-
t0: number;
|
|
1889
|
-
t1: number;
|
|
1890
|
-
}>;
|
|
2156
|
+
readonly forgot?: Quantity | null;
|
|
1891
2157
|
/**
|
|
1892
|
-
* This
|
|
1893
|
-
*
|
|
1894
|
-
* first round trip of the next connection, and thus its RTO. A run with these metrics is not
|
|
1895
|
-
* independent of the run before it.
|
|
2158
|
+
* This time is the first round trip of the socket of the observer. It is the smoothed round trip
|
|
2159
|
+
* in its first record, which is the sample of the handshake. It is null when no record has it.
|
|
1896
2160
|
*/
|
|
1897
|
-
|
|
1898
|
-
/** This
|
|
1899
|
-
readonly
|
|
1900
|
-
/**
|
|
1901
|
-
|
|
1902
|
-
|
|
2161
|
+
readonly rtt?: Quantity | null;
|
|
2162
|
+
/** This record tells what reordering did in a run of a measurement-only cell, from the records of its two ends. */
|
|
2163
|
+
readonly reordering?: Reordering;
|
|
2164
|
+
/** These are the times of the proxy of a calibration cell, one for each request and its reply. */
|
|
2165
|
+
readonly crossings?: Crossings;
|
|
2166
|
+
/** This record is what a run of a group cell measured: the stages of its timeline, and what became of each write. */
|
|
2167
|
+
readonly group?: GroupMeasured;
|
|
2168
|
+
/** This record is what a run of a queue cell measured: the count of the queue, its counters, and each connection. */
|
|
2169
|
+
readonly queue?: QueueReading;
|
|
2170
|
+
/** This record is what a run of a port cell measured: the count of each search, and when each port came back. */
|
|
2171
|
+
readonly ports?: PortsReading;
|
|
2172
|
+
/** This record is what a run of a conntrack cell measured: the flows, the count, and when a slot came back. */
|
|
2173
|
+
readonly conntrack?: ConntrackReading;
|
|
2174
|
+
/** This record is what the second request of an HTTP client met, for a cell whose prediction says it. */
|
|
2175
|
+
readonly request?: RequestReading | null;
|
|
2176
|
+
/** This record is the time of each later band of a driver cell (`DriverBand.then`). */
|
|
2177
|
+
readonly driver?: {
|
|
2178
|
+
readonly steps: readonly DriverStepTime[];
|
|
2179
|
+
};
|
|
2180
|
+
/** This record is what the client did after the detection, for a prediction that says when it reconnects. */
|
|
2181
|
+
readonly reconnect?: ReconnectReading;
|
|
2182
|
+
/** This record is what the call in flight of a WebSocket client met. */
|
|
2183
|
+
readonly call?: CallReading;
|
|
2184
|
+
/** This record is what a stream that crossed the fault delivered, for a prediction with a delivery law. */
|
|
2185
|
+
readonly delivery?: DeliveryReading;
|
|
1903
2186
|
/**
|
|
1904
|
-
* This
|
|
1905
|
-
*
|
|
1906
|
-
*
|
|
2187
|
+
* This time is from the drop line of the program to the close of its socket by its own side: a
|
|
2188
|
+
* FIN or an abort. A prediction that says how the program drops (`drop`) gets it. It is null
|
|
2189
|
+
* when the socket did not close itself in the run. A prediction can say that the client process
|
|
2190
|
+
* ends with the run (`exits`). Then a close at that end is no close by the program, and `left` is null.
|
|
1907
2191
|
*/
|
|
1908
|
-
|
|
1909
|
-
t0: number;
|
|
1910
|
-
t1: number;
|
|
1911
|
-
}>;
|
|
2192
|
+
readonly left?: Quantity | null;
|
|
1912
2193
|
/**
|
|
1913
|
-
* This
|
|
1914
|
-
*
|
|
1915
|
-
* first signal of the hop. A query goes from the injector of the hop to its console on 127.0.0.1. The
|
|
1916
|
-
* injector stamps each one. An event with no undo gives null for its undo. A signal can wait for an
|
|
1917
|
-
* instant on CLOCK_MONOTONIC (`at`), as the thaw at the end of a hold does.
|
|
2194
|
+
* This time is from the drop line of the program to the end of the client process. A socket gets
|
|
2195
|
+
* it when it stayed open until that end. The kernel closed it then, not the program (`exits`).
|
|
1918
2196
|
*/
|
|
1919
|
-
|
|
1920
|
-
t0: number;
|
|
1921
|
-
t1: number;
|
|
1922
|
-
} | null>;
|
|
1923
|
-
/** This method starts the client with `args`. Each file is in its container before it starts. */
|
|
1924
|
-
probe(args: readonly string[], files?: ReadonlyArray<{
|
|
1925
|
-
readonly content: string;
|
|
1926
|
-
readonly target: string;
|
|
1927
|
-
}>): Promise<Probe>;
|
|
2197
|
+
readonly exited?: Quantity;
|
|
1928
2198
|
/**
|
|
1929
|
-
* This
|
|
1930
|
-
*
|
|
2199
|
+
* This record is the pairing window of the run: the jitter bound that it measured, and the
|
|
2200
|
+
* window that its pairings used (`pairingOf`). A run that has a jitter record gets it. Thus a
|
|
2201
|
+
* reader can check each pairing of the run again.
|
|
1931
2202
|
*/
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
2203
|
+
readonly pairing?: Pairing;
|
|
2204
|
+
/** This record is what a run of a paused consumer measured. */
|
|
2205
|
+
readonly pause?: PauseReading;
|
|
2206
|
+
/** This text is the reason that the run cannot count, or null. A void run is not a pass and not a finding. */
|
|
2207
|
+
readonly void: string | null;
|
|
2208
|
+
/** This text tells what in the run disagrees with the prediction, other than its timing, or null. */
|
|
2209
|
+
readonly finding: string | null;
|
|
1935
2210
|
}
|
|
1936
2211
|
/**
|
|
1937
|
-
*
|
|
1938
|
-
*
|
|
2212
|
+
* A reordering record is what reordering, duplicates and losses did to the data of a run. The
|
|
2213
|
+
* receiver is the client, and the sender is the socket of its peer.
|
|
2214
|
+
* - `outOfOrder` counts the arrivals at the client beyond a hole, and `duplicates` counts the
|
|
2215
|
+
* arrivals whose data the client had. The prober reads the two from each arrival, against `rcv_nxt`.
|
|
2216
|
+
* - An arrival can hold more than one segment. The kernel joins the segments that wait in the
|
|
2217
|
+
* backlog of a socket while its owner holds it.
|
|
2218
|
+
* - `ooo` is the count of the kernel of the client in segments (`rcv_ooopack`).
|
|
2219
|
+
* - `sacked` and `lost` are the most segments that the sender held as SACKed and as lost.
|
|
2220
|
+
* - `dsacks` is the DSACK blocks that the sender received, and `fast` its fast retransmissions.
|
|
2221
|
+
* - `degree` is the highest reordering degree of the sender (`tp->reordering`), and `seen` the
|
|
2222
|
+
* reorderings that it detected (`reord_seen`).
|
|
2223
|
+
*
|
|
2224
|
+
* The counts of the kernel are null for a record of the prober before version 0.2.
|
|
1939
2225
|
*/
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
2226
|
+
interface Reordering {
|
|
2227
|
+
readonly outOfOrder: number;
|
|
2228
|
+
readonly duplicates: number;
|
|
2229
|
+
readonly ooo: number | null;
|
|
2230
|
+
readonly sacked: number | null;
|
|
2231
|
+
readonly lost: number | null;
|
|
2232
|
+
readonly dsacks: number | null;
|
|
2233
|
+
readonly fast: number;
|
|
2234
|
+
readonly degree: number | null;
|
|
2235
|
+
readonly seen: number | null;
|
|
2236
|
+
}
|
|
1943
2237
|
/**
|
|
1944
|
-
*
|
|
1945
|
-
*
|
|
1946
|
-
*
|
|
2238
|
+
* A crossings record is the time of a proxy for each request (`up`) and for each reply (`down`).
|
|
2239
|
+
* The time of a request starts at its arrival on the socket toward the client. It stops at the
|
|
2240
|
+
* write on the socket toward the target. The time of a reply goes the other way. A write is a
|
|
2241
|
+
* `tx` record of the prober.
|
|
2242
|
+
*/
|
|
2243
|
+
interface Crossings {
|
|
2244
|
+
readonly hop: string;
|
|
2245
|
+
readonly up: readonly Quantity[];
|
|
2246
|
+
readonly down: readonly Quantity[];
|
|
2247
|
+
}
|
|
2248
|
+
/** A socket place is a socket of a run: its namespace and its cookie. */
|
|
2249
|
+
interface SocketPlace {
|
|
2250
|
+
readonly netns: number;
|
|
2251
|
+
readonly cookie: number;
|
|
2252
|
+
}
|
|
2253
|
+
/**
|
|
2254
|
+
* This function finds the socket of the observer of a cell in a run:
|
|
2255
|
+
* - the client socket, by the address that it connected from, in its namespace.
|
|
2256
|
+
* - the socket of the target for the same connection, in its namespace.
|
|
2257
|
+
* - a socket of a proxy of the topology, toward the client or toward the target. Toward the target,
|
|
2258
|
+
* it is the socket that carries the request, else the first socket that the run opens.
|
|
1947
2259
|
*/
|
|
1948
|
-
export declare const
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
readonly networks: readonly number[];
|
|
1952
|
-
}>;
|
|
2260
|
+
export declare const socketOf: (cell: Cell, run: Run) => SocketPlace | undefined;
|
|
2261
|
+
/** This function gives what reordering did in a run, from the records of the receiver and of the sender. */
|
|
2262
|
+
export declare const reorderingOf: (receiver: readonly KernelRecord[], sender: readonly KernelRecord[]) => Reordering;
|
|
1953
2263
|
/**
|
|
1954
|
-
* This function gives the
|
|
1955
|
-
*
|
|
2264
|
+
* This function gives the times of a proxy in a run, for each request after the first. The time
|
|
2265
|
+
* of a request starts at its arrival on the socket of the proxy toward the client. It stops at the
|
|
2266
|
+
* next write on the socket toward the target. The time of its reply starts at its arrival on the
|
|
2267
|
+
* socket toward the target, and it stops at the next write toward the client. A request without
|
|
2268
|
+
* each record gives no time.
|
|
1956
2269
|
*/
|
|
1957
|
-
export declare const
|
|
2270
|
+
export declare const crossingsOf: (run: Run, hop: string, toClient: SocketPlace | undefined, toTarget: SocketPlace | undefined) => Crossings;
|
|
1958
2271
|
/**
|
|
1959
|
-
* This function
|
|
1960
|
-
*
|
|
1961
|
-
*
|
|
2272
|
+
* This function reads one run against its cell, from the records of the kernel first.
|
|
2273
|
+
* - The socket of the run is the socket of its observer. It is the socket that the client connected
|
|
2274
|
+
* from, in its namespace, or the socket of the target or of a proxy for that connection.
|
|
2275
|
+
* - The fault must hold before the event that it must meet. That is before the request goes into
|
|
2276
|
+
* it, and before the first keepalive probe. A live peer answers that probe, and the answer
|
|
2277
|
+
* starts the idle time again. A run where the fault was late is void. A run whose records the
|
|
2278
|
+
* prober lost is also void.
|
|
2279
|
+
* - For an HTTP client, it also reads what the second request met (`requestOf`). An outcome other
|
|
2280
|
+
* than the one that the prediction gives is a finding.
|
|
1962
2281
|
*/
|
|
1963
|
-
export declare const
|
|
1964
|
-
now: number;
|
|
1965
|
-
jiffies: number;
|
|
1966
|
-
}, second: {
|
|
1967
|
-
now: number;
|
|
1968
|
-
jiffies: number;
|
|
1969
|
-
}) => string | null;
|
|
1970
|
-
/** This function gives the build record of a source as a part of a manifest: `{ build }`, or nothing for an image that the harness pulls. */
|
|
1971
|
-
export declare const buildOf: (source: Parameters<typeof buildRecordOf>[0]) => {
|
|
1972
|
-
readonly build?: BuildRecord;
|
|
1973
|
-
};
|
|
1974
|
-
/** This function gives the version of the harness and the build of its image, as a part of the harness record of a manifest. */
|
|
1975
|
-
export declare const harnessRecord: () => {
|
|
1976
|
-
readonly version: string;
|
|
1977
|
-
readonly build?: BuildRecord;
|
|
1978
|
-
};
|
|
2282
|
+
export declare const measure: (cell: Cell, run: Run) => Measured;
|
|
1979
2283
|
/**
|
|
1980
|
-
* This function
|
|
1981
|
-
*
|
|
2284
|
+
* This function measures the jitter of the program of the observer in a run, from its records
|
|
2285
|
+
* (`Jitter`). The acts count up to the start of the fault, or up to the reply of the client when
|
|
2286
|
+
* the fault has no stamp. A run with no lines of a program, or no socket of the observer, has no act.
|
|
1982
2287
|
*/
|
|
1983
|
-
export declare const
|
|
1984
|
-
/** This function gives the device of a route from its line in `ip -o route get`: "10.0.0.2 dev eth0 src …". */
|
|
1985
|
-
export declare const deviceOf: (route: string) => string;
|
|
2288
|
+
export declare const jitterOf: (cell: Cell, run: Run) => Jitter;
|
|
1986
2289
|
/**
|
|
1987
|
-
* This function
|
|
1988
|
-
*
|
|
1989
|
-
*
|
|
1990
|
-
* sysctls and its routes. Docker Desktop keeps /proc/sys read-only in a container that operates
|
|
1991
|
-
* without privileges.
|
|
1992
|
-
* - each hop of the topology, on the network of each of its sides. A hop is a router, or a stock
|
|
1993
|
-
* proxy with an injector sidecar in its namespace.
|
|
1994
|
-
* - an injector sidecar in the namespace of the target.
|
|
1995
|
-
* - the prober, a privileged container that loads the kernel program and watches the namespace of
|
|
1996
|
-
* the client, of the target and of each hop.
|
|
1997
|
-
*
|
|
1998
|
-
* The client of each run is its own container in the namespace of the client. It is the TCP
|
|
1999
|
-
* client of the harness, a driver from its own image (ioredis on Node), or an image that the
|
|
2000
|
-
* caller gives. Each prints the same lines.
|
|
2290
|
+
* This function reads the second request of an HTTP client from its lines. Its first try is its
|
|
2291
|
+
* first `request` line, and each `retry` line is a new try. Its end is its `error` line, or its
|
|
2292
|
+
* `replied` line. A request with neither is pending. It gives null when the client wrote no try.
|
|
2001
2293
|
*
|
|
2002
|
-
*
|
|
2003
|
-
*
|
|
2004
|
-
* target and each later hop see the router as the peer.
|
|
2294
|
+
* A new try that gets no connection writes no `retry` line. Its dial writes a `dial-error` line.
|
|
2295
|
+
* Thus a `dial-error` line after the first try and before the end is also a new try.
|
|
2005
2296
|
*/
|
|
2006
|
-
export declare const
|
|
2297
|
+
export declare const requestOf: (events: readonly ProbeEvent[]) => RequestReading | null;
|
|
2007
2298
|
/** This text is the line of the log of a standby that serves reads (src/backend/postmaster/postmaster.c:3740). */
|
|
2008
2299
|
export declare const STANDBY_READY: string;
|
|
2009
2300
|
/** This text is the write of the client, with its sequence number. */
|
|
@@ -2019,385 +2310,94 @@ export declare const pairArgs: (cell: Cell, lab: Pick<Lab, "targetIp" | "targetP
|
|
|
2019
2310
|
/** This function gives the instants of the cancels of a hold, in ns from the fault: equal parts of the hold. */
|
|
2020
2311
|
export declare const cancelsOf: (pair: Pair, holdNs: number) => number[];
|
|
2021
2312
|
/**
|
|
2022
|
-
* This function opens the pair of an environment. The table comes first and the standby next: the
|
|
2023
|
-
* base backup has it. A synchronous standby is named last, thus no setup step waits for it.
|
|
2024
|
-
*/
|
|
2025
|
-
export declare const openStandby: (lab: Lab, cell: Cell) => Promise<Sibling>;
|
|
2026
|
-
/**
|
|
2027
|
-
* This function does one run of a pair. A dry run writes and stops, with no fault: the warm-up of the
|
|
2028
|
-
* environment. It removes its rows, thus the numbers of the run start on an empty table.
|
|
2029
|
-
*/
|
|
2030
|
-
export declare const pairOnce: (lab: Lab, standby: Sibling, cell: Cell, environment: number, index: number, dry?: boolean) => Promise<Run>;
|
|
2031
|
-
/**
|
|
2032
|
-
* This module reads the lockfiles of a build context for the manifest of a run. A lockfile pins each
|
|
2033
|
-
* package that a build installs, thus its sha256 pins the packages that the image holds. The
|
|
2034
|
-
* versions of the packages that each manifest names directly are the part that a person reads.
|
|
2035
|
-
*/
|
|
2036
|
-
/** A context file is a file of a build context: its path in the context, and its content. */
|
|
2037
|
-
interface ContextFile {
|
|
2038
|
-
readonly at: string;
|
|
2039
|
-
readonly content: Buffer | string;
|
|
2040
|
-
}
|
|
2041
|
-
/**
|
|
2042
|
-
* These are the names of the lockfiles that the harness records. A `go.mod` is the lockfile of a Go
|
|
2043
|
-
* module, because its `require` lines give exact versions. For them, Go selects the same packages
|
|
2044
|
-
* each time, and its checksum database examines each package.
|
|
2045
|
-
*/
|
|
2046
|
-
export declare const LOCK_NAMES: ReadonlySet<string>;
|
|
2047
|
-
/** This function gives each lockfile of a context by its path, with the sha256 of its content in hex. */
|
|
2048
|
-
export declare const locksOf: (files: readonly ContextFile[]) => Record<string, string>;
|
|
2049
|
-
/** This function gives the version of each direct dependency of an npm lockfile (lockfileVersion 2 or 3). */
|
|
2050
|
-
export declare const npmVersions: (lock: string) => Record<string, string>;
|
|
2051
|
-
/**
|
|
2052
|
-
* This function gives the version of each direct dependency of the root package of a Cargo.lock: the
|
|
2053
|
-
* package that the Cargo.toml beside it names. An entry of a dependency list is a name, or a name
|
|
2054
|
-
* and a version when the lock holds two versions of that name.
|
|
2055
|
-
*/
|
|
2056
|
-
export declare const cargoVersions: (lock: string, manifest: string) => Record<string, string>;
|
|
2057
|
-
/** This function gives the version of each direct requirement of a go.mod. A requirement that is `// indirect` is not direct. */
|
|
2058
|
-
export declare const goVersions: (mod: string) => Record<string, string>;
|
|
2059
|
-
/** This function gives the version of each jar of a list of jars by their SHA-256: `<hex> HikariCP-7.1.0.jar` gives HikariCP 7.1.0. */
|
|
2060
|
-
export declare const jarVersions: (list: string) => Record<string, string>;
|
|
2061
|
-
/**
|
|
2062
|
-
* This function gives the version of each package that the manifests of a context name directly,
|
|
2063
|
-
* by its name. It reads each npm lockfile, Cargo.lock, go.mod and list of jars. A package of a
|
|
2064
|
-
* workspace in the context is a package of the image too, with the version of its package.json.
|
|
2065
|
-
* Such a package has a name and a version, and it is not private. The record has the sha256 of
|
|
2066
|
-
* the lockfile of a pnpm, yarn or bun workspace (`locksOf`). This function does not read versions
|
|
2067
|
-
* from such a lockfile.
|
|
2068
|
-
*/
|
|
2069
|
-
export declare const versionsOf: (files: readonly ContextFile[]) => Record<string, string>;
|
|
2070
|
-
/**
|
|
2071
|
-
* This function gives each problem of one image of a run outside a manifest of the harness, as the
|
|
2072
|
-
* kind lab records its images. A pulled image needs its digest. An image that a build makes needs
|
|
2073
|
-
* its build record, with each base by digest. The build record must have the tag of the image.
|
|
2074
|
-
*/
|
|
2075
|
-
export declare const imagePinProblems: (what: string, image: string, build: BuildRecord | undefined) => string[];
|
|
2076
|
-
/**
|
|
2077
|
-
* This function gives each problem of a manifest that stops it from pinning the programs of its
|
|
2078
|
-
* run. An empty list means that the manifest pins each program.
|
|
2079
|
-
* - the target: an image by its digest, or the build of a subject with its build record and its base
|
|
2080
|
-
* by digest.
|
|
2081
|
-
* - the harness: the version of its package, and the build record of its image.
|
|
2082
|
-
* - the client: an image by its digest, or a build with its build record.
|
|
2083
|
-
* - each hop: an image by its digest, or the tag of a build and the id of its image.
|
|
2084
|
-
*/
|
|
2085
|
-
export declare const manifestProblems: (manifest: Manifest) => string[];
|
|
2086
|
-
/** This function gives the problem of the commit of a record: no commit, or a text that is not a commit of git. */
|
|
2087
|
-
export declare const commitProblems: (commit: string | undefined) => string[];
|
|
2088
|
-
/** The code of a record is the commit of the checkout that operated, and if its tracked files had changes. */
|
|
2089
|
-
interface RecordCode {
|
|
2090
|
-
readonly commit: string;
|
|
2091
|
-
readonly dirty: boolean;
|
|
2092
|
-
}
|
|
2093
|
-
/** These are the parts of a record that tell if it pins the programs of its runs. */
|
|
2094
|
-
interface Pinnable {
|
|
2095
|
-
readonly code?: RecordCode | undefined;
|
|
2096
|
-
readonly manifests: readonly Manifest[];
|
|
2097
|
-
/** A local debug run marks its record so. No page reads such a record. */
|
|
2098
|
-
readonly debug?: boolean | undefined;
|
|
2099
|
-
}
|
|
2100
|
-
/** This problem is the problem of a checkout with changes: its commit does not hold the code that operated. */
|
|
2101
|
-
export declare const DIRTY = "the checkout has changes to tracked files that no commit holds";
|
|
2102
|
-
/** This problem is the problem of a record of a local debug run. */
|
|
2103
|
-
export declare const DEBUG = "the record is of a local debug run, and no page reads it";
|
|
2104
|
-
/**
|
|
2105
|
-
* This function gives each problem that stops a record from pinning the programs of its runs. A
|
|
2106
|
-
* record with a problem is not a record (SYS-101). The writer of the cells refuses it, and the read
|
|
2107
|
-
* of a schedule refuses it. A commit with changes to tracked files is not a pin.
|
|
2108
|
-
*/
|
|
2109
|
-
export declare const recordProblems: (record: Pinnable) => string[];
|
|
2110
|
-
/**
|
|
2111
|
-
* This module is the lab of a replicated group: a primary and its replicas, and the Sentinels
|
|
2112
|
-
* that decide which member is the primary. It opens one environment for a group cell, and it does
|
|
2113
|
-
* the runs of the cell in it. Each member and each Sentinel is a container from the stock image of
|
|
2114
|
-
* the group, in its own network namespace. An injector sidecar shares its network and process
|
|
2115
|
-
* namespaces. The client of each run is ioredis in Sentinel mode. An observer subscribes to the
|
|
2116
|
-
* events of each Sentinel, and the prober watches the namespace of the client.
|
|
2117
|
-
*/
|
|
2118
|
-
/** A stamp is the time of the injector around one commit, on CLOCK_MONOTONIC in nanoseconds. */
|
|
2119
|
-
interface Stamp {
|
|
2120
|
-
readonly t0: number;
|
|
2121
|
-
readonly t1: number;
|
|
2122
|
-
}
|
|
2123
|
-
/** A group network fault is a black hole between a part and its peers, or a reset of each segment from them. */
|
|
2124
|
-
type GroupNetworkFault = "blackhole" | "rst";
|
|
2125
|
-
/** A group client is the client container of one run of a group cell. */
|
|
2126
|
-
interface GroupClient {
|
|
2127
|
-
readonly events: readonly ProbeEvent[];
|
|
2128
|
-
until(kinds: readonly string[], within: number): Promise<ProbeEvent>;
|
|
2129
|
-
stop(): Promise<void>;
|
|
2130
|
-
}
|
|
2131
|
-
/** A group lab is one environment of a group cell. */
|
|
2132
|
-
interface GroupLab {
|
|
2133
|
-
readonly group: Group;
|
|
2134
|
-
readonly clientIp: string;
|
|
2135
|
-
readonly observerIp: string;
|
|
2136
|
-
readonly members: Readonly<Record<string, RunPart>>;
|
|
2137
|
-
readonly sentinels: Readonly<Record<string, RunPart>>;
|
|
2138
|
-
/** These are the namespaces that the prober watches: the client, and the Sentinels for a calibration. */
|
|
2139
|
-
readonly netns: {
|
|
2140
|
-
readonly client: number;
|
|
2141
|
-
readonly watched: readonly number[];
|
|
2142
|
-
};
|
|
2143
|
-
/** These are all the records that the prober wrote, in sequence. */
|
|
2144
|
-
readonly kernel: readonly KernelRecord[];
|
|
2145
|
-
/** These are all the lines of the observer of the Sentinels, in sequence. */
|
|
2146
|
-
readonly timeline: readonly SentinelEvent[];
|
|
2147
|
-
/** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
|
|
2148
|
-
sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
|
|
2149
|
-
/** This method waits until the group is whole and calm, and gives the name of its primary. */
|
|
2150
|
-
converge(within?: number): Promise<string>;
|
|
2151
|
-
/** This method removes each key from the group, and waits until each replica has the removal. */
|
|
2152
|
-
flush(primary: string): Promise<void>;
|
|
2153
|
-
/** This method makes each Sentinel forget the state of the group (`SENTINEL RESET`): an aborted failover then holds off no later failover. */
|
|
2154
|
-
reset(): Promise<void>;
|
|
2155
|
-
/** This method gives the sequence numbers that the group holds, from its primary. */
|
|
2156
|
-
holds(primary: string): Promise<number[]>;
|
|
2157
|
-
/** This method gives the part that has a role in the group, when `primary` is the primary. */
|
|
2158
|
-
partOf(role: GroupRole, primary: string): string;
|
|
2159
|
-
/** This method starts the client of a run, with the arguments of `client-sentinel.mjs`. */
|
|
2160
|
-
client(args: readonly string[]): Promise<GroupClient>;
|
|
2161
|
-
/** This method applies a network fault between a part and some of its peers, at once or at an instant of the VM. */
|
|
2162
|
-
fault(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
|
|
2163
|
-
/** This method removes a network fault, at once or at an instant of the VM. */
|
|
2164
|
-
lift(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
|
|
2165
|
-
/** This method sends a signal to the server process of a part, at once or at an instant of the VM. */
|
|
2166
|
-
signal(part: string, signal: "KILL" | "STOP" | "CONT", at?: number): Promise<Stamp>;
|
|
2167
|
-
/** This method starts the server of a member again, after a fin. */
|
|
2168
|
-
restart(member: string): Promise<void>;
|
|
2169
|
-
/** This method asks the first Sentinel for a failover of the group. */
|
|
2170
|
-
failover(coordinated: boolean): Promise<Stamp>;
|
|
2171
|
-
/** This method removes the TCP metrics of the client namespace: each run starts from a kernel that keeps nothing. */
|
|
2172
|
-
forget(): Promise<void>;
|
|
2173
|
-
/** This method waits for the next clock line of the prober, which gives the count of lost records. */
|
|
2174
|
-
settle(): Promise<number | null>;
|
|
2175
|
-
manifest(sysctls: Readonly<Record<string, string>>): Promise<Manifest>;
|
|
2176
|
-
close(): Promise<void>;
|
|
2177
|
-
}
|
|
2178
|
-
/** This function gives the configuration file of a member: its port, its settings, and the primary that a replica follows. */
|
|
2179
|
-
export declare const memberConfig: (group: Group, primary: string | null) => string;
|
|
2180
|
-
/** This function gives the configuration file of a Sentinel: its port, the group that it monitors, and the settings of the group. */
|
|
2181
|
-
export declare const sentinelConfig: (group: Group, primary: string) => string;
|
|
2182
|
-
/**
|
|
2183
|
-
* This function gives the peers that a fault on a part cuts it from, by their addresses. `all` is
|
|
2184
|
-
* each other part and the client, `group` is the other parts, and `clients` and `to-clients` are
|
|
2185
|
-
* the client. `one` and `one-way` are the first other member. The observer is not a peer, thus the timeline of the
|
|
2186
|
-
* group stays whole.
|
|
2187
|
-
*/
|
|
2188
|
-
export declare const peersOf: (parts: {
|
|
2189
|
-
readonly members: Readonly<Record<string, RunPart>>;
|
|
2190
|
-
readonly sentinels: Readonly<Record<string, RunPart>>;
|
|
2191
|
-
}, client: string, part: string, cuts: NonNullable<GroupPlace["cuts"]>) => string[];
|
|
2192
|
-
/** This function reads the flat reply of a command line client into its fields: name, value, name, value. */
|
|
2193
|
-
export declare const fieldsOf: (text: string) => Array<Record<string, string>>;
|
|
2194
|
-
/** This function reads the INFO of a server into its fields. */
|
|
2195
|
-
export declare const infoOf: (text: string) => Record<string, string>;
|
|
2196
|
-
/**
|
|
2197
|
-
* A view of the group is what its parts tell at one time. `healthy` tells if each Sentinel agrees
|
|
2198
|
-
* on one primary with no flag but `master`, and knows each replica and each other Sentinel. Each
|
|
2199
|
-
* replica must follow that primary with its link up, and the primary must have each replica online,
|
|
2200
|
-
* with no failover in progress.
|
|
2313
|
+
* This function opens the pair of an environment. The table comes first and the standby next: the
|
|
2314
|
+
* base backup has it. A synchronous standby is named last, thus no setup step waits for it.
|
|
2201
2315
|
*/
|
|
2202
|
-
|
|
2203
|
-
readonly primary: string | null;
|
|
2204
|
-
readonly healthy: boolean;
|
|
2205
|
-
readonly why: string;
|
|
2206
|
-
}
|
|
2207
|
-
/** This function judges the views of the Sentinels and of the members: the primary that they agree on, if the group is healthy. */
|
|
2208
|
-
export declare const viewOf: (group: Group, ips: Readonly<Record<string, string>>, sentinels: ReadonlyArray<{
|
|
2209
|
-
readonly master: Record<string, string>;
|
|
2210
|
-
readonly replicas: ReadonlyArray<Record<string, string>>;
|
|
2211
|
-
}>, members: Readonly<Record<string, Record<string, string>>>) => GroupView;
|
|
2212
|
-
/** This time is the longest that a group takes to converge before a run, or after it. */
|
|
2213
|
-
export declare const CONVERGE_MS = 24e4;
|
|
2316
|
+
export declare const openStandby: (lab: Lab, cell: Cell) => Promise<Sibling>;
|
|
2214
2317
|
/**
|
|
2215
|
-
* This function
|
|
2216
|
-
*
|
|
2217
|
-
* - each member: the stock image, its server as the child of a shell, thus a fin can stop the
|
|
2218
|
-
* server and the container stays up. The first member is the primary, and the others follow it.
|
|
2219
|
-
* - each Sentinel: the stock image, its Sentinel as the child of a shell, which monitors the first member.
|
|
2220
|
-
* - an injector sidecar for each part, in its network and process namespaces.
|
|
2221
|
-
* - a client that holds its own network namespace, with a privileged sidecar for its sysctls.
|
|
2222
|
-
* - the observer of the Sentinels, in a namespace of its own.
|
|
2223
|
-
* - the prober, which watches the namespace of the client, and of each Sentinel for a calibration.
|
|
2318
|
+
* This function does one run of a pair. A dry run writes and stops, with no fault: the warm-up of the
|
|
2319
|
+
* environment. It removes its rows, thus the numbers of the run start on an empty table.
|
|
2224
2320
|
*/
|
|
2225
|
-
export declare const
|
|
2226
|
-
readonly watchSentinels?: boolean;
|
|
2227
|
-
}) => Promise<GroupLab>;
|
|
2228
|
-
/** This function gives the latest time that a group cell waits for its outcome, in ms from the fault. */
|
|
2229
|
-
export declare const deadlineOf: (cell: Cell) => number;
|
|
2230
|
-
/** This function gives the latest subscription of the observer to each Sentinel, in some lines of the observer. */
|
|
2231
|
-
export declare const subscriptionsOf: (timeline: readonly SentinelEvent[]) => SentinelEvent[];
|
|
2321
|
+
export declare const pairOnce: (lab: Lab, standby: Sibling, cell: Cell, environment: number, index: number, dry?: boolean) => Promise<Run>;
|
|
2232
2322
|
/**
|
|
2233
|
-
* This
|
|
2234
|
-
*
|
|
2235
|
-
*
|
|
2236
|
-
* - The fault occurs on its part, as the primary of this run makes the roles. A fault with a
|
|
2237
|
-
* hold lifts at its instant in the VM. A stall lifts at its length after the first write into it.
|
|
2238
|
-
* - The run waits for its outcome: the first write that a new primary accepts, or the first one
|
|
2239
|
-
* after the lift on the same primary. Then it continues for a moment.
|
|
2240
|
-
* - Each fault goes, the client stops, and the group converges again. The keys that it then holds
|
|
2241
|
-
* tell which writes it kept.
|
|
2323
|
+
* This module reads the lockfiles of a build context for the manifest of a run. A lockfile pins each
|
|
2324
|
+
* package that a build installs, thus its sha256 pins the packages that the image holds. The
|
|
2325
|
+
* versions of the packages that each manifest names directly are the part that a person reads.
|
|
2242
2326
|
*/
|
|
2243
|
-
|
|
2327
|
+
/** A context file is a file of a build context: its path in the context, and its content. */
|
|
2328
|
+
interface ContextFile {
|
|
2329
|
+
readonly at: string;
|
|
2330
|
+
readonly content: Buffer | string;
|
|
2331
|
+
}
|
|
2244
2332
|
/**
|
|
2245
|
-
*
|
|
2246
|
-
*
|
|
2247
|
-
*
|
|
2248
|
-
* namespace. An injector sidecar shares its network and process namespaces.
|
|
2249
|
-
*
|
|
2250
|
-
* The client of each run is the MongoDB driver, which finds the primary with its own monitors. The
|
|
2251
|
-
* timeline comes from the log of each member and from the lines of the client. The prober watches
|
|
2252
|
-
* the namespace of the client.
|
|
2333
|
+
* These are the names of the lockfiles that the harness records. A `go.mod` is the lockfile of a Go
|
|
2334
|
+
* module, because its `require` lines give exact versions. For them, Go selects the same packages
|
|
2335
|
+
* each time, and its checksum database examines each package.
|
|
2253
2336
|
*/
|
|
2337
|
+
export declare const LOCK_NAMES: ReadonlySet<string>;
|
|
2338
|
+
/** This function gives each lockfile of a context by its path, with the sha256 of its content in hex. */
|
|
2339
|
+
export declare const locksOf: (files: readonly ContextFile[]) => Record<string, string>;
|
|
2340
|
+
/** This function gives the version of each direct dependency of an npm lockfile (lockfileVersion 2 or 3). */
|
|
2341
|
+
export declare const npmVersions: (lock: string) => Record<string, string>;
|
|
2254
2342
|
/**
|
|
2255
|
-
*
|
|
2256
|
-
*
|
|
2257
|
-
*
|
|
2343
|
+
* This function gives the version of each direct dependency of the root package of a Cargo.lock: the
|
|
2344
|
+
* package that the Cargo.toml beside it names. An entry of a dependency list is a name, or a name
|
|
2345
|
+
* and a version when the lock holds two versions of that name.
|
|
2258
2346
|
*/
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
readonly c: string;
|
|
2265
|
-
readonly msg: string;
|
|
2266
|
-
readonly attr: Readonly<Record<string, unknown>>;
|
|
2267
|
-
}
|
|
2268
|
-
/** These are the components of the log of mongod that a run keeps: replication, its heartbeats, the elections, the rollbacks and the commands. */
|
|
2269
|
-
export declare const KEPT: ReadonlySet<string>;
|
|
2270
|
-
/** This function reads one log line of a member, or gives null for a line of another component or a line that is not JSON. */
|
|
2271
|
-
export declare const memberLineOf: (member: string, text: string) => MemberLine | null;
|
|
2347
|
+
export declare const cargoVersions: (lock: string, manifest: string) => Record<string, string>;
|
|
2348
|
+
/** This function gives the version of each direct requirement of a go.mod. A requirement that is `// indirect` is not direct. */
|
|
2349
|
+
export declare const goVersions: (mod: string) => Record<string, string>;
|
|
2350
|
+
/** This function gives the version of each jar of a list of jars by their SHA-256: `<hex> HikariCP-7.1.0.jar` gives HikariCP 7.1.0. */
|
|
2351
|
+
export declare const jarVersions: (list: string) => Record<string, string>;
|
|
2272
2352
|
/**
|
|
2273
|
-
* This function gives the
|
|
2274
|
-
*
|
|
2275
|
-
*
|
|
2353
|
+
* This function gives the version of each package that the manifests of a context name directly,
|
|
2354
|
+
* by its name. It reads each npm lockfile, Cargo.lock, go.mod and list of jars. A package of a
|
|
2355
|
+
* workspace in the context is a package of the image too, with the version of its package.json.
|
|
2356
|
+
* Such a package has a name and a version, and it is not private. The record has the sha256 of
|
|
2357
|
+
* the lockfile of a pnpm, yarn or bun workspace (`locksOf`). This function does not read versions
|
|
2358
|
+
* from such a lockfile.
|
|
2276
2359
|
*/
|
|
2277
|
-
export declare const
|
|
2278
|
-
/** This function puts the log lines of the members on the monotonic clock, with the offset of a client. */
|
|
2279
|
-
export declare const onMonotonic: (log: readonly MemberLine[], offset: number | null) => MemberLine[];
|
|
2280
|
-
/** A cut is the peers that a network fault on a part cuts it from, by their addresses, and the direction of the rules. */
|
|
2281
|
-
interface Cut {
|
|
2282
|
-
readonly peers: readonly string[];
|
|
2283
|
-
readonly direction?: "out";
|
|
2284
|
-
}
|
|
2360
|
+
export declare const versionsOf: (files: readonly ContextFile[]) => Record<string, string>;
|
|
2285
2361
|
/**
|
|
2286
|
-
* This function gives
|
|
2287
|
-
*
|
|
2288
|
-
*
|
|
2289
|
-
* the segments from the part only.
|
|
2362
|
+
* This function gives each problem of one image of a run outside a manifest of the harness, as the
|
|
2363
|
+
* kind lab records its images. A pulled image needs its digest. An image that a build makes needs
|
|
2364
|
+
* its build record, with each base by digest. The build record must have the tag of the image.
|
|
2290
2365
|
*/
|
|
2291
|
-
export declare const
|
|
2292
|
-
/** This function gives the command of the server of each member. The server is the child of a shell, thus a fin can stop it and the container stays up. */
|
|
2293
|
-
export declare const memberCommand: (set: ReplicaSet) => string;
|
|
2294
|
-
/** This function gives the script of the shell that starts the set: each member by its address, and the settings of the set. */
|
|
2295
|
-
export declare const initiateScript: (set: ReplicaSet, ips: Readonly<Record<string, string>>) => string;
|
|
2296
|
-
/** This script prints the view of a member: itself, if it accepts writes, and the state of each member as it sees them. */
|
|
2297
|
-
export declare const STATUS_SCRIPT: string;
|
|
2298
|
-
/** A status is the view of one member, as `STATUS_SCRIPT` prints it. */
|
|
2299
|
-
interface Status {
|
|
2300
|
-
readonly me: string;
|
|
2301
|
-
readonly writable: boolean;
|
|
2302
|
-
readonly members: ReadonlyArray<{
|
|
2303
|
-
readonly name: string;
|
|
2304
|
-
readonly state: string;
|
|
2305
|
-
readonly health: number;
|
|
2306
|
-
readonly optime: number | null;
|
|
2307
|
-
}>;
|
|
2308
|
-
}
|
|
2366
|
+
export declare const imagePinProblems: (what: string, image: string, build: BuildRecord | undefined) => string[];
|
|
2309
2367
|
/**
|
|
2310
|
-
* This function
|
|
2311
|
-
*
|
|
2312
|
-
*
|
|
2368
|
+
* This function gives each problem of a manifest that stops it from pinning the programs of its
|
|
2369
|
+
* run. An empty list means that the manifest pins each program.
|
|
2370
|
+
* - the target: an image by its digest, or the build of a subject with its build record and its base
|
|
2371
|
+
* by digest.
|
|
2372
|
+
* - the harness: the version of its package, and the build record of its image.
|
|
2373
|
+
* - the client: an image by its digest, or a build with its build record.
|
|
2374
|
+
* - each hop: an image by its digest, or the tag of a build and the id of its image.
|
|
2313
2375
|
*/
|
|
2314
|
-
export declare const
|
|
2315
|
-
/**
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
readonly
|
|
2320
|
-
readonly
|
|
2321
|
-
readonly client: number;
|
|
2322
|
-
};
|
|
2323
|
-
/** These are all the records that the prober wrote, in sequence. */
|
|
2324
|
-
readonly kernel: readonly KernelRecord[];
|
|
2325
|
-
/** These are the log lines of the members that a run keeps, in the sequence of their arrival, with `t` at 0. */
|
|
2326
|
-
readonly log: readonly MemberLine[];
|
|
2327
|
-
/** This method sets the sysctls of the client namespace through its privileged sidecar, and reads them back. */
|
|
2328
|
-
sysctl(values: Readonly<Record<string, string>>): Promise<Record<string, string>>;
|
|
2329
|
-
/** This method waits until the set is whole and calm, and gives the name of its primary. */
|
|
2330
|
-
converge(within?: number): Promise<string>;
|
|
2331
|
-
/** This method removes each write from the set, and waits until each member has the removal. */
|
|
2332
|
-
flush(primary: string): Promise<void>;
|
|
2333
|
-
/**
|
|
2334
|
-
* This method lets each secondary stand for election again (`rs.freeze(0)`). A step-down holds its
|
|
2335
|
-
* old primary out of the elections for `STEP_DOWN.seconds`. Without it, a run inherits that hold.
|
|
2336
|
-
*/
|
|
2337
|
-
unfreeze(primary: string): Promise<void>;
|
|
2338
|
-
/** This method gives the sequence numbers that the set holds, from its primary. */
|
|
2339
|
-
holds(primary: string): Promise<number[]>;
|
|
2340
|
-
/** This method gives the member that has a role in the set, when `primary` is the primary. */
|
|
2341
|
-
partOf(role: GroupRole, primary: string): string;
|
|
2342
|
-
/** This method starts the client of a run, with the arguments of `client-mongo.mjs`. */
|
|
2343
|
-
client(args: readonly string[]): Promise<GroupClient>;
|
|
2344
|
-
/** This method applies a network fault between a member and some of its peers, at once or at an instant of the VM. */
|
|
2345
|
-
fault(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
|
|
2346
|
-
/** This method removes a network fault, at once or at an instant of the VM. */
|
|
2347
|
-
lift(kind: GroupNetworkFault, part: string, cuts: NonNullable<GroupPlace["cuts"]>, at?: number): Promise<Stamp>;
|
|
2348
|
-
/** This method sends a signal to the server process of a member, at once or at an instant of the VM. */
|
|
2349
|
-
signal(part: string, signal: "KILL" | "STOP" | "CONT", at?: number): Promise<Stamp>;
|
|
2350
|
-
/** This method starts the server of a member again, after a fin. */
|
|
2351
|
-
restart(member: string): Promise<void>;
|
|
2352
|
-
/** This method runs a command in the box of a member, and gives its output. */
|
|
2353
|
-
exec(member: string, argv: string[]): Promise<string>;
|
|
2354
|
-
/** This method runs a script of the shell on a member, against its own server only, and gives its output. Another port reads a server with no set. */
|
|
2355
|
-
script(member: string, script: string, port?: number): Promise<string>;
|
|
2356
|
-
/** This method runs a command on the backup host of a drill, and gives its output. A lab without that host refuses it. */
|
|
2357
|
-
vault(argv: string[]): Promise<string>;
|
|
2358
|
-
/** This method sends replSetStepDown to the primary. */
|
|
2359
|
-
stepDown(primary: string): Promise<Stamp>;
|
|
2360
|
-
/** This method removes the TCP metrics of the client namespace: each run starts from a kernel that keeps nothing. */
|
|
2361
|
-
forget(): Promise<void>;
|
|
2362
|
-
/** This method waits for the next clock line of the prober, which gives the count of lost records. */
|
|
2363
|
-
settle(): Promise<number | null>;
|
|
2364
|
-
manifest(sysctls: Readonly<Record<string, string>>): Promise<Manifest>;
|
|
2365
|
-
close(): Promise<void>;
|
|
2376
|
+
export declare const manifestProblems: (manifest: Manifest) => string[];
|
|
2377
|
+
/** This function gives the problem of the commit of a record: no commit, or a text that is not a commit of git. */
|
|
2378
|
+
export declare const commitProblems: (commit: string | undefined) => string[];
|
|
2379
|
+
/** The code of a record is the commit of the checkout that operated, and if its tracked files had changes. */
|
|
2380
|
+
interface RecordCode {
|
|
2381
|
+
readonly commit: string;
|
|
2382
|
+
readonly dirty: boolean;
|
|
2366
2383
|
}
|
|
2367
|
-
/**
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
readonly
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
* waits for a primary.
|
|
2379
|
-
* - an injector sidecar for each member, in its network and process namespaces.
|
|
2380
|
-
* - a client that holds its own network namespace, with a privileged sidecar for its sysctls.
|
|
2381
|
-
* - the prober, which watches the namespace of the client.
|
|
2382
|
-
* - a backup host for a recovery drill: the stock image, for its tools, with no server.
|
|
2383
|
-
*/
|
|
2384
|
-
export declare const openReplicaSetLab: (set: ReplicaSet, backups?: boolean) => Promise<ReplicaSetLab>;
|
|
2385
|
-
/** This function gives the arguments of the client of a replica set cell: each member, and the stream of writes. */
|
|
2386
|
-
export declare const replicaSetArgs: (cell: Cell, members: Readonly<Record<string, RunPart>>) => string[];
|
|
2384
|
+
/** These are the parts of a record that tell if it pins the programs of its runs. */
|
|
2385
|
+
interface Pinnable {
|
|
2386
|
+
readonly code?: RecordCode | undefined;
|
|
2387
|
+
readonly manifests: readonly Manifest[];
|
|
2388
|
+
/** A local debug run marks its record so. No page reads such a record. */
|
|
2389
|
+
readonly debug?: boolean | undefined;
|
|
2390
|
+
}
|
|
2391
|
+
/** This problem is the problem of a checkout with changes: its commit does not hold the code that operated. */
|
|
2392
|
+
export declare const DIRTY = "the checkout has changes to tracked files that no commit holds";
|
|
2393
|
+
/** This problem is the problem of a record of a local debug run. */
|
|
2394
|
+
export declare const DEBUG = "the record is of a local debug run, and no page reads it";
|
|
2387
2395
|
/**
|
|
2388
|
-
* This function
|
|
2389
|
-
*
|
|
2390
|
-
*
|
|
2391
|
-
* - The fault occurs on its member, as the primary of this run makes the roles. A fault with a
|
|
2392
|
-
* hold lifts at its instant in the VM. A stall lifts at its length after the first write into
|
|
2393
|
-
* it. A step-down is replSetStepDown to the primary.
|
|
2394
|
-
* - The run waits for its outcome: the first accepted write of a write sent after the commit of
|
|
2395
|
-
* the fault. It is on a new primary, or on any primary. Then the run waits for the end of the
|
|
2396
|
-
* hold, thus the record shows what the set did in the whole hold.
|
|
2397
|
-
* - Each fault goes, the client stops, and the set converges again. The writes that it then holds
|
|
2398
|
-
* tell which writes it kept. The log lines of the members go onto the monotonic clock.
|
|
2396
|
+
* This function gives each problem that stops a record from pinning the programs of its runs. A
|
|
2397
|
+
* record with a problem is not a record (SYS-101). The writer of the cells refuses it, and the read
|
|
2398
|
+
* of a schedule refuses it. A commit with changes to tracked files is not a pin.
|
|
2399
2399
|
*/
|
|
2400
|
-
export declare const
|
|
2400
|
+
export declare const recordProblems: (record: Pinnable) => string[];
|
|
2401
2401
|
/**
|
|
2402
2402
|
* This function does one run of a recovery drill:
|
|
2403
2403
|
* - The set converges, and it loses its writes. The tenants get their data, and a hash reads it.
|