120 |
let hl = ref "" |
let hl = ref "" |
121 |
|
|
122 |
let graph_length g = |
let graph_length g = |
123 |
if (Fifo2.length g) < (xgdivisions()) then |
if (Fifo.length g) < (xgdivisions()) then |
124 |
((Fifo2.length g) - 1) |
((Fifo.length g) - 1) |
125 |
else |
else |
126 |
(xgdivisions()) |
(xgdivisions()) |
127 |
|
|
128 |
let datas_length g = |
let datas_length g = |
129 |
((Fifo2.length g)) |
((Fifo.length g)) |
130 |
|
|
131 |
let l_max g = |
let l_max g = |
132 |
(List.fold_left max 0 (Fifo2.to_list g)) |
(List.fold_left max 0 (Fifo.to_list g)) |
133 |
|
|
134 |
let datas = Array.create history_size 0 |
let datas = Array.create history_size 0 |
135 |
|
|
180 |
mypic#fill ~x:(my_x + 1) ~y:(my_y) gcolor |
mypic#fill ~x:(my_x + 1) ~y:(my_y) gcolor |
181 |
|
|
182 |
let draw_tag mypic title gdown gup gcolor = |
let draw_tag mypic title gdown gup gcolor = |
183 |
let my_sum gl = List.fold_left (+) 0 (Fifo2.to_list gl) in |
let my_sum gl = List.fold_left (+) 0 (Fifo.to_list gl) in |
184 |
let meanx gl = ((float_of_int (my_sum gl)) /. (float_of_int ((Fifo2.length gl) - 1))) in |
let meanx gl = ((float_of_int (my_sum gl)) /. (float_of_int ((Fifo.length gl) - 1))) in |
185 |
let down_bw = (string_of_float (float_of_int(int_of_float((meanx gdown) /. 1024. *. 100.)) /. 100.)) in |
let down_bw = (string_of_float (float_of_int(int_of_float((meanx gdown) /. 1024. *. 100.)) /. 100.)) in |
186 |
let up_bw = (string_of_float (float_of_int(int_of_float((meanx gup) /. 1024. *. 100.)) /. 100.)) in |
let up_bw = (string_of_float (float_of_int(int_of_float((meanx gup) /. 1024. *. 100.)) /. 100.)) in |
187 |
let bw_d = "Dl: " ^ down_bw ^ "KB/s " |
let bw_d = "Dl: " ^ down_bw ^ "KB/s " |
242 |
let my_x = (xbr()) in |
let my_x = (xbr()) in |
243 |
let my_x2 = (xbs()) in |
let my_x2 = (xbs()) in |
244 |
let my_y = (ybb()) in |
let my_y = (ybb()) in |
245 |
let datas g n = List.nth (List.rev (Fifo2.to_list g)) n in |
let datas g n = List.nth (List.rev (Fifo.to_list g)) n in |
246 |
let fx x = int_of_float((float_of_int my_x) -. (((float_of_int x) /. (x_fdivisions())) *. (float_of_int my_x2))) in |
let fx x = int_of_float((float_of_int my_x) -. (((float_of_int x) /. (x_fdivisions())) *. (float_of_int my_x2))) in |
247 |
(* and vtext n = (string_of_int (int_of_float((float_of_int(n))*. vx ))) in *) |
(* and vtext n = (string_of_int (int_of_float((float_of_int(n))*. vx ))) in *) |
248 |
let basetime = Unix.gettimeofday () in |
let basetime = Unix.gettimeofday () in |
266 |
let my_x2 = (xbs()) in |
let my_x2 = (xbs()) in |
267 |
let my_y = (ybb()) in |
let my_y = (ybb()) in |
268 |
let my_y2 = (ybs()) in |
let my_y2 = (ybs()) in |
269 |
let datas g n = List.nth (List.rev (Fifo2.to_list g)) n in |
let datas g n = List.nth (List.rev (Fifo.to_list g)) n in |
270 |
let fx x = int_of_float((float_of_int my_x) -. (((float_of_int x) /. (fxgdivisions())) *. (float_of_int my_x2))) |
let fx x = int_of_float((float_of_int my_x) -. (((float_of_int x) /. (fxgdivisions())) *. (float_of_int my_x2))) |
271 |
and y_c1 n = (my_y - (int_of_float(float_of_int(datas g n) *. (vdt_m g)))) |
and y_c1 n = (my_y - (int_of_float(float_of_int(datas g n) *. (vdt_m g)))) |
272 |
and y_c2 n = (my_y - (int_of_float(float_of_int(datas g (n+1)) *. (vdt_m g)))) in |
and y_c2 n = (my_y - (int_of_float(float_of_int(datas g (n+1)) *. (vdt_m g)))) in |
301 |
let my_x2 = (xbs()) in |
let my_x2 = (xbs()) in |
302 |
let my_y = (ybb() - (ybs() / 2)) in |
let my_y = (ybb() - (ybs() / 2)) in |
303 |
let my_y2 = (ybs() / 2) in |
let my_y2 = (ybs() / 2) in |
304 |
let datas g n = List.nth (List.rev (Fifo2.to_list g)) n in |
let datas g n = List.nth (List.rev (Fifo.to_list g)) n in |
305 |
let fx x = int_of_float((float_of_int my_x) -. (((float_of_int x) /. (fxgdivisions())) *. (float_of_int my_x2))) |
let fx x = int_of_float((float_of_int my_x) -. (((float_of_int x) /. (fxgdivisions())) *. (float_of_int my_x2))) |
306 |
and y_c1 n = (my_y - (int_of_float(float_of_int(datas g n) *. (vdt_stack g)))) |
and y_c1 n = (my_y - (int_of_float(float_of_int(datas g n) *. (vdt_stack g)))) |
307 |
and y_c2 n = (my_y - (int_of_float(float_of_int(datas g (n+1)) *. (vdt_stack g)))) in |
and y_c2 n = (my_y - (int_of_float(float_of_int(datas g (n+1)) *. (vdt_stack g)))) in |
336 |
let my_x2 = (xbs()) in |
let my_x2 = (xbs()) in |
337 |
let my_y = (ybb() - (ybs() / 2)) in |
let my_y = (ybb() - (ybs() / 2)) in |
338 |
let my_y2 = (ybs() / 2) in |
let my_y2 = (ybs() / 2) in |
339 |
let datas g n = List.nth (List.rev (Fifo2.to_list g)) n in |
let datas g n = List.nth (List.rev (Fifo.to_list g)) n in |
340 |
let fx x = int_of_float((float_of_int my_x) -. (((float_of_int x) /. (fxgdivisions())) *. (float_of_int my_x2))) |
let fx x = int_of_float((float_of_int my_x) -. (((float_of_int x) /. (fxgdivisions())) *. (float_of_int my_x2))) |
341 |
and y_c1 n = (my_y + (int_of_float(float_of_int(datas g n) *. (vdt_stack g)))) |
and y_c1 n = (my_y + (int_of_float(float_of_int(datas g n) *. (vdt_stack g)))) |
342 |
and y_c2 n = (my_y + (int_of_float(float_of_int(datas g (n+1)) *. (vdt_stack g)))) in |
and y_c2 n = (my_y + (int_of_float(float_of_int(datas g (n+1)) *. (vdt_stack g)))) in |
372 |
and my_x2 = (xbs()) |
and my_x2 = (xbs()) |
373 |
and my_y = (ybb()) |
and my_y = (ybb()) |
374 |
and my_y2 = (ybs()) in |
and my_y2 = (ybs()) in |
375 |
let my_sum gl = List.fold_left (+) 0 (Fifo2.to_list gl) in |
let my_sum gl = List.fold_left (+) 0 (Fifo.to_list gl) in |
376 |
let meanx() = ((float_of_int (my_sum g)) /. (float_of_int ((Fifo2.length g)))) in |
let meanx() = ((float_of_int (my_sum g)) /. (float_of_int ((Fifo.length g)))) in |
377 |
let ypos = (my_y - (int_of_float((meanx()) *. (vdt_m g)))) in |
let ypos = (my_y - (int_of_float((meanx()) *. (vdt_m g)))) in |
378 |
let vtext = (string_of_float (float_of_int(int_of_float(meanx() /. 1024. *. 100.)) /. 100.)) in |
let vtext = (string_of_float (float_of_int(int_of_float(meanx() /. 1024. *. 100.)) /. 100.)) in |
379 |
mypic#line ~x1:xbl ~y1:(ypos - 1) ~x2:(xbl + my_x2 / 10) ~y2:(ypos - 1) my_color; |
mypic#line ~x1:xbl ~y1:(ypos - 1) ~x2:(xbl + my_x2 / 10) ~y2:(ypos - 1) my_color; |