@mark1russell7/kind 0.14.2 → 0.14.3
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 +2 -45
- package/build/index.js +24 -47
- package/build/index.js.map +1 -1
- package/build/{judge-ug4T2Q_R.js → judge-BvytGtrG.js} +10 -19
- package/build/{judge-ug4T2Q_R.js.map → judge-BvytGtrG.js.map} +1 -1
- package/build/{judge-DLn2PLxb.d.ts → judge-Cg6FY76s.d.ts} +1 -24
- package/build/judge.d.ts +1 -1
- package/build/judge.js +1 -1
- package/image/npm-lock.json +10 -0
- package/image/package.json +1 -0
- package/package.json +6 -5
|
@@ -3,7 +3,7 @@ import { median, medianInterval, quantileSorted } from "@mark1russell7/rigor-sta
|
|
|
3
3
|
import { backoffDelay } from "@mark1russell7/service/backoff";
|
|
4
4
|
import { extentSchema, quantitySchema } from "@mark1russell7/quantity/schema";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
|
|
6
|
+
// src/bands.ts
|
|
7
7
|
/** This module makes and prints the bands of the predictions. It imports only the amounts. */
|
|
8
8
|
/** This function gives a time in seconds as a quantity. */
|
|
9
9
|
const seconds = (value) => ({
|
|
@@ -109,8 +109,7 @@ const requestBand = (term, span, mean, connections, sessions) => {
|
|
|
109
109
|
hi: sessions * (Math.ceil(each) + 1 + term.requests.hi + drained.hi)
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
|
-
|
|
113
|
-
//#region src/names.ts
|
|
112
|
+
// src/names.ts
|
|
114
113
|
/** These are the ports of the app: its server, and its health server for the probes. */
|
|
115
114
|
const PORT = 8080;
|
|
116
115
|
const HEALTH_PORT = 9e3;
|
|
@@ -126,8 +125,7 @@ const LB_CLASS = "kube-vip.io/kube-vip-class";
|
|
|
126
125
|
const VIP_ANNOTATION = "kube-vip.io/loadbalancerIPs";
|
|
127
126
|
/** This is the name of the node of each client outside the cluster, in its lines (`KindCell.vip`). */
|
|
128
127
|
const OUTSIDE = "outside";
|
|
129
|
-
|
|
130
|
-
//#region src/stats.ts
|
|
128
|
+
// src/stats.ts
|
|
131
129
|
/** This fraction, δ_rel, is how far the median of a cell can be outside its band and stay equivalent. */
|
|
132
130
|
const RELATIVE = .05;
|
|
133
131
|
/**
|
|
@@ -150,8 +148,7 @@ const medianInterval$1 = (sorted) => {
|
|
|
150
148
|
const interval = medianInterval(sorted, .95);
|
|
151
149
|
return [interval.low, interval.high];
|
|
152
150
|
};
|
|
153
|
-
|
|
154
|
-
//#region src/observe.ts
|
|
151
|
+
// src/observe.ts
|
|
155
152
|
/**
|
|
156
153
|
* This module reads a run from its lines. Each time is in milliseconds on CLOCK_MONOTONIC. All the
|
|
157
154
|
* containers of the VM share that clock: the clients, the service, the agents, the injector, the
|
|
@@ -356,8 +353,7 @@ const restartsAt = (lines, at) => {
|
|
|
356
353
|
for (const [name, pod] of podsAt(lines, at)) out.set(name, pod.cs.reduce((sum, status) => sum + status.rc, 0));
|
|
357
354
|
return out;
|
|
358
355
|
};
|
|
359
|
-
|
|
360
|
-
//#region src/reconnects.ts
|
|
356
|
+
// src/reconnects.ts
|
|
361
357
|
/**
|
|
362
358
|
* This function gives the delay of the call `index`, from 0, before the floor, the stop and the
|
|
363
359
|
* jitter. It is the backoff of the service, with a factor of 2 and a cap of the most.
|
|
@@ -593,8 +589,7 @@ const judgeReconnects = (prediction, run, sends, noise) => {
|
|
|
593
589
|
}
|
|
594
590
|
return done(true, `${flip === null ? "the stopped broker owns the topic again" : `another owner ${flip.toFixed(0)} ms after the fault`}; ${returns.map((each) => `${each.pod} back at try ${each.tries}`).join(", ")}`);
|
|
595
591
|
};
|
|
596
|
-
|
|
597
|
-
//#region src/verdict.ts
|
|
592
|
+
// src/verdict.ts
|
|
598
593
|
/**
|
|
599
594
|
* This time is δ for kind: each time of a run lands in its band ± δ. Its parts are the interval of
|
|
600
595
|
* the poll of the rules (50 ms) and the delay of the watcher. The watcher receives each change after
|
|
@@ -1519,8 +1514,7 @@ const judgeKind = (cell, runs) => {
|
|
|
1519
1514
|
checks
|
|
1520
1515
|
};
|
|
1521
1516
|
};
|
|
1522
|
-
|
|
1523
|
-
//#region src/record.ts
|
|
1517
|
+
// src/record.ts
|
|
1524
1518
|
/**
|
|
1525
1519
|
* This module is the raw record of a kind cell: its formats, and the upgrade from the format `/1`
|
|
1526
1520
|
* to the format `/2`. The lab writes `/2`, and it does not write `/1` again. A reader reads a record
|
|
@@ -1736,8 +1730,7 @@ const judge = (record) => {
|
|
|
1736
1730
|
const current = upgrade(record);
|
|
1737
1731
|
return judgeKind(current.cell, current.runs);
|
|
1738
1732
|
};
|
|
1739
|
-
|
|
1740
|
-
//#region src/report.ts
|
|
1733
|
+
// src/report.ts
|
|
1741
1734
|
/** This function gives the spread of a set of times, or null for none. The percentile is by nearest rank. */
|
|
1742
1735
|
const timeSpread = (times) => {
|
|
1743
1736
|
if (times.length === 0) return null;
|
|
@@ -1840,8 +1833,7 @@ const calibrationOf = (judged) => {
|
|
|
1840
1833
|
intake: timeSpread(intake)
|
|
1841
1834
|
};
|
|
1842
1835
|
};
|
|
1843
|
-
|
|
1844
|
-
//#region src/schema.ts
|
|
1836
|
+
// src/schema.ts
|
|
1845
1837
|
/**
|
|
1846
1838
|
* This module holds the zod schemas of a kind cell record, in the formats `/1` and `/2`. It names
|
|
1847
1839
|
* the stages of the shutdown itself, thus it does not load the service. A test holds the names to
|
|
@@ -2381,7 +2373,6 @@ const readRecord = (data) => {
|
|
|
2381
2373
|
if (format === "systems.kind-cell-record/2") return kindCellRecordSchema.parse(data);
|
|
2382
2374
|
throw new Error(`a kind cell record has the format ${FORMAT} or ${FORMAT_V1}, not ${String(format)}`);
|
|
2383
2375
|
};
|
|
2384
|
-
//#endregion
|
|
2385
2376
|
export { rulesOf as $, judgeReconnects as A, overshootBand as At, emptyOf as B, observationEnd as C, PORT as Ct, reusesReset as D, backlogEnd as Dt, referenceOf as E, VIP_ANNOTATION as Et, backendsAt as F, outcomesOf as G, intakeOf as H, byClients as I, podsOf as J, periodOf as K, byNode as L, triesOf as M, seconds as Mt, HBONE_PORT as N, secondsOf as Nt, unitOf as O, bandOf as Ot, TCP_STATE as P, showBand as Pt, restartsAt as Q, deletionOf as R, observationAfter as S, OUTSIDE as St, propagationSource as T, SERVER as Tt, isTunnelState as U, failuresOf as V, kernelCounts as W, requestsOf as X, recordsOf as Y, restartOf as Z, checkRun as _, quantileOf as _t, calibrationOf as a, sliceReadyAt as at, factsOf as b, LB_CLASS as bt, predictionText as c, socketsOf as ct, FORMAT_V1 as d, tunnelsOf as dt, sessionsAt as et, judge as f, ztunnelPodsOf as ft, LAST_SLACK as g, middle as gt, KIND_NOISE as h, medianInterval$1 as ht, readRecord as i, sliceEmptyOf as it, latestReturn as j, requestBand as jt, updatesOf as k, drainBand as kt, timeSpread as l, stoppingOf as lt, upgradeCell as m, RELATIVE as mt, kindCellRecordSchema as n, signalsOf as nt, cellsTable as o, sliceReadyOf as ot, upgrade as p, ztunnelReplaced as pt, podsAt as q, kindCellRecordV1Schema as r, sliceDropOf as rt, medianText as s, slicesOf as st, STAGES as t, signalOf as tt, FORMAT as u, transitionOf as ut, cyclesOf as v, CLIENT as vt, propagationOf as w, REDIS as wt, judgeKind as x, LOG_LABEL as xt, deletionsOf as y, HEALTH_PORT as yt, dropOf as z };
|
|
2386
2377
|
|
|
2387
|
-
//# sourceMappingURL=judge-
|
|
2378
|
+
//# sourceMappingURL=judge-BvytGtrG.js.map
|