Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
-open ExtList
open Curses
open Printf
if r <> 0 then r
else compare name1 name2
in
- List.sort ~cmp doms in
+ List.sort cmp doms in
(* Print domains. *)
attron A.reverse;
| (name, Active rd) :: doms ->
if lineno < lines then (
let state = show_state rd.rd_info.D.state in
- let rd_req = Show.int64_option rd.rd_block_rd_info in
- let wr_req = Show.int64_option rd.rd_block_wr_info in
+ let rd_info =
+ if block_in_bytes then Show.int64_option rd.rd_block_rd_bytes
+ else Show.int64_option rd.rd_block_rd_reqs in
+ let wr_info =
+ if block_in_bytes then Show.int64_option rd.rd_block_wr_bytes
+ else Show.int64_option rd.rd_block_wr_reqs in
let rx_bytes = Show.int64_option rd.rd_net_rx_bytes in
let tx_bytes = Show.int64_option rd.rd_net_tx_bytes in
let percent_cpu = Show.percent rd.rd_percent_cpu in
let line =
sprintf "%5d %c %s %s %s %s %s %s %s %s"
- rd.rd_domid state rd_req wr_req rx_bytes tx_bytes
+ rd.rd_domid state rd_info wr_info rx_bytes tx_bytes
percent_cpu percent_mem time name in
let line = pad cols line in
mvaddstr lineno 0 line;
if r <> 0 then r
else compare (dev1, name1) (dev2, name2)
in
- List.sort ~cmp devs in
+ List.sort cmp devs in
(* Print the header for network devices. *)
attron A.reverse;
if r <> 0 then r
else compare (dev1, name1) (dev2, name2)
in
- List.sort ~cmp devs in
+ List.sort cmp devs in
(* Print the header for block devices. *)
attron A.reverse;
(* Time to grab another historical %CPU for the list? *)
if time >= !historical_cpu_last_time +. float historical_cpu_delay
then (
- historical_cpu := percent_cpu :: List.take 10 !historical_cpu;
+ historical_cpu := percent_cpu :: list_take 10 !historical_cpu;
historical_cpu_last_time := time
);