gfio: make latency buckets expand to window width
[fio.git] / gclient.c
index deb20f06185c330d244be5347f75f25c4833392f..45d6100ee9081b02bb971c330b9a1bf29f739aba 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 = ARRAY_SIZE(labels);
+       GType types[nr_labels];
 
        frame = gtk_frame_new("IO depths");
        gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
@@ -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;