commit 448a0317fb7cdbd8ed4929e2da5fb4b88d507e07 parent 4ba657c98f4ef86bba457191de480bfe07c27db7 Author: Daniel Barlow <dan@telent.net> Date: Sun, 27 Mar 2022 16:24:00 +0100 indicator for disk io: less than perfect, better than nothing Diffstat:
| M | blinkenlicht/bl.fnl | | | 13 | +++++++++++++ |
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/blinkenlicht/bl.fnl b/blinkenlicht/bl.fnl @@ -29,6 +29,19 @@ :classes ["hey"] :indicators [ + (let [] + (var previous 0) + ;; on my laptop, adding this indicator has made the task + ;; go from ~ 1% cpu to around 3%, which is not ideal + (indicator { + :wait-for { :interval (* 1 500) } + :refresh + #(let [current (. (metric.cpustat) :iowait) + v (if (< previous current) "" " ")] + (set previous current) + {:text v}) + })) + (let [f (io.open "/tmp/statuspipe" :r)] (fcntl.fcntl (posix.stdio.fileno f) fcntl.F_SETFL fcntl.O_NONBLOCK)