X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fredraw.ml;h=0403158dd30a759eacc3a9a10b4024fa90caf95f;hb=HEAD;hp=9ce889bd51d21ef933667a27bd6e61a71d365d2c;hpb=90d14bc151e488972d33eefaac2242d9a6e07578;p=virt-top.git diff --git a/src/redraw.ml b/src/redraw.ml index 9ce889b..7031e66 100644 --- a/src/redraw.ml +++ b/src/redraw.ml @@ -17,7 +17,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *) -open ExtList open Curses open Printf @@ -137,7 +136,7 @@ let redraw display_mode sort_order 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; @@ -155,8 +154,12 @@ let redraw display_mode sort_order | (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 @@ -166,7 +169,7 @@ let redraw display_mode sort_order 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; @@ -312,7 +315,7 @@ let redraw display_mode sort_order 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; @@ -424,7 +427,7 @@ let redraw display_mode sort_order 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; @@ -487,7 +490,7 @@ let redraw display_mode sort_order (* 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 );