gfio: make completion percentiles graphs expand to window width
[fio.git] / gclient.c
index dfdd8704a09948de3d5c4c83f878e7e7c37659a3..c4be17241f273835247c0c1dc0bb41259f672da5 100644 (file)
--- a/gclient.c
+++ b/gclient.c
@@ -115,7 +115,7 @@ static void gfio_text_op(struct fio_client *client, struct fio_net_cmd *cmd)
        sec = p->log_sec;
        tm = localtime(&sec);
        strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S", tm);
-       sprintf(timebuf, "%s.%03ld", tmp, p->log_usec / 1000);
+       sprintf(timebuf, "%s.%03ld", tmp, (long) p->log_usec / 1000);
 
        gdk_threads_enter();
 
@@ -400,10 +400,10 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *j
                gtk_entry_set_text(GTK_ENTRY(ge->eta.write_bw), rate_str[1]);
                gtk_entry_set_text(GTK_ENTRY(ge->eta.write_iops), iops_str[1]);
 
-               graph_add_xy_data(ge->graphs.iops_graph, "Read IOPS", je->elapsed_sec, je->iops[0], iops_str[0]);
-               graph_add_xy_data(ge->graphs.iops_graph, "Write IOPS", je->elapsed_sec, je->iops[1], iops_str[1]);
-               graph_add_xy_data(ge->graphs.bandwidth_graph, "Read Bandwidth", je->elapsed_sec, je->rate[0], rate_str[0]);
-               graph_add_xy_data(ge->graphs.bandwidth_graph, "Write Bandwidth", je->elapsed_sec, je->rate[1], rate_str[1]);
+               graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.read_iops, je->elapsed_sec, je->iops[0], iops_str[0]);
+               graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.write_iops, je->elapsed_sec, je->iops[1], iops_str[1]);
+               graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.read_bw, je->elapsed_sec, je->rate[0], rate_str[0]);
+               graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.write_bw, je->elapsed_sec, je->rate[1], rate_str[1]);
 
                free(rate_str[0]);
                free(rate_str[1]);
@@ -488,10 +488,10 @@ static void gfio_update_all_eta(struct jobs_eta *je)
                gtk_entry_set_text(GTK_ENTRY(ui->eta.write_bw), rate_str[1]);
                gtk_entry_set_text(GTK_ENTRY(ui->eta.write_iops), iops_str[1]);
 
-               graph_add_xy_data(ui->graphs.iops_graph, "Read IOPS", je->elapsed_sec, je->iops[0], iops_str[0]);
-               graph_add_xy_data(ui->graphs.iops_graph, "Write IOPS", je->elapsed_sec, je->iops[1], iops_str[1]);
-               graph_add_xy_data(ui->graphs.bandwidth_graph, "Read Bandwidth", je->elapsed_sec, je->rate[0], rate_str[0]);
-               graph_add_xy_data(ui->graphs.bandwidth_graph, "Write Bandwidth", je->elapsed_sec, je->rate[1], rate_str[1]);
+               graph_add_xy_data(ui->graphs.iops_graph, ui->graphs.read_iops, je->elapsed_sec, je->iops[0], iops_str[0]);
+               graph_add_xy_data(ui->graphs.iops_graph, ui->graphs.write_iops, je->elapsed_sec, je->iops[1], iops_str[1]);
+               graph_add_xy_data(ui->graphs.bandwidth_graph, ui->graphs.read_bw, je->elapsed_sec, je->rate[0], rate_str[0]);
+               graph_add_xy_data(ui->graphs.bandwidth_graph, ui->graphs.write_bw, je->elapsed_sec, je->rate[1], rate_str[1]);
 
                free(rate_str[0]);
                free(rate_str[1]);
@@ -565,8 +565,6 @@ static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd)
 
        gdk_threads_enter();
 
-       gtk_label_set_text(GTK_LABEL(ge->page_label), (gchar *) o->name);
-
        gtk_combo_box_append_text(GTK_COMBO_BOX(ge->eta.names), (gchar *) o->name);
        gtk_combo_box_set_active(GTK_COMBO_BOX(ge->eta.names), 0);
 
@@ -733,10 +731,10 @@ static void gfio_show_io_depths(GtkWidget *vbox, struct thread_stat *ts)
        GtkWidget *frame, *box, *tree_view = NULL;
        GtkTreeSelection *selection;
        GtkListStore *model;
-       GType types[FIO_IO_U_MAP_NR + 1];
        int i;
        const char *labels[] = { "Depth", "0", "1", "2", "4", "8", "16", "32", "64", ">= 64" };
-       const int nr_labels = ARRAYSIZE(labels);
+       const int nr_labels = ARRAY_SIZE(labels);
+       GType types[nr_labels];
 
        frame = gtk_frame_new("IO depths");
        gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
@@ -765,7 +763,7 @@ static void gfio_show_io_depths(GtkWidget *vbox, struct thread_stat *ts)
        gfio_add_sc_depths_tree(model, ts, nr_labels, 1);
        gfio_add_sc_depths_tree(model, ts, nr_labels, 0);
 
-       gtk_box_pack_start(GTK_BOX(box), tree_view, TRUE, FALSE, 3);
+       gtk_box_pack_start(GTK_BOX(box), tree_view, TRUE, TRUE, 3);
 }
 
 static void gfio_show_cpu_usage(GtkWidget *vbox, struct thread_stat *ts)
@@ -867,8 +865,10 @@ static struct graph *setup_lat_bucket_graph(const char *title, double *lat,
        graph_y_title(g, "Percent");
 
        for (i = 0; i < len; i++) {
-               graph_add_label(g, labels[i]);
-               graph_add_data(g, labels[i], lat[i]);
+               graph_label_t l;
+
+               l = graph_add_label(g, labels[i]);
+               graph_add_data(g, l, lat[i]);
        }
 
        return g;
@@ -957,7 +957,7 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox,
        g_signal_connect(G_OBJECT(drawing_area), "expose_event", G_CALLBACK(on_expose_lat_drawing_area), ge->lat_bucket_graph);
         g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->lat_bucket_graph);
 
-       gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, FALSE, 3);
+       gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, TRUE, 3);
 }
 
 static void gfio_show_lat(GtkWidget *vbox, const char *name, unsigned long min,
@@ -1055,11 +1055,12 @@ static struct graph *setup_clat_graph(char *title, unsigned int *ovals,
        graph_y_title(g, "Time");
 
        for (i = 0; i < len; i++) {
+               graph_label_t l;
                char fbuf[8];
 
                sprintf(fbuf, "%2.2f%%", plist[i].u.f);
-               graph_add_label(g, fbuf);
-               graph_add_data(g, fbuf, (double) ovals[i]);
+               l = graph_add_label(g, fbuf);
+               graph_add_data(g, l, (double) ovals[i]);
        }
 
        return g;
@@ -1112,7 +1113,7 @@ static void gfio_show_clat_percentiles(struct gfio_client *gc,
        g_signal_connect(G_OBJECT(drawing_area), "expose_event", G_CALLBACK(on_expose_lat_drawing_area), ge->clat_graph);
        g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->clat_graph);
 
-       gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, FALSE, 3);
+       gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, TRUE, 3);
 out:
        if (ovals)
                free(ovals);
@@ -1152,7 +1153,7 @@ static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox,
        gtk_box_pack_start(GTK_BOX(mbox), box, TRUE, FALSE, 3);
 
        frame = gtk_frame_new(ddir_label[ddir]);
-       gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5);
+       gtk_box_pack_start(GTK_BOX(box), frame, TRUE, TRUE, 5);
 
        main_vbox = gtk_vbox_new(FALSE, 3);
        gtk_container_add(GTK_CONTAINER(frame), main_vbox);