Hold a leaf delivery to three minutes (hq ADR 0304 decision 4, issue 525)
mesh/delivery-group group feat/525-leaf-budget-three-minutes checking: 0 of 2 member(s) ready
mesh/delivery superseded: a newer head of the same pull request
mesh/merge-gate pass: builds mesh-controller → novox; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery-group group feat/525-leaf-budget-three-minutes checking: 0 of 2 member(s) ready
mesh/delivery superseded: a newer head of the same pull request
mesh/merge-gate pass: builds mesh-controller → novox; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
ADR 0304 lowered a leaf module's delivery budget from five minutes to three, the time its measured phases support once a leaf is judged on one reading and waits only for what it shares.
This commit is contained in:
@@ -122,8 +122,8 @@ var probeRegistry = []probe{
|
|||||||
Kind: kindDeliveryStalled, Phase: 3, run: probeDeliveries},
|
Kind: kindDeliveryStalled, Phase: 3, run: probeDeliveries},
|
||||||
// The delivery budgets (novox/hq ADR 0282 decision 7): the newest delivery of each class within its budget,
|
// The delivery budgets (novox/hq ADR 0282 decision 7): the newest delivery of each class within its budget,
|
||||||
// read from mesh-delivery's `times`; a measurement said, never a delivery held.
|
// read from mesh-delivery's `times`; a measurement said, never a delivery held.
|
||||||
{ID: probeBudgetsID, Asserts: "the newest delivery of a leaf module ran on every machine within five minutes of " +
|
{ID: probeBudgetsID, Asserts: "the newest delivery of a leaf module ran on every machine within three minutes of " +
|
||||||
"its merge, and of a core module within ten: mesh-delivery's `times`", From: "ADR 0282",
|
"its merge, and of a core module within ten: mesh-delivery's `times`", From: "ADR 0282, ADR 0304",
|
||||||
Kind: kindOverBudget, Phase: 3, run: probeBudgets},
|
Kind: kindOverBudget, Phase: 3, run: probeBudgets},
|
||||||
// A client of the bus reconnecting in a loop (novox/hq issue 327), from the server's record of closed
|
// A client of the bus reconnecting in a loop (novox/hq issue 327), from the server's record of closed
|
||||||
// connections, which the bus's own module reads.
|
// connections, which the bus's own module reads.
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ import (
|
|||||||
|
|
||||||
// A delivery over its budget is loud (novox/hq ADR 0282 decision 7, issue 382): the self-check reads
|
// A delivery over its budget is loud (novox/hq ADR 0282 decision 7, issue 382): the self-check reads
|
||||||
// mesh-delivery's `times` and raises the warning `delivery.<class>.over-budget` when the newest delivery of a
|
// mesh-delivery's `times` and raises the warning `delivery.<class>.over-budget` when the newest delivery of a
|
||||||
// class whose delivery time is known took longer than its class's budget — five minutes for a leaf module, ten
|
// class whose delivery time is known took longer than its class's budget — three minutes for a leaf module (ADR
|
||||||
// for a core module — naming the delivery and its longest phase. It clears when the next delivery of that class
|
// 0304 decision 4), ten for a core module — naming the delivery and its longest phase. It clears when the next delivery of that class
|
||||||
// lands within its budget. Measurement only: the condition says, it never holds or acts on a delivery.
|
// lands within its budget. Measurement only: the condition says, it never holds or acts on a delivery.
|
||||||
|
|
||||||
// probeBudgetsID is the probe that reads the delivery times.
|
// probeBudgetsID is the probe that reads the delivery times.
|
||||||
@@ -27,8 +27,9 @@ const probeBudgetsID = "D16"
|
|||||||
// kindOverBudget is what a delivery over its class's budget raises.
|
// kindOverBudget is what a delivery over its class's budget raises.
|
||||||
const kindOverBudget = "over-budget"
|
const kindOverBudget = "over-budget"
|
||||||
|
|
||||||
// deliveryBudgets are the budgets by class (ADR 0282 decision 1); the probe raises nothing for another class.
|
// deliveryBudgets are the budgets by class (ADR 0282 decision 1, the leaf's as ADR 0304 decision 4 changed it);
|
||||||
var deliveryBudgets = map[string]time.Duration{inventory.ClassLeaf: 5 * time.Minute, inventory.ClassCore: 10 * time.Minute}
|
// the probe raises nothing for another class.
|
||||||
|
var deliveryBudgets = map[string]time.Duration{inventory.ClassLeaf: 3 * time.Minute, inventory.ClassCore: 10 * time.Minute}
|
||||||
|
|
||||||
// timesAnswer is what mesh-delivery's `times` answers, as far as the probe reads it.
|
// timesAnswer is what mesh-delivery's `times` answers, as far as the probe reads it.
|
||||||
type timesAnswer struct {
|
type timesAnswer struct {
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ import (
|
|||||||
"github.com/novox/mesh-controller/internal/inventory"
|
"github.com/novox/mesh-controller/internal/inventory"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A leaf delivery of 5 minutes 10 seconds raises delivery.leaf.over-budget naming its longest phase; one of
|
// A leaf delivery of 3 minutes 10 seconds raises delivery.leaf.over-budget naming its longest phase; one of
|
||||||
// exactly five minutes, a core one of nine and a class without a budget raise nothing (ADR 0282 decision 7).
|
// exactly three minutes, a core one of nine and a class without a budget raise nothing (ADR 0282 decision 7,
|
||||||
|
// the leaf's budget as ADR 0304 decision 4 changed it).
|
||||||
func TestADeliveryOverItsBudgetIsLoud(t *testing.T) {
|
func TestADeliveryOverItsBudgetIsLoud(t *testing.T) {
|
||||||
a := ×Answer{Classes: []timesClass{
|
a := ×Answer{Classes: []timesClass{
|
||||||
{Class: inventory.ClassLeaf, Latest: ×Latest{ID: "novox/mesh-catalog@abc", TookMS: (5*time.Minute + 10*time.Second).Milliseconds(),
|
{Class: inventory.ClassLeaf, Latest: ×Latest{ID: "novox/mesh-catalog@abc", TookMS: (3*time.Minute + 10*time.Second).Milliseconds(),
|
||||||
Longest: "judgement 2m40s"}},
|
Longest: "judgement 2m40s"}},
|
||||||
{Class: inventory.ClassCore, Latest: ×Latest{ID: "novox/mesh-controller@def", TookMS: (9 * time.Minute).Milliseconds(),
|
{Class: inventory.ClassCore, Latest: ×Latest{ID: "novox/mesh-controller@def", TookMS: (9 * time.Minute).Milliseconds(),
|
||||||
Longest: "build 1m"}},
|
Longest: "build 1m"}},
|
||||||
@@ -30,7 +31,7 @@ func TestADeliveryOverItsBudgetIsLoud(t *testing.T) {
|
|||||||
t.Fatalf("the condition names its delivery and longest phase: %s — %s", o.Key(), o.Summary)
|
t.Fatalf("the condition names its delivery and longest phase: %s — %s", o.Key(), o.Summary)
|
||||||
}
|
}
|
||||||
// The next leaf delivery within its budget clears it: the probe raises nothing for the class.
|
// The next leaf delivery within its budget clears it: the probe raises nothing for the class.
|
||||||
a.Classes[0].Latest = ×Latest{ID: "novox/mesh-catalog@ghi", TookMS: (5 * time.Minute).Milliseconds()}
|
a.Classes[0].Latest = ×Latest{ID: "novox/mesh-catalog@ghi", TookMS: (3 * time.Minute).Milliseconds()}
|
||||||
if obs := overBudgetObservations(a); len(obs) != 0 {
|
if obs := overBudgetObservations(a); len(obs) != 0 {
|
||||||
t.Fatalf("a delivery of exactly its budget is within it: %+v", obs)
|
t.Fatalf("a delivery of exactly its budget is within it: %+v", obs)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user