diff --git a/AGENTS.md b/AGENTS.md index 2f5ab60c..031cd845 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -284,7 +284,8 @@ narratives and test notes, is `docs/reference/mcde-agents-history-2026-11-13.txt a process that ignores SIGTERM survives Quit and dies of Force Quit. Not built yet: Show "with window", the global menu, Cmd+F and Cmd+1..5, the administrator's way for another user's process (t0079: it says "belongs to - somebody else"), a legend for the graph colours, and the dtappscan entry. + somebody else") and the dtappscan entry. Each tab says in a line what its + colours are; the Disk and Network graphs scale to the highest stacked second. The NetBSD backends of the numbers were never run. - **Device events** (`mcde_sys_disk_events`, `lib/McdeSys/events.c`): a non-blocking descriptor of the kernel's uevent socket (Linux, AF_NETLINK diff --git a/programs/dtactivity/dtactivity.c b/programs/dtactivity/dtactivity.c index 2da1e0fe..321282f9 100644 --- a/programs/dtactivity/dtactivity.c +++ b/programs/dtactivity/dtactivity.c @@ -538,17 +538,17 @@ Columns(Display *dpy, Window win, int w, int h, const double *a, } } +/* the highest column of two stacked histories: what the graph must hold */ static double Peak(const double *a, const double *b) { - double m = 0; + double m = 0, v; int i; for (i = 0; i < HISTORY; i++) { - if (a[i] > m) - m = a[i]; - if (b != NULL && b[i] > m) - m = b[i]; + v = a[i] + (b != NULL ? b[i] : 0); + if (v > m) + m = v; } return m; } @@ -563,8 +563,9 @@ DrawValues(void) case TAB_CPU: snprintf(text, sizeof text, "%% User: %5.2f %% System: " "%5.2f %% Nice: %5.2f %% Idle: %5.2f\nThreads: %ld" - " Processes: %lu", lastUser, lastSystem, lastNice, - lastIdle, nthreads, (unsigned long) nall); + " Processes: %lu\nGraph: blue user, red system, green " + "nice", lastUser, lastSystem, lastNice, lastIdle, nthreads, + (unsigned long) nall); break; case TAB_MEMORY: Human(mem.free, a, sizeof a); @@ -576,7 +577,8 @@ DrawValues(void) Human(mem.swap_used, a, sizeof a); Human(mem.swap_total, b, sizeof b); snprintf(text + strlen(text), sizeof text - strlen(text), - "\nSwap used: %s of %s", a, b); + "\nSwap used: %s of %s\nGraph: blue used, red cached " + "(the rest is free)", a, b); break; case TAB_DISK: Human((unsigned long long) rateDiskR, a, sizeof a); @@ -584,7 +586,9 @@ DrawValues(void) Human(totalDiskR, c, sizeof c); Human(totalDiskW, d, sizeof d); snprintf(text, sizeof text, "Reading: %s/s Writing: %s/s" - "\nRead in all: %s Written in all: %s", a, b, c, d); + "\nRead in all: %s Written in all: %s\nGraph: blue " + "reading, red writing (scaled to the highest second)", a, b, + c, d); break; default: Human((unsigned long long) rateNetR, a, sizeof a); @@ -592,7 +596,9 @@ DrawValues(void) Human(totalNetR, c, sizeof c); Human(totalNetT, d, sizeof d); snprintf(text, sizeof text, "Receiving: %s/s Sending: %s/s" - "\nReceived in all: %s Sent in all: %s", a, b, c, d); + "\nReceived in all: %s Sent in all: %s\nGraph: blue " + "receiving, red sending (scaled to the highest second)", a, + b, c, d); break; } SetLabel(values, text);