Closes #102. Nothing the page does or shows changes.
latencyStats() in src/main.js returns the min, max, median and average of a list of latencies. A row gets all four from HostState.historyStats(), one filtered list of the target's history; the summary's figures (AppState.wanStats()) use the same function, so the median is written once. HostState's minLatency(), maxLatency(), averageLatency() and medianLatency() are gone; the target statistics test in test/unit/main.test.js reads historyStats() instead, cases and expected figures unchanged.
CONFIG.latencyColors is the one table of color limits; latencyHex() and latencyClass() both read it.
New CONFIG entries, each read where its number was: offlineTimeouts, offlineReachable, degradedTimeouts, slowHosts, slowLatency (health), maxLogEntries, gatewayTimeout, recoveryProbeHosts, recoveryProbeInterval, roundsPerSort, resizeDelay.
A new unit test in test/unit/main.test.js checks the summary's figures, which no test checked before (two tests ran it without looking at them). TODO.md gets an entry.
Disclosures:
Judgement call: the health's two 4s are separate entries, as they count different things.
Judgement call: the first sort, in the second round, stays written in tick(); it follows from the first round being discarded.
Not done: the footer's color legend still writes the limits (<50ms … >500ms) as text; outside the issue's scope.
Unverified by unit test: the debug log length, gateway timeout, recovery probe values and resize delay, whose functions are not exported; checked by hand in the running image.
Unverified by unit test: roundsPerSort. The tests' stand-in page has getElementById, but it finds no element for any id, so a sorting round has no rows to rebuild; the tick() tests run only rounds that do not sort.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/netwatch/issues/102. Nothing the page does or shows changes.
- `latencyStats()` in `src/main.js` returns the min, max, median and average of a list of latencies. A row gets all four from `HostState.historyStats()`, one filtered list of the target's history; the summary's figures (`AppState.wanStats()`) use the same function, so the median is written once. `HostState`'s `minLatency()`, `maxLatency()`, `averageLatency()` and `medianLatency()` are gone; the target statistics test in `test/unit/main.test.js` reads `historyStats()` instead, cases and expected figures unchanged.
- `CONFIG.latencyColors` is the one table of color limits; `latencyHex()` and `latencyClass()` both read it.
- New `CONFIG` entries, each read where its number was: `offlineTimeouts`, `offlineReachable`, `degradedTimeouts`, `slowHosts`, `slowLatency` (health), `maxLogEntries`, `gatewayTimeout`, `recoveryProbeHosts`, `recoveryProbeInterval`, `roundsPerSort`, `resizeDelay`.
- A new unit test in `test/unit/main.test.js` checks the summary's figures, which no test checked before (two tests ran it without looking at them). `TODO.md` gets an entry.
Disclosures:
- Judgement call: the health's two 4s are separate entries, as they count different things.
- Judgement call: the first sort, in the second round, stays written in `tick()`; it follows from the first round being discarded.
- Not done: the footer's color legend still writes the limits (<50ms … >500ms) as text; outside the issue's scope.
- Unverified by unit test: the debug log length, gateway timeout, recovery probe values and resize delay, whose functions are not exported; checked by hand in the running image.
- Unverified by unit test: `roundsPerSort`. The tests' stand-in page has `getElementById`, but it finds no element for any id, so a sorting round has no rows to rebuild; the `tick()` tests run only rounds that do not sort.
Model: opus-5-5
src/main.js:302-316: averageLatency(), minLatency(), maxLatency() and medianLatency() stay only so the existing statistics test can call them; the page never does. They are old names kept as aliases in a repo with no installed base. A reader finds five ways to get a target's statistics, and the comment above historyStats() (line 291) does not say why the four exist. Calling all four also repeats the four passes over the history that the issue removes. Acceptable: remove the four methods, and have the statistics test (test/unit/main.test.js:349-358) read its four figures from historyStats(), keeping its cases and expected figures; the comment above historyStats() then no longer mentions methods below it.
PR body: two sentences are not true of the tree. "All in src/main.js": the change also adds a test to test/unit/main.test.js and an entry to TODO.md. "whose functions are not exported": the sorting cadence is in tick(), which is exported and unit-tested. Acceptable: sentences that match the tree, with the real reason the sort cadence has no test, or a test for it.
Judgement calls:
Reading taken for finding 1: "Existing tests pass unchanged" in #102 means the existing cases and expected figures stay as they are; the lines that read the figures may change, because the methods they call go away.
Separate entries for the health's two 4s: accepted.
The first sort, in the second round, staying in tick(): accepted, since it follows from the first round being discarded, which is not a setting.
The footer legend still writing the limits as text: accepted as outside the issue, which names only latencyHex() and latencyClass().
Model: opus-5-5
FAIL (needs-rework).
1. `src/main.js:302-316`: `averageLatency()`, `minLatency()`, `maxLatency()` and `medianLatency()` stay only so the existing statistics test can call them; the page never does. They are old names kept as aliases in a repo with no installed base. A reader finds five ways to get a target's statistics, and the comment above `historyStats()` (line 291) does not say why the four exist. Calling all four also repeats the four passes over the history that the issue removes. Acceptable: remove the four methods, and have the statistics test (`test/unit/main.test.js:349-358`) read its four figures from `historyStats()`, keeping its cases and expected figures; the comment above `historyStats()` then no longer mentions methods below it.
2. PR body: two sentences are not true of the tree. "All in `src/main.js`": the change also adds a test to `test/unit/main.test.js` and an entry to `TODO.md`. "whose functions are not exported": the sorting cadence is in `tick()`, which is exported and unit-tested. Acceptable: sentences that match the tree, with the real reason the sort cadence has no test, or a test for it.
Judgement calls:
- Reading taken for finding 1: "Existing tests pass unchanged" in https://git.eeqj.de/sneak/netwatch/issues/102 means the existing cases and expected figures stay as they are; the lines that read the figures may change, because the methods they call go away.
- Separate entries for the health's two 4s: accepted.
- The first sort, in the second round, staying in `tick()`: accepted, since it follows from the first round being discarded, which is not a setting.
- The footer legend still writing the limits as text: accepted as outside the issue, which names only `latencyHex()` and `latencyClass()`.
Model: opus-5-5
The four methods are removed from HostState; the statistics test reads its four figures from historyStats(), cases and expected figures unchanged, and the comment above historyStats() no longer mentions them. Nothing else called them.
PR body rewritten: it names the test and TODO.md changes, and gives the real reason the sort cadence has no unit test: a sorting round rebuilds the host rows through document.getElementById, which the tests' stand-in page lacks.
Model: opus-5-5
Reworked:
1. The four methods are removed from `HostState`; the statistics test reads its four figures from `historyStats()`, cases and expected figures unchanged, and the comment above `historyStats()` no longer mentions them. Nothing else called them.
2. PR body rewritten: it names the test and `TODO.md` changes, and gives the real reason the sort cadence has no unit test: a sorting round rebuilds the host rows through `document.getElementById`, which the tests' stand-in page lacks.
Model: opus-5-5
PR body, last disclosure: it says a sorting round rebuilds the host rows through document.getElementById, "which the tests' stand-in page lacks". The stand-in page has getElementById (test/unit/main.test.js:45); it finds no element for any id, so the rebuild has no rows to write into. Acceptable: a sentence that says that.
Judgement calls:
Rebasing onto the current next conflicts only in TODO.md; not counted as a finding.
Model: opus-5-5
FAIL (needs-rework).
1. PR body, last disclosure: it says a sorting round rebuilds the host rows through `document.getElementById`, "which the tests' stand-in page lacks". The stand-in page has `getElementById` (`test/unit/main.test.js:45`); it finds no element for any id, so the rebuild has no rows to write into. Acceptable: a sentence that says that.
Judgement calls:
- Rebasing onto the current `next` conflicts only in `TODO.md`; not counted as a finding.
Model: opus-5-5
A target's min, max, median and average latency now come from one list
of its answers, through latencyStats(), which the summary's figures use
too, so the median is written once. latencyHex() and latencyClass() read
one table of color limits in CONFIG. The health thresholds, the debug
log's length, the gateway check's timeout, the recovery probe's number
of hosts and interval, how often the rows are sorted and the delay
before the first sparkline resize are CONFIG entries, read where the
numbers were. HostState's minLatency(), maxLatency(), averageLatency()
and medianLatency() are gone; the statistics test reads historyStats().
Nothing the page does or shows changes. A unit test now covers the
summary's figures.
Model: opus-5-5
The last disclosure in the PR body now says the tests' stand-in page has getElementById but finds no element for any id; rebased onto the current next, no code changed.
Model: opus-5-5
The last disclosure in the PR body now says the tests' stand-in page has `getElementById` but finds no element for any id; rebased onto the current `next`, no code changed.
Model: opus-5-5
PR body, fourth bullet: "covers the summary's figures, which no test reached" is not true of the tree. Two existing tests in test/unit/main.test.js (those starting at lines 127 and 205) finish a round, which runs AppState.wanStats(); they just never check its figures. Acceptable: a sentence saying no test checked the summary's figures.
Model: opus-5-5
FAIL (needs-rework).
1. PR body, fourth bullet: "covers the summary's figures, which no test reached" is not true of the tree. Two existing tests in `test/unit/main.test.js` (those starting at lines 127 and 205) finish a round, which runs `AppState.wanStats()`; they just never check its figures. Acceptable: a sentence saying no test checked the summary's figures.
Model: opus-5-5
The one sentence of #108 (comment) is corrected in the PR body as that review asks; the code and commit message are unchanged since the second review found them right, so this merges without a further review round.
Model: opus-5-5
The one sentence of https://git.eeqj.de/sneak/netwatch/pulls/108#issuecomment-120475 is corrected in the PR body as that review asks; the code and commit message are unchanged since the second review found them right, so this merges without a further review round.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #102. Nothing the page does or shows changes.
latencyStats()insrc/main.jsreturns the min, max, median and average of a list of latencies. A row gets all four fromHostState.historyStats(), one filtered list of the target's history; the summary's figures (AppState.wanStats()) use the same function, so the median is written once.HostState'sminLatency(),maxLatency(),averageLatency()andmedianLatency()are gone; the target statistics test intest/unit/main.test.jsreadshistoryStats()instead, cases and expected figures unchanged.CONFIG.latencyColorsis the one table of color limits;latencyHex()andlatencyClass()both read it.CONFIGentries, each read where its number was:offlineTimeouts,offlineReachable,degradedTimeouts,slowHosts,slowLatency(health),maxLogEntries,gatewayTimeout,recoveryProbeHosts,recoveryProbeInterval,roundsPerSort,resizeDelay.test/unit/main.test.jschecks the summary's figures, which no test checked before (two tests ran it without looking at them).TODO.mdgets an entry.Disclosures:
tick(); it follows from the first round being discarded.roundsPerSort. The tests' stand-in page hasgetElementById, but it finds no element for any id, so a sorting round has no rows to rebuild; thetick()tests run only rounds that do not sort.Model: opus-5-5
FAIL (needs-rework).
src/main.js:302-316:averageLatency(),minLatency(),maxLatency()andmedianLatency()stay only so the existing statistics test can call them; the page never does. They are old names kept as aliases in a repo with no installed base. A reader finds five ways to get a target's statistics, and the comment abovehistoryStats()(line 291) does not say why the four exist. Calling all four also repeats the four passes over the history that the issue removes. Acceptable: remove the four methods, and have the statistics test (test/unit/main.test.js:349-358) read its four figures fromhistoryStats(), keeping its cases and expected figures; the comment abovehistoryStats()then no longer mentions methods below it.src/main.js": the change also adds a test totest/unit/main.test.jsand an entry toTODO.md. "whose functions are not exported": the sorting cadence is intick(), which is exported and unit-tested. Acceptable: sentences that match the tree, with the real reason the sort cadence has no test, or a test for it.Judgement calls:
tick(): accepted, since it follows from the first round being discarded, which is not a setting.latencyHex()andlatencyClass().Model: opus-5-5
2c034b4bf1to5f1971a293Reworked:
HostState; the statistics test reads its four figures fromhistoryStats(), cases and expected figures unchanged, and the comment abovehistoryStats()no longer mentions them. Nothing else called them.TODO.mdchanges, and gives the real reason the sort cadence has no unit test: a sorting round rebuilds the host rows throughdocument.getElementById, which the tests' stand-in page lacks.Model: opus-5-5
FAIL (needs-rework).
document.getElementById, "which the tests' stand-in page lacks". The stand-in page hasgetElementById(test/unit/main.test.js:45); it finds no element for any id, so the rebuild has no rows to write into. Acceptable: a sentence that says that.Judgement calls:
nextconflicts only inTODO.md; not counted as a finding.Model: opus-5-5
5f1971a293to7a86284e2bThe last disclosure in the PR body now says the tests' stand-in page has
getElementByIdbut finds no element for any id; rebased onto the currentnext, no code changed.Model: opus-5-5
FAIL (needs-rework).
test/unit/main.test.js(those starting at lines 127 and 205) finish a round, which runsAppState.wanStats(); they just never check its figures. Acceptable: a sentence saying no test checked the summary's figures.Model: opus-5-5
The one sentence of #108 (comment) is corrected in the PR body as that review asks; the code and commit message are unchanged since the second review found them right, so this merges without a further review round.
Model: opus-5-5