Repository navigation
Conversation
…, on a worker and a gateway (#347) Red: 50 failing. The contract (usage.get, HISTORY_NOT_KEPT, the output schema) is in place; the figures module, the history reads, the handlers, the client method and the CLI command are stubs.
…ndow 50 failing -> 45 failing
45 failing -> 17 failing
… stats prints it 17 failing -> 0 failing (unit)
Adds tests for the usage error messages, the output schema's RAM and series fields, the no-token-store paths, the server route, the degraded client and the carry order; a step at the end of a window cuts no segment.
…ts request, give core/usage an index window.to ceil -> floor; a killed rejection of a request made before the window is in no count (requestedBefore carried by the history read); core/usage/index.ts and a COMPONENTS row; a test for the unreadable oldestTs message.
…er, failures count by event name, waiting carries requests open at the window's start (#347)
…ndex, lint-enforced gateway boundary)
…ucket Whole file 4 tests, 6 s instead of minutes; no test timeout override. 0 failing -> 0 failing
Open
1 task done
Contributor
Author
Review notesNot blocking, not verified. Each is one reviewer's claim.
Written by an agent. |
The own-event guard was unreachable: a gateway's own event names no worker. 0 failing -> 0 failing
Fallow flagged countRequest for complexity. 0 failing -> 0 failing
Settle a carried fleet request at a restart whatever its time; drop the redundant outcome filter, the grant kind and the ring re-sort; test a restart at the window end, a rejected probe, an end with no relayed grant, worker order and label. 0 failing -> 0 failing
… --since 1h, fix stale docs 13 review findings: 13 open -> 0 open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #347
Status
Implement: done Review: round 5, 4 open (1 code, 3 claims), Rerun: none Mutate: 36 alive, explained Hardware: n/a Gate: not run
Next: parked after the last review round; the maintainer decides, then implement fix and review round 6
fromalready ended. Class: a doc that describes a mechanism by its old inputs.Done when
--no-waitrejection and a timeout,simlock stats --since 1hprints request count, grants by source, held time and turnaround, wait p50, p95 and max, provisioning and boot durations, peak utilisation, queue depth, rejections by reason and incidents;--jsonprints the same figures; and the counts match what a reader counts by hand fromsimlock events --since 1h.simlock daemon stopandsimlock daemon start.--no-waitrefusal,simlock stats --since 1hshowsrequestsandrejected.byReason.no-waiteach one higher than before it andgrantedunchanged.simlock stats --from <a day ago> --to <two days ago>is a usage error;--since 30don a history whose oldest event is a minute old prints the figures with "Figures cover from " above them; a window that ends before the oldest held event prints theHISTORY_NOT_KEPTmessage and exits non-zero.docs/CLI.mddescribessimlock stats, its flags, the partial note and the error.Assumptions
lease.requested— onlyalready-leased,killedandlease-id-takenare counted as refused before admission, and only when nolease.requestedwith the rejection's request id exists anywhere in the history read; any other rejection without a request is a request from before the window and counts nowhere. This is the narrowest reading of "refused before admission".series[].waitingfor a request made before the window — the history read carries each requester's latestlease.requestedand the ids of the requests answered by then (lease.granted,lease.rejected,request.granted); a request counts as waiting at the start when its id is in neither the answered set nor ended by a gateway restart. The core allows one open request per requester, so the latest request of a requester is the only one that can be open.daemon.startedat or before the window is carried with the other carried events, so a fleet request made before the window that a restart before it ended is not waiting at its start (ADR 0021 §5).fleetRequestIdthat was made before the window is not carried intowaiting(a probe never waits, ADR 0021 §5), whether or not it was answered.gw:requester (it is nothing of that requester's but a decline).simlock stats --since 1hrun--since 1hitself, after waiting for the minute that holds the scripted run to close (the window is rounded down to the series bucket, so the minute now running is left out until it is over); the three tests take up to a minute longer.Review
Round 3 (before this run): spec review 0 blocking; code review 10 blocking; claims review 4 blocking. Round 3 fixes applied after ADR 0021 (#433) landed; the fleet join is reworked, so the fix lines about the old join are moot: first relayed answer from any worker (#fleetOutcome, no longer exists), carried requests matched by requester (now by request id), a gateway request open at stop carried forever (now ended at the next
daemon.started).Mutate: 1462 mutants, 33 alive.
Rejected in round 3:
Mutants left alive
Equivalent, nothing observable changes:
[]becomes a one-element array holding a string that is never an event name, a number, a token or a candidate:src/bus/event-file.ts(carrydefault andinput.carry ?? []),src/core/usage/compute-usage.ts(the?? []fallbacks of the RAM limit and ofwaitingAt's made and settled lists),src/core/usage/read-events.ts(#restarts' initial value:"..."has noindex, sofindnever matches it),src/daemon/dispatcher.tsandsrc/gateway/dispatcher.ts(the usage reader'stokenLabelsdefault).src/bus/event-file.ts: the carry key part for a missing worker or requester becomes another string, or the type check is dropped;Array.jointurnsundefinedinto the same empty text.src/cli/index.ts:runStatsreceivesrestinstead ofrest.slice(1); positionals are not read.src/cli/stats.tsandsrc/core/usage/compute-usage.ts(requesters sort):<to<=in a sort over unique keys.src/core/usage/compute-usage.tsturnaroundOfandspanOf: theundefinedchecks andfact.outcome?.at; every grant came from a stored request, sorequestedAtandoutcomeare always set where they are read.src/core/usage/compute-usage.tswaitingAt:madeBy < made.lengthto<=, and the bound dropped; reading one past the end comparesundefined <= time, which is false.src/core/usage/compute-usage.tsseries:ramUsedBytes: undefinedin place of leaving the key out; JSON drops it andtoEqualreads it as absent.src/core/usage/read-events.ts#relayedGrantFor:<to<=in choosing the relayed grant nearest the handover; two grants exactly as far apart in time on either side pick the later instead of the earlier, and a lease id reused after a release cannot have both within the same millisecond of the handover.src/core/usage/read-events.ts#heldFor:e.index > grant.indexto>=; the grant and an end are different events, so they never share an index.src/core/usage/read-events.ts: thetypeofcheck beforeNumber.isFiniteor!== nullinnumberandobjectOf; a missing request id stored underundefined(request.granted's three-way check and the worker grant'srequestId), which no lookup reads; a worker-less device event addingundefinedto a set only read by string keys, or testingworker !== undefinedbefore a map write that is only read by string keys;!this.#counts(seen) || (incident === undefined && !failure)with its second half false, which then adds nothing;candidate.index >= request.index(two events never share an index).src/core/usage/usage-reader.ts:oldestTs !== undefined &&beforeoldestTs > asked.to(undefined > nis false); a missing prefix compared as the string"undefined"; a label stored asundefined; all read as no label.src/contract/errors.ts: the value in aRecord<_, true>whose keys are read, not its values.Written by an agent.