Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package chronytop for openSUSE:Factory checked in at 2026-11-30 14:25:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/chronytop (Old) and /work/SRC/openSUSE:Factory/.chronytop.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "chronytop" Mon Nov 30 14:25:57 2026 rev:2 rq:1401403 version:0.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/chronytop/chronytop.changes 2026-11-28 23:27:06.275202170 +0100 +++ /work/SRC/openSUSE:Factory/.chronytop.new.1340718/chronytop.changes 2026-11-30 14:28:12.164484742 +0100 @@ -1,0 +2,10 @@ +Sun Nov 29 06:25:28 UTC 2026 - Martin Pluskal <[email protected]> + +- Update to 0.7.0: + * Space out offender fetches on busy servers: fetches now wait + at least 20x as long as the last one took, using at most + about 5% of the time however long the client list is + * Raise the default offenders threshold to 1000 packets, as + packet counts are cumulative since chronyd started + +------------------------------------------------------------------- Old: ---- v0.6.2.tar.gz New: ---- v0.7.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ chronytop.spec ++++++ --- /var/tmp/diff_new_pack.iRV55o/_old 2026-11-30 14:28:14.453581386 +0100 +++ /var/tmp/diff_new_pack.iRV55o/_new 2026-11-30 14:28:14.457581555 +0100 @@ -17,7 +17,7 @@ Name: chronytop -Version: 0.6.2 +Version: 0.7.0 Release: 0 Summary: TUI for chrony NTP time server monitoring License: MIT ++++++ v0.6.2.tar.gz -> v0.7.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chronytop-0.6.2/README.md new/chronytop-0.7.0/README.md --- old/chronytop-0.6.2/README.md 2026-11-27 17:39:02.000000000 +0100 +++ new/chronytop-0.7.0/README.md 2026-11-29 04:50:53.000000000 +0100 @@ -44,7 +44,7 @@ | Option | Default | Description | | --- | --- | --- | | `-i` | `1s` | Sample interval (500ms to 10s) | -| `-p` | `100` | Minimum packets for a client to be listed in offenders | +| `-p` | `1000` | Minimum packets since chronyd started for a client to be listed in offenders | | `-socket` | `/var/run/chrony/chronyd.sock` | chronyd's Unix command socket (if chronyd's is elsewhere, e.g. under `/opt` with Entware) | | `-host` | | Monitor chronyd over UDP instead: host, `host:port` or `[IPv6]:port` (default port 323) | | `-version` | | Print the version and exit | @@ -59,7 +59,7 @@ Visible panels and the sample interval are saved when you quit, to `~/.config/chronytop/chronytop.conf` (`/root/.config/...` when run with `sudo`), and restored on the next run. `-i` overrides the saved interval. -The offenders list is refreshed every 10 seconds in the background. chronyd filters clients by `-p` itself, so the list stays cheap to fetch on busy public servers with hundreds of thousands of clients. +The offenders list is refreshed in the background, every 10 seconds or less often on busy servers (see [Performance](#performance)). ### Remote monitoring @@ -73,6 +73,15 @@ `opencommands` (chrony 4.7+) replaces the defaults, so the list repeats them before adding `serverstats` and `clients`. The net and system panels aren't shown for remote hosts. +## Performance + +Most of chronytop's CPU use, and chronyd's while it runs, goes to fetching the offenders list: chronyd returns 8 clients per reply, so a list of 100,000 clients takes about 12,500 round trips. chronytop spaces fetches so they take at most 1/20 of the time (every 10 seconds, or longer if a fetch takes more than half a second), and the footer shows the current interval. + +On very busy servers, you can cut the cost further: + +- **Raise `-p`** (e.g. `-p 10000`): chronyd filters by packet count itself, so fewer clients are listed and fetched. The count is cumulative since chronyd started, so a regular client polling every 64 seconds passes 1000 in under a day. +- **Hide the offenders panel** (press `3`): chronytop doesn't fetch the list while the panel is hidden, and remembers that next time. + ## Running without root If chronyd's Unix socket isn't at the default path or isn't accessible, chronytop uses UDP on localhost, like `chronyc`. That shows everything except the server and offenders panels, since chronyd only answers `serverstats` and `clients` over UDP if allowed: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chronytop-0.6.2/chronytop_test.go new/chronytop-0.7.0/chronytop_test.go --- old/chronytop-0.6.2/chronytop_test.go 2026-11-27 17:39:02.000000000 +0100 +++ new/chronytop-0.7.0/chronytop_test.go 2026-11-29 04:50:53.000000000 +0100 @@ -194,3 +194,12 @@ } } } + +func TestClientsEvery(t *testing.T) { + for took, want := range map[time.Duration]time.Duration{ + 50 * time.Millisecond: clientsInterval, time.Second: 20 * time.Second, 3 * time.Second: time.Minute} { + if got := clientsEvery(took); got != want { + t.Errorf("clientsEvery(%v) = %v, want %v", took, got, want) + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chronytop-0.6.2/main.go new/chronytop-0.7.0/main.go --- old/chronytop-0.6.2/main.go 2026-11-27 17:39:02.000000000 +0100 +++ new/chronytop-0.7.0/main.go 2026-11-29 04:50:53.000000000 +0100 @@ -17,7 +17,7 @@ var version = "dev" const ( - clientsInterval = 10 * time.Second + clientsInterval = 10 * time.Second // minimum; see clientsEvery minInterval = 500 * time.Millisecond maxInterval = 10 * time.Second ) @@ -52,7 +52,7 @@ func main() { interval := flag.Duration("i", time.Second, "sample interval (500ms to 10s)") - minPackets := flag.Int("p", 100, "minimum packets for a client to be listed in offenders") + minPackets := flag.Int("p", 1000, "minimum packets (since chronyd started) for a client to be listed in offenders") socketPath := flag.String("socket", defaultSocket, "absolute path to chronyd's Unix command socket") udpHost := flag.String("host", "", "monitor chronyd over UDP: hostname, IP, or host:port (default port 323)") showVersion := flag.Bool("version", false, "print the version and exit") @@ -146,9 +146,15 @@ type clientsResult struct { clients []Client total int + took time.Duration err error } +// clientsEvery spaces client fetches so they take at most 1/20 of the time. +func clientsEvery(took time.Duration) time.Duration { + return max(clientsInterval, (20 * took).Round(time.Second)) +} + func (a *App) run() { ctx, cancel := context.WithCancel(context.Background()) sampler := &chronySession{network: a.network, address: a.address, fallback: a.fallback} @@ -181,13 +187,15 @@ workers.Add(1) go func() { defer workers.Done() + start := time.Now() c, err := clientSession.clients(ctx, minPackets) - results <- clientsResult{topOffenders(c), len(c), err} + results <- clientsResult{topOffenders(c), len(c), time.Since(start), err} }() } timer.Reset(a.interval) case r := <-results: - fetching, nextClients = false, time.Now().Add(clientsInterval) + a.stats.ClientsEvery = clientsEvery(r.took) + fetching, nextClients = false, time.Now().Add(a.stats.ClientsEvery) a.stats.Clients, a.stats.ClientsTotal, a.stats.ClientsErr, a.stats.ClientsAt = r.clients, r.total, r.err, time.Now() case k, ok := <-keys: if !ok || a.handleKey(k) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chronytop-0.6.2/panels.go new/chronytop-0.7.0/panels.go --- old/chronytop-0.6.2/panels.go 2026-11-27 17:39:02.000000000 +0100 +++ new/chronytop-0.7.0/panels.go 2026-11-29 04:50:53.000000000 +0100 @@ -164,7 +164,7 @@ }) } return append(lines, line{{fmt.Sprintf("%d clients with ≥%d packets, every %s", - st.ClientsTotal, minPackets, clientsInterval), dim}}) + st.ClientsTotal, minPackets, fmtDur(max(st.ClientsEvery, clientsInterval).Seconds())), dim}}) } func sourcesLines(st *Stats, w int) []line { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/chronytop-0.6.2/stats.go new/chronytop-0.7.0/stats.go --- old/chronytop-0.6.2/stats.go 2026-11-27 17:39:02.000000000 +0100 +++ new/chronytop-0.7.0/stats.go 2026-11-29 04:50:53.000000000 +0100 @@ -32,6 +32,7 @@ Server []float64 Clients []Client // top offenders, sorted ClientsTotal int + ClientsEvery time.Duration ClientsErr error ClientsAt time.Time Net []float64
