Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dcf2e8aa3d |
@@ -82,8 +82,8 @@ Every route answers `HEAD` as it answers `GET`, without the body.
|
||||
|
||||
- `GET /api/v1/stats` - The `/status.json` figures plus connection, garbage
|
||||
collector, stream and handler queue statistics. `stream.route_churn_per_min`
|
||||
counts the prefixes announced or withdrawn in the last full minute of the
|
||||
clock.
|
||||
is the number of prefix announcements and withdrawals, from all peers, in the
|
||||
last full clock minute.
|
||||
- `GET /api/v1/ip/{ip}` - Looks up each address: its most specific live route
|
||||
(`netblock`), that route's origin AS with its WHOIS details, and the address's
|
||||
PTR names. `{ip}` is an IP address, a host name, or a comma-separated list of
|
||||
|
||||
@@ -33,11 +33,11 @@ tested.
|
||||
|
||||
# Completed Steps
|
||||
|
||||
- 2026-10-26: the status page shows "Route Churn/min", the whole number of
|
||||
prefixes announced or withdrawn in the last full minute. `/api/v1/stats`
|
||||
reports it as `route_churn_per_min` in `stream`, which replaces the moving
|
||||
average `route_churn_per_sec`. The messages and updates per second on `/` and
|
||||
`/status` are whole numbers (closes #160)
|
||||
- 2026-10-26: the status page shows "Route Churn/min", the number of prefix
|
||||
announcements and withdrawals, from all peers, in the last full clock minute.
|
||||
`/api/v1/stats` reports it as `route_churn_per_min` in `stream`, which
|
||||
replaces the moving average `route_churn_per_sec`. The messages and updates
|
||||
per second on `/` and `/status` are whole numbers (closes #160)
|
||||
- 2026-10-26: the WHOIS fetcher backs off more slowly. A failure makes its wait
|
||||
1.5 times as long, up to one minute instead of five. Its queries to RIPE,
|
||||
APNIC and AFRINIC leave out person and role objects, which RIPE counts against
|
||||
|
||||
@@ -34,7 +34,7 @@ type Tracker struct {
|
||||
// Announcement/withdrawal metrics
|
||||
announcementCounter metrics.Counter
|
||||
withdrawalCounter metrics.Counter
|
||||
churnPerMinute minuteCounter // announced and withdrawn prefixes
|
||||
churnPerMinute minuteCounter // prefix announcements and withdrawals
|
||||
|
||||
// BGP peer tracking
|
||||
bgpPeerCount atomic.Int32
|
||||
@@ -198,8 +198,8 @@ func (t *Tracker) GetWithdrawalCount() uint64 {
|
||||
return uint64(count)
|
||||
}
|
||||
|
||||
// GetChurnPerMinute returns the number of prefixes announced or withdrawn in
|
||||
// the last full minute of the clock.
|
||||
// GetChurnPerMinute returns the number of prefix announcements and
|
||||
// withdrawals, from all peers, in the last full clock minute.
|
||||
func (t *Tracker) GetChurnPerMinute() int {
|
||||
return t.churnPerMinute.lastFullMinute()
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// minuteCounter counts events in each minute of the clock and reports the
|
||||
// count of the last full minute. It is safe for concurrent use.
|
||||
// minuteCounter counts events in each clock minute and reports the count of
|
||||
// the last full minute. It is safe for concurrent use.
|
||||
type minuteCounter struct {
|
||||
mu sync.Mutex
|
||||
now func() time.Time
|
||||
|
||||
@@ -44,6 +44,12 @@ func TestChurnPerMinuteCountsLastFullMinute(t *testing.T) {
|
||||
now = time.Date(2026, 10, 26, 12, 4, 0, 0, time.UTC)
|
||||
|
||||
expectChurn(0, "12:03 had none")
|
||||
|
||||
tracker.RecordWithdrawal()
|
||||
|
||||
now = time.Date(2026, 10, 26, 12, 6, 0, 0, time.UTC)
|
||||
|
||||
expectChurn(0, "12:05 had none, though 12:04 had one withdrawal")
|
||||
}
|
||||
|
||||
// TestChurnPerMinuteCountsConcurrentRecords announces prefixes from several
|
||||
|
||||
Reference in New Issue
Block a user