Add status page enhancements with new metrics and footer
- Add GC statistics (run count, total/last pause, heap usage) - Add BGP peer count tracking from RIS Live OPEN/NOTIFICATION messages - Add route churn rate metric (announcements + withdrawals per second) - Add announcement and withdrawal counters - Add footer with attribution, license, and git revision - Embed git revision at build time via ldflags - Update HTML template to display all new metrics
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
"net/url"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.eeqj.de/sneak/routewatch/internal/version"
|
||||
)
|
||||
|
||||
//go:embed status.html
|
||||
@@ -86,12 +88,19 @@ func initTemplates() {
|
||||
|
||||
// Create common template functions
|
||||
funcs := template.FuncMap{
|
||||
"timeSince": timeSince,
|
||||
"urlEncode": url.QueryEscape,
|
||||
"timeSince": timeSince,
|
||||
"urlEncode": url.QueryEscape,
|
||||
"appName": func() string { return version.Name },
|
||||
"appAuthor": func() string { return version.Author },
|
||||
"appAuthorURL": func() string { return version.AuthorURL },
|
||||
"appLicense": func() string { return version.License },
|
||||
"appRepoURL": func() string { return version.RepoURL },
|
||||
"appGitRevision": func() string { return version.GitRevisionShort },
|
||||
"appGitCommitURL": func() string { return version.CommitURL() },
|
||||
}
|
||||
|
||||
// Parse status template
|
||||
defaultTemplates.Status, err = template.New("status").Parse(statusHTML)
|
||||
defaultTemplates.Status, err = template.New("status").Funcs(funcs).Parse(statusHTML)
|
||||
if err != nil {
|
||||
panic("failed to parse status template: " + err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user