(* The following are since the last slice, or None if cannot be calc'd: *)
rd_block_rd_reqs : int64 option; (* Number of block device read rqs. *)
rd_block_wr_reqs : int64 option; (* Number of block device write rqs. *)
- rd_block_rd_bytes : int64 option; (* Number of bytes block device read *)
- rd_block_wr_bytes : int64 option; (* Number of bytes block device write *)
- (* _info fields includes the number considering --block_in_bytes option *)
- rd_block_rd_info : int64 option; (* Block device read info for user *)
- rd_block_wr_info : int64 option; (* Block device read info for user *)
-
+ rd_block_rd_bytes : int64 option; (* Number of bytes block device read *)
+ rd_block_wr_bytes : int64 option; (* Number of bytes block device write *)
rd_net_rx_bytes : int64 option; (* Number of bytes received. *)
rd_net_tx_bytes : int64 option; (* Number of bytes transmitted. *)
}
let clear_pcpu_display_data () =
Hashtbl.clear last_pcpu_usages
-let collect (conn, _, _, _, _, node_info, _, _) block_in_bytes =
+let collect (conn, _, _, _, _, node_info, _, _) =
(* Number of physical CPUs (some may be disabled). *)
let nr_pcpus = C.maxcpus_of_node_info node_info in
rd_mem_bytes = 0L; rd_mem_percent = 0L;
rd_block_rd_reqs = None; rd_block_wr_reqs = None;
rd_block_rd_bytes = None; rd_block_wr_bytes = None;
- rd_block_rd_info = None; rd_block_wr_info = None;
rd_net_rx_bytes = None; rd_net_tx_bytes = None;
})
with
rd_block_rd_bytes = Some read_bytes;
rd_block_wr_bytes = Some write_bytes;
} in
- let rd = { rd with
- rd_block_rd_info =
- if block_in_bytes then
- rd.rd_block_rd_bytes else rd.rd_block_rd_reqs;
- rd_block_wr_info =
- if block_in_bytes then
- rd.rd_block_wr_bytes else rd.rd_block_wr_reqs;
- } in
name, Active rd
(* For all other domains we can't calculate it, so leave as None. *)
| rd -> rd
rd_block_wr_reqs : int64 option; (* Number of block device write rqs. *)
rd_block_rd_bytes : int64 option; (* Number of bytes block device read *)
rd_block_wr_bytes : int64 option; (* Number of bytes block device write *)
- (* _info fields includes the number considering --block_in_bytes option *)
- rd_block_rd_info : int64 option; (* Block device read info for user *)
- rd_block_wr_info : int64 option; (* Block device read info for user *)
-
rd_net_rx_bytes : int64 option; (* Number of bytes received. *)
rd_net_tx_bytes : int64 option; (* Number of bytes transmitted. *)
}
rd_pcpu_pcpus_cpu_time : float array
}
-val collect : Types.setup -> bool -> stats
+val collect : Types.setup -> stats
(** Collect statistics. *)
val collect_pcpu : stats -> pcpu_stats
(* Write summary data to CSV file. *)
let append_csv (_, _, _, _, _, node_info, hostname, _) (* setup *)
(csv_cpu, csv_mem, csv_block, csv_net)
+ block_in_bytes
{ rd_doms = doms;
rd_printable_time = printable_time;
rd_nr_pcpus = nr_pcpus; rd_total_cpu = total_cpu;
(if csv_mem then [
Int64.to_string rd.rd_mem_bytes; Int64.to_string rd.rd_mem_percent
] else []) @
- (if csv_block then [
- string_of_int64_option rd.rd_block_rd_info;
- string_of_int64_option rd.rd_block_wr_info;
- ] else []) @
+ (if csv_block then
+ if block_in_bytes then [
+ string_of_int64_option rd.rd_block_rd_bytes;
+ string_of_int64_option rd.rd_block_wr_bytes;
+ ] else [
+ string_of_int64_option rd.rd_block_rd_reqs;
+ string_of_int64_option rd.rd_block_wr_reqs;
+ ]
+ else []) @
(if csv_net then [
string_of_int64_option rd.rd_net_rx_bytes;
string_of_int64_option rd.rd_net_tx_bytes;
val write_csv_header : bool * bool * bool * bool -> bool -> unit
-val append_csv : Types.setup -> bool * bool * bool * bool -> Collect.stats -> unit
+val append_csv : Types.setup -> bool * bool * bool * bool -> bool -> Collect.stats -> unit
| (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;
let dump_domain = fun name rd
-> begin
let state = Screen.show_state rd.rd_info.D.state in
- let rd_req = if rd.rd_block_rd_info = None then " 0"
- else Show.int64_option rd.rd_block_rd_info in
- let wr_req = if rd.rd_block_wr_info = None then " 0"
- else Show.int64_option rd.rd_block_wr_info in
+ let rd_req =
+ if rd.rd_block_rd_reqs = None then " 0"
+ else
+ 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_req =
+ if rd.rd_block_wr_reqs = None then " 0"
+ else
+ 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 = if rd.rd_net_rx_bytes = None then " 0"
else Show.int64_option rd.rd_net_rx_bytes in
let tx_bytes = if rd.rd_net_tx_bytes = None then " 0"
while not !quit do
(* Collect stats. *)
- let state = collect setup !block_in_bytes in
+ let state = collect setup in
let pcpu_display =
if !display_mode = PCPUDisplay then Some (collect_pcpu state)
else None in
(* Update CSV file. *)
if csv_enabled then
- Csv_output.append_csv setup csv_flags state;
+ Csv_output.append_csv setup csv_flags !block_in_bytes state;
(* Append to stream output file. *)
if stream_mode then