static void print_graph(intf_t *i) { int w; graph_t *g = create_configued_graph(&i->i_bytes_hist, c_graph_height); printf("%s\n", i->i_name); printf("RX %s\n", g->g_rx.t_y_unit); for (w = (c_graph_height - 1); w >= 0; w--) printf("%8.2f %s\n", g->g_rx.t_y_scale[w], (char *) g->g_rx.t_data + (w * (HISTORY_SIZE + 1))); printf(" 1 5 10 15 20 25 30 35 40 " \ "45 50 55 60 %s\n", g->g_rx.t_x_unit); printf("TX %s\n", g->g_tx.t_y_unit); for (w = (c_graph_height - 1); w >= 0; w--) printf("%8.2f %s\n", g->g_tx.t_y_scale[w], (char *) g->g_tx.t_data + (w * (HISTORY_SIZE + 1))); printf(" 1 5 10 15 20 25 30 35 40 " \ "45 50 55 60 %s\n", g->g_tx.t_x_unit); free_graph(g); }
static void __draw_graphic(stat_attr_hist_t *a, int selected, int xunit) { int w; graph_t *g; g = create_configued_graph(&a->a_hist, c_graph_height, a->a_unit, xunit); NEXT_ROW; putl("RX %s [%s]", g->g_rx.t_y_unit, type2desc(a->a_type)); if (selected) { move(row, 72); attron(A_BOLD); addstr("(sel)"); attroff(A_BOLD); move(row, 0); } for (w = (c_graph_height - 1); w >= 0; w--) { NEXT_ROW; putl(" %8.2f %s\n", g->g_rx.t_y_scale[w], (char *) g->g_rx.t_data + (w * (HISTORY_SIZE + 1))); } move(row, 71); putl("[%.2f%%]", rtiming.rt_variance.v_error); NEXT_ROW; putl(" 1 5 10 15 20 25 30 35 40 45 50 55 60 %s", g->g_rx.t_x_unit); NEXT_ROW; putl("TX %s", g->g_tx.t_y_unit); for (w = (c_graph_height - 1); w >= 0; w--) { NEXT_ROW; putl(" %8.2f %s\n", g->g_tx.t_y_scale[w], (char *) g->g_tx.t_data + (w * (HISTORY_SIZE + 1))); } move(row, 71); putl("[%.2f%%]", rtiming.rt_variance.v_error); NEXT_ROW; putl(" 1 5 10 15 20 25 30 35 40 45 50 55 60 %s", g->g_tx.t_x_unit); free_graph(g); }
static void draw_graphic(void) { int w; graph_t *g; intf_t *intf = get_current_intf(); if (NULL == intf) return; g = create_configued_graph(&intf->i_bytes_hist, c_graph_height); NEXT_ROW; putl("RX %s", g->g_rx.t_y_unit); for (w = (c_graph_height - 1); w >= 0; w--) { NEXT_ROW; putl(" %8.2f %s\n", g->g_rx.t_y_scale[w], (char *) g->g_rx.t_data + (w * (HISTORY_SIZE + 1))); } move(row, 71); putl("[%.2f%%]", rtiming.rt_variance.v_error); NEXT_ROW; putl(" 1 5 10 15 20 25 30 35 40 45 50 55 60 %s", g->g_rx.t_x_unit); NEXT_ROW; putl("TX %s", g->g_tx.t_y_unit); for (w = (c_graph_height - 1); w >= 0; w--) { NEXT_ROW; putl(" %8.2f %s\n", g->g_tx.t_y_scale[w], (char *) g->g_tx.t_data + (w * (HISTORY_SIZE + 1))); } move(row, 71); putl("[%.2f%%]", rtiming.rt_variance.v_error); NEXT_ROW; putl(" 1 5 10 15 20 25 30 35 40 45 50 55 60 %s", g->g_tx.t_x_unit); free_graph(g); }
static void __print_graph(stat_attr_t *a, void *arg) { item_t *i = (item_t *) arg; stat_attr_hist_t *h; graph_t *g; int w; if (!(a->a_flags & ATTR_FLAG_HISTORY)) return; h = (stat_attr_hist_t *) a; g = create_configued_graph(&h->a_hist, c_graph_height, h->a_unit, get_x_unit()); printf("Item: %s\nAttribute: %s\n", i->i_name, type2desc(a->a_type)); printf("RX %s\n", g->g_rx.t_y_unit); for (w = (c_graph_height - 1); w >= 0; w--) printf("%8.2f %s\n", g->g_rx.t_y_scale[w], (char *) g->g_rx.t_data + (w * (HISTORY_SIZE + 1))); printf(" 1 5 10 15 20 25 30 35 40 " \ "45 50 55 60 %s\n", g->g_rx.t_x_unit); printf("TX %s\n", g->g_tx.t_y_unit); for (w = (c_graph_height - 1); w >= 0; w--) printf("%8.2f %s\n", g->g_tx.t_y_scale[w], (char *) g->g_tx.t_data + (w * (HISTORY_SIZE + 1))); printf(" 1 5 10 15 20 25 30 35 40 " \ "45 50 55 60 %s\n", g->g_tx.t_x_unit); free_graph(g); }