Remove routing table and snapshotter packages, update status page
- Remove routingtable package entirely as database handles all routing data - Remove snapshotter package as database contains all information - Rename 'Connection Status' box to 'RouteWatch' and add Go version, goroutines, memory usage - Move IPv4/IPv6 prefix counts from Database Statistics to Routing Table box - Add Peers count to Database Statistics box - Add go-humanize dependency for memory formatting - Update server to include new metrics in API responses
This commit is contained in:
@@ -396,6 +396,12 @@ func (d *Database) GetStats() (Stats, error) {
|
||||
return stats, err
|
||||
}
|
||||
|
||||
// Count peers
|
||||
err = d.queryRow("SELECT COUNT(*) FROM bgp_peers").Scan(&stats.Peers)
|
||||
if err != nil {
|
||||
return stats, err
|
||||
}
|
||||
|
||||
// Get database file size
|
||||
fileInfo, err := os.Stat(d.path)
|
||||
if err != nil {
|
||||
|
||||
@@ -11,6 +11,7 @@ type Stats struct {
|
||||
IPv4Prefixes int
|
||||
IPv6Prefixes int
|
||||
Peerings int
|
||||
Peers int
|
||||
FileSizeBytes int64
|
||||
LiveRoutes int
|
||||
IPv4PrefixDistribution []PrefixDistribution
|
||||
|
||||
Reference in New Issue
Block a user