summaryrefslogtreecommitdiff
path: root/graph.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2012-03-16 10:17:08 +0100
committerJens Axboe <axboe@kernel.dk>2012-03-16 10:17:08 +0100
commit5aec66804d2a6d60aee8d973680c69b13c1d34a3 (patch)
treee6bfb67414f89c37e1b143404d29a0e66c30ddbc /graph.c
parent9af4a24408ea7d4cea084a4fe214b81145cc36ac (diff)
downloadfio-5aec66804d2a6d60aee8d973680c69b13c1d34a3.tar.gz
fio-5aec66804d2a6d60aee8d973680c69b13c1d34a3.tar.bz2
graph: use 0 as the floor for the line graph
Unless we have values below 0, in which case use that. This makes it easier to visually compare a running read/write workload. Without this change, the lowest valued graph would define the floor of the graph view. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'graph.c')
-rw-r--r--graph.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/graph.c b/graph.c
index 7dbfd357..837211da 100644
--- a/graph.c
+++ b/graph.c
@@ -525,6 +525,15 @@ void line_graph_draw(struct graph *g, cairo_t *cr)
minx = find_xy_value(g, getx, mindouble);
maxx = find_xy_value(g, getx, maxdouble);
miny = find_xy_value(g, gety, mindouble);
+
+ /*
+ * Start graphs at zero, unless we have a value below. Otherwise
+ * it's hard to visually compare the read and write graph, since
+ * the lowest valued one will be the floor of the graph view.
+ */
+ if (miny > 0)
+ miny = 0;
+
maxy = find_xy_value(g, gety, maxdouble);
if (fabs(maxx - minx) < 1e-20 || fabs(maxy - miny) < 1e-20) {