indicator for disk io: less than perfect, better than nothing
This commit is contained in:
parent
4ba657c98f
commit
448a0317fb
@ -29,6 +29,19 @@
|
|||||||
:classes ["hey"]
|
:classes ["hey"]
|
||||||
:indicators
|
: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)]
|
(let [f (io.open "/tmp/statuspipe" :r)]
|
||||||
(fcntl.fcntl (posix.stdio.fileno f)
|
(fcntl.fcntl (posix.stdio.fileno f)
|
||||||
fcntl.F_SETFL fcntl.O_NONBLOCK)
|
fcntl.F_SETFL fcntl.O_NONBLOCK)
|
||||||
|
Loading…
Reference in New Issue
Block a user