Cable verdict folded into one console cell (length green, fault name red, xover amber, fail; diag rule lines and counters-reset line gone), reset fires at the press not diag completion, and the measure's blip is suppressed at every counter source instead of counted-hidden-reverted: worker error adds, loss-window write-offs (quiet slides state without charging; leaving the quiet era presumes in-window holes delivered so the gap's tail is never charged late), NIC poller tracks raw without accumulating, socket drops discarded, modules un-primed by the measure itself; display hold deleted so pre-existing errors no longer blink out during a measure
This commit is contained in:
+14
-10
@@ -105,13 +105,14 @@ func sumFields(base string, fields []string) uint64 {
|
||||
const nicInterval = sampleInterval
|
||||
|
||||
type nicPoller struct {
|
||||
txBase string
|
||||
rx *statReader
|
||||
total *atomic.Uint64
|
||||
raw uint64
|
||||
txBase string
|
||||
rx *statReader
|
||||
total *atomic.Uint64
|
||||
measuring *atomic.Bool
|
||||
raw uint64
|
||||
}
|
||||
|
||||
func newNICPoller(fd int, txName, rxName string, total *atomic.Uint64) (*nicPoller, error) {
|
||||
func newNICPoller(fd int, txName, rxName string, total *atomic.Uint64, measuring *atomic.Bool) (*nicPoller, error) {
|
||||
drv, err := ifDriver(rxName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -125,9 +126,10 @@ func newNICPoller(fd int, txName, rxName string, total *atomic.Uint64) (*nicPoll
|
||||
return nil, err
|
||||
}
|
||||
return &nicPoller{
|
||||
txBase: "/sys/class/net/" + txName,
|
||||
rx: rx,
|
||||
total: total,
|
||||
txBase: "/sys/class/net/" + txName,
|
||||
rx: rx,
|
||||
total: total,
|
||||
measuring: measuring,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -142,10 +144,12 @@ func (p *nicPoller) read() uint64 {
|
||||
// Nic counters run from boot and restart from zero whenever the driver resets
|
||||
// its statistics, so only their forward motion is accumulated. Taking raw
|
||||
// differences instead charges a boot's worth of errors to the first sample and
|
||||
// turns a reset into a near-2^64 underflow.
|
||||
// turns a reset into a near-2^64 underflow. The hardware cannot pause its
|
||||
// counters for a cable measure, so its blip is suppressed here at the read:
|
||||
// the baseline tracks the raw values without accumulating until it is over.
|
||||
func (p *nicPoller) poll() {
|
||||
raw := p.read()
|
||||
if raw > p.raw {
|
||||
if raw > p.raw && !p.measuring.Load() {
|
||||
p.total.Add(raw - p.raw)
|
||||
}
|
||||
p.raw = raw
|
||||
|
||||
Reference in New Issue
Block a user