Refresh rate is honoured exactly everywhere: no list floor, sampler up to 10 s, server caches reduced to coalescing only
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
bbf0f2580f
commit
4b8a2b15ed
@@ -390,7 +390,7 @@ var cronLogRe = regexp.MustCompile(`^\((\S+)\) CMD \((.*)\)$`)
|
||||
// lastRunsFromJournal maps user+command to the most recent "(user) CMD (command)" line.
|
||||
func (m *Manager) lastRunsFromJournal(ctx context.Context) map[string]int64 {
|
||||
m.mu.Lock()
|
||||
if time.Since(m.lastAt) < 60*time.Second && m.lastRuns != nil {
|
||||
if time.Since(m.lastAt) < 5*time.Second && m.lastRuns != nil {
|
||||
r := m.lastRuns
|
||||
m.mu.Unlock()
|
||||
return r
|
||||
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
const (
|
||||
DefaultInterval = 2 * time.Second
|
||||
MinInterval = 100 * time.Millisecond
|
||||
MaxInterval = 2 * time.Second
|
||||
MaxInterval = 10 * time.Second
|
||||
History = 300 // samples kept; the window is History × interval (30 s at 100 ms, 10 min at 2 s)
|
||||
fsEvery = 30 * time.Second // filesystem usage changes slowly and statfs on network mounts isn't free
|
||||
upsEvery = 10 * time.Second // UPS daemons are an exec each; don't hammer them at fast intervals
|
||||
@@ -982,7 +982,7 @@ func (c *Collector) Processes() ProcTable {
|
||||
c.prevProc = map[int]procTimes{}
|
||||
c.procInfo = map[int]procStatic{}
|
||||
}
|
||||
if now.Sub(c.procAt) < 500*time.Millisecond && c.lastTable != nil { // coalesce bursts of clients
|
||||
if now.Sub(c.procAt) < 100*time.Millisecond && c.lastTable != nil { // coalesce simultaneous clients only
|
||||
return *c.lastTable
|
||||
}
|
||||
ents, err := os.ReadDir("/proc")
|
||||
|
||||
@@ -107,7 +107,7 @@ func run(ctx context.Context, args ...string) (string, error) {
|
||||
// Cached for a few seconds because the UI polls it.
|
||||
func (m *Manager) List(ctx context.Context) ([]Unit, error) {
|
||||
m.mu.Lock()
|
||||
if time.Since(m.cacheAt) < 4*time.Second && m.cache != nil {
|
||||
if time.Since(m.cacheAt) < 200*time.Millisecond && m.cache != nil { // coalesce simultaneous clients only
|
||||
c := m.cache
|
||||
m.mu.Unlock()
|
||||
return c, nil
|
||||
|
||||
Reference in New Issue
Block a user