-function make_status_cpu( load, temp, fan) {
- load = Data_get("khatus_sensor_loadavg" , "load_avg_1min", 5)
- temp = Data_get("khatus_sensor_temperature", "temp_c" , 5)
- fan = Data_get("khatus_sensor_fan" , "speed" , 5)
-
- load = load ? sprintf("%4.2f", load) : "--"
- temp = temp ? sprintf("%d" , temp) : "--"
- fan = fan ? sprintf("%4d" , fan) : "--"
-
- return sprintf("C=[%s %s°C %srpm]", load, temp, fan)
+function make_status_procs() {
+ src = "khatus_sensor_procs"
+ all = cache_get_fmt_def(src, "total_procs" , 15, "%d")
+ r = cache_get_fmt_def(src, "total_per_state" Kfs "R", 15, "%d", "0")
+ d = cache_get_fmt_def(src, "total_per_state" Kfs "D", 15, "%d", "0")
+ t = cache_get_fmt_def(src, "total_per_state" Kfs "T", 15, "%d", "0")
+ i = cache_get_fmt_def(src, "total_per_state" Kfs "I", 15, "%d", "0")
+ z = cache_get_fmt_def(src, "total_per_state" Kfs "Z", 15, "%d", "0")
+ return sprintf("P=[%s %sr %sd %st %si %sz]", all, r, d, t, i, z)