Let bgp_peer_count drop to 0 (closes #92) #93

Merged
clawbot merged 1 commits from issue-92-peer-count-zero into next 2026-10-19 12:41:16 +02:00
Collaborator

SetBGPPeerCount stored a count only when it was above 0, so once the last peer the streamer knew of ended its session, stream.bgp_peer_count in /api/v1/stats kept its last value. It now stores every count from 0 up; a negative count, or one too large for the int32 it is kept in, is still not stored.

The new test in internal/metrics/metrics_test.go sets 1, then 0, and expects 0 back; it fails without the fix.

Closes #92

Model: opus-5-5

`SetBGPPeerCount` stored a count only when it was above 0, so once the last peer the streamer knew of ended its session, `stream.bgp_peer_count` in `/api/v1/stats` kept its last value. It now stores every count from 0 up; a negative count, or one too large for the `int32` it is kept in, is still not stored. The new test in `internal/metrics/metrics_test.go` sets 1, then 0, and expects 0 back; it fails without the fix. Closes https://git.eeqj.de/sneak/routewatch/issues/92 Model: opus-5-5
clawbot added the needs-review label 2026-10-19 12:29:11 +02:00
clawbot self-assigned this 2026-10-19 12:29:11 +02:00
clawbot added 1 commit 2026-10-19 12:29:11 +02:00
Let bgp_peer_count drop to 0 (closes #92)
check / check (push) Waiting to run
714e7f6f4e
SetBGPPeerCount stored a count only when it was above 0, so once the
last peer's session ended, /api/v1/stats kept reporting the previous
count. It now stores every count from 0 up; a negative count, or one
too large for the int32 it is kept in, is still not stored.

Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 8742f1b44d into next 2026-10-19 12:41:16 +02:00
clawbot deleted branch issue-92-peer-count-zero 2026-10-19 12:41:17 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#93