v0.3.0 99dc266

diagnostics.go RawHistoryFolder

1package dgram
2
3import (
4	"log/slog"
5	"time"
6
7	"github.com/bnema/vev/internal/ports"
8)
9
10const diagnosticBufferSize = 16
11
12// Diagnostic is an immutable, privacy-safe snapshot of UDP link health.
13// It intentionally contains no packet payloads, addresses, keys, or identities.
14type Diagnostic struct {
15	At                       time.Time
16	State                    ports.LinkState
17	SinceAuthenticatedPacket time.Duration
18	SinceCompleteRecord      time.Duration
19	SinceACKProgress         time.Duration
20	PendingRecords           int
21	PendingBytes             int
22	Retransmits              uint64
23	ReassemblyInflight       int
24}
25
26// DiagnosticObserver receives bounded asynchronous UDP health snapshots.
27type DiagnosticObserver func(Diagnostic)
28
29// DiagnosticLogObserver returns an observer suitable for composition roots. It
30// logs only the privacy-safe diagnostic counters and ages.
31func DiagnosticLogObserver(log *slog.Logger) DiagnosticObserver {
32	if log == nil {
33		return nil
34	}
35	return func(d Diagnostic) {
36		log.Debug("udp health",
37			"state", d.State,
38			"since_authenticated_packet", d.SinceAuthenticatedPacket,
39			"since_complete_record", d.SinceCompleteRecord,
40			"since_ack_progress", d.SinceACKProgress,
41			"pending_records", d.PendingRecords,
42			"pending_bytes", d.PendingBytes,
43			"retransmits", d.Retransmits,
44			"reassembly_inflight", d.ReassemblyInflight,
45		)
46	}
47}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close