plans: the interface counters can never be zeroed, and the console has no clear counters #1945
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1945
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "plan/1118-0626"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A forward plan, no code.
docs/plans/counter-reset.md.What exists today, with evidence. The per-port tally is
portCounters()(engine/flow.js:516), its empty shapeemptyPort()(:382), and the copy the API publishescounterSnapshot()(:403->server/index.js:404,:1293). The console prints the two lines atengine/cli.js:5914-5915. The only reset that exists isresetFlowState()(engine/flow.js:366), called fromserver/index.js:1440when a topology replaces its flow state.What is missing, ranked. (1) nothing zeroes a tally, so after an ACL fix or a cable move the block mixes both runs - and
docs/CLI.md:647promises counters behave "like real interface counters", the one property they lack; (2) the block that prints the number never says how to zero it, andEXEC_WORDS(engine/cli.js:76-89) has noclearword; (3) no client can zero them.Steps, each one PR. 1. engine
clearPortCounters()that deletes the port row rather than writingemptyPort()(the payload rule atdocs/CLI.md:681is that a port which has counted nothing is absent). 2.clear counters [<port>]in EXEC, port resolved byresolvePortName, plus_help()and docs. 3. theshow interfacesblock signposts how to zero what it printed. 4. an API route, needs Jay's approval.Risks. The clear belongs to the topology, not the session (
server/index.js:1083), so it is visible to every reader of that lab - documented and pinned. Device totals and port rows will disagree after a clear by design (countDrop()increments both,:538); step 1 documents that instead of recomputing. A real box asks[confirm], and this console has no prompt machinery, so the ack says what it did.Left out deliberately. Rates and an epoch (the only clock is
runAtMs,Infinityunless a run pinned an instant), the MTU/bandwidth header lines (engine/device.js:90holdsmtuand nothing prints or sets it), the[confirm]interaction, and the sibling clear families.Closes no open issue - the queue is five blocked device requests (#130, #803, #807, #808, #810), none about the console.
clear countersa83e0e5e43125743be11