gfio: add trim UI support
[fio.git] / gfio.c
diff --git a/gfio.c b/gfio.c
index d80e41e0c9a09b5beb2848f445dc7eb98685e019..977f2fccab9de95f75edddd2c17808f5c7723ce3 100644 (file)
--- a/gfio.c
+++ b/gfio.c
@@ -41,6 +41,7 @@ static int gfio_server_running;
 static unsigned int gfio_graph_limit = 100;
 
 GdkColor gfio_color_white;
+GdkColor gfio_color_lightyellow;
 const char *gfio_graph_font = GRAPH_DEFAULT_FONT;
 
 typedef void (*clickfunction)(GtkWidget *widget, gpointer data);
@@ -84,8 +85,10 @@ static void setup_iops_graph(struct gfio_graphs *gg)
        graph_x_title(g, "Time (secs)");
        gg->read_iops = graph_add_label(g, "Read IOPS");
        gg->write_iops = graph_add_label(g, "Write IOPS");
+       gg->trim_iops = graph_add_label(g, "Trim IOPS");
        graph_set_color(g, gg->read_iops, 0.13, 0.54, 0.13);
        graph_set_color(g, gg->write_iops, 1.0, 0.0, 0.0);
+       graph_set_color(g, gg->trim_iops, 0.24, 0.18, 0.52);
        line_graph_set_data_count_limit(g, gfio_graph_limit);
        graph_add_extra_space(g, 0.0, 0.0, 0.0, 0.0);
        graph_set_graph_all_zeroes(g, 0);
@@ -101,8 +104,10 @@ static void setup_bandwidth_graph(struct gfio_graphs *gg)
        graph_x_title(g, "Time (secs)");
        gg->read_bw = graph_add_label(g, "Read Bandwidth");
        gg->write_bw = graph_add_label(g, "Write Bandwidth");
+       gg->trim_bw = graph_add_label(g, "Trim Bandwidth");
        graph_set_color(g, gg->read_bw, 0.13, 0.54, 0.13);
        graph_set_color(g, gg->write_bw, 1.0, 0.0, 0.0);
+       graph_set_color(g, gg->trim_bw, 0.24, 0.18, 0.52);
        graph_set_base_offset(g, 1);
        line_graph_set_data_count_limit(g, 100);
        graph_add_extra_space(g, 0.0, 0.0, 0.0, 0.0);
@@ -1384,6 +1389,8 @@ static GtkWidget *new_client_page(struct gui_entry *ge)
        ge->eta.read_iops = new_info_entry_in_frame(probe_box, "IOPS");
        ge->eta.write_bw = new_info_entry_in_frame(probe_box, "Write BW");
        ge->eta.write_iops = new_info_entry_in_frame(probe_box, "IOPS");
+       ge->eta.trim_bw = new_info_entry_in_frame(probe_box, "Trim BW");
+       ge->eta.trim_iops = new_info_entry_in_frame(probe_box, "IOPS");
 
        /*
         * Only add this if we have a commit rate
@@ -1405,7 +1412,7 @@ static GtkWidget *new_client_page(struct gui_entry *ge)
        ge->graphs.drawing_area = gtk_drawing_area_new();
        gtk_widget_set_size_request(GTK_WIDGET(ge->graphs.drawing_area),
                DRAWING_AREA_XDIM, DRAWING_AREA_YDIM);
-       gtk_widget_modify_bg(ge->graphs.drawing_area, GTK_STATE_NORMAL, &gfio_color_white);
+       gtk_widget_modify_bg(ge->graphs.drawing_area, GTK_STATE_NORMAL, &gfio_color_lightyellow);
        g_signal_connect(G_OBJECT(ge->graphs.drawing_area), GFIO_DRAW_EVENT,
                                G_CALLBACK(on_expose_drawing_area), &ge->graphs);
        g_signal_connect(G_OBJECT(ge->graphs.drawing_area), "configure_event",
@@ -1470,6 +1477,9 @@ static GtkWidget *new_main_page(struct gui *ui)
        ui->eta.read_iops = new_info_entry_in_frame(probe_box, "IOPS");
        ui->eta.write_bw = new_info_entry_in_frame(probe_box, "Write BW");
        ui->eta.write_iops = new_info_entry_in_frame(probe_box, "IOPS");
+       ui->eta.trim_bw = new_info_entry_in_frame(probe_box, "Trim BW");
+       ui->eta.trim_iops = new_info_entry_in_frame(probe_box, "IOPS");
+
 
        /*
         * Only add this if we have a commit rate
@@ -1491,7 +1501,7 @@ static GtkWidget *new_main_page(struct gui *ui)
        ui->graphs.drawing_area = gtk_drawing_area_new();
        gtk_widget_set_size_request(GTK_WIDGET(ui->graphs.drawing_area),
                DRAWING_AREA_XDIM, DRAWING_AREA_YDIM);
-       gtk_widget_modify_bg(ui->graphs.drawing_area, GTK_STATE_NORMAL, &gfio_color_white);
+       gtk_widget_modify_bg(ui->graphs.drawing_area, GTK_STATE_NORMAL, &gfio_color_lightyellow);
        g_signal_connect(G_OBJECT(ui->graphs.drawing_area), GFIO_DRAW_EVENT,
                        G_CALLBACK(on_expose_drawing_area), &ui->graphs);
        g_signal_connect(G_OBJECT(ui->graphs.drawing_area), "configure_event",
@@ -1669,6 +1679,7 @@ static void init_ui(int *argc, char **argv[], struct gui *ui)
        settings = gtk_settings_get_default();
        gtk_settings_set_long_property(settings, "gtk_tooltip_timeout", 10, "gfio setting");
        g_type_init();
+       gdk_color_parse("#ffffee", &gfio_color_lightyellow);
        gdk_color_parse("white", &gfio_color_white);
 
        ui->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);