Add WHOIS stats to status page with adaptive fetcher improvements
- Add WHOIS Fetcher card showing fresh/stale/never-fetched ASN counts - Display hourly success/error counts and current fetch interval - Increase max WHOIS rate to 1/sec (down from 10 sec minimum) - Select random stale ASN instead of oldest for better distribution - Add index on whois_updated_at for query performance - Track success/error timestamps for hourly stats - Add GetWHOISStats database method for freshness statistics
This commit is contained in:
@@ -13,9 +13,18 @@ import (
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
// ASNFetcherStats contains WHOIS fetcher statistics.
|
||||
type ASNFetcherStats struct {
|
||||
SuccessesLastHour int
|
||||
ErrorsLastHour int
|
||||
CurrentInterval time.Duration
|
||||
ConsecutiveFails int
|
||||
}
|
||||
|
||||
// ASNFetcher is an interface for queuing ASN WHOIS lookups.
|
||||
type ASNFetcher interface {
|
||||
QueueImmediate(asn int)
|
||||
GetStats() ASNFetcherStats
|
||||
}
|
||||
|
||||
// Server provides HTTP endpoints for status monitoring
|
||||
|
||||
Reference in New Issue
Block a user