From 1c14965e6c8c629631ddc4fd0a93f5caa3628be4 Mon Sep 17 00:00:00 2001 From: Graham Whaley Date: Wed, 14 Aug 2019 16:03:10 +0100 Subject: [PATCH] metrics: parallel: dedup use of aes() Rather than duplicate the same aes() over all the parts of the ggplot(), add the aes to the base ggplot, and then default to using that for all the other additions. Signed-off-by: Graham Whaley --- metrics/report/report_dockerfile/parallel.R | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/metrics/report/report_dockerfile/parallel.R b/metrics/report/report_dockerfile/parallel.R index 507e93e..f61a992 100755 --- a/metrics/report/report_dockerfile/parallel.R +++ b/metrics/report/report_dockerfile/parallel.R @@ -76,8 +76,8 @@ for (currentdir in resultdirs) { } # Show how boot time changed -boot_line_plot <- ggplot() + - geom_line( data=data, aes(npod, boot_time, colour=testname, group=dataset), alpha=0.2) + +boot_line_plot <- ggplot( data=data, aes(npod, boot_time, colour=testname, group=dataset)) + + geom_line( alpha=0.2) + xlab("parallel pods") + ylab("Boot time (s)") + ggtitle("Pod boot time (detail)") + @@ -85,9 +85,9 @@ boot_line_plot <- ggplot() + theme(axis.text.x=element_text(angle=90)) if ( skip_points_enable_smooth == 0 ) { - boot_line_plot = boot_line_plot + geom_point( data=data, aes(npod, boot_time, colour=testname, group=dataset), alpha=0.3) + boot_line_plot = boot_line_plot + geom_point(alpha=0.3) } else { - boot_line_plot = bool_line_plot + geom_smooth( data=data, aes(npod, boot_time, colour=testname, group=dataset), se=FALSE, method="loess", size=0.3) + boot_line_plot = bool_line_plot + geom_smooth(se=FALSE, method="loess", size=0.3) } # And get a zero Y index plot. @@ -95,8 +95,8 @@ boot_line_plot <- ggplot() + ggtitle("Pod boot time (0 index)") # Show how boot time changed -delete_line_plot <- ggplot() + - geom_line( data=data, aes(npod, delete_time, colour=testname, group=dataset), alpha=0.2) + +delete_line_plot <- ggplot( data=data, aes(npod, delete_time, colour=testname, group=dataset)) + + geom_line(alpha=0.2) + xlab("parallel pods") + ylab("Delete time (s)") + ggtitle("Pod deletion time (detail)") + @@ -104,9 +104,9 @@ delete_line_plot <- ggplot() + theme(axis.text.x=element_text(angle=90)) if ( skip_points_enable_smooth == 0 ) { - delete_line_plot = delete_line_plot + geom_point( data=data, aes(npod, delete_time, colour=testname, group=dataset), alpha=0.3) + delete_line_plot = delete_line_plot + geom_point(alpha=0.3) } else { - delete_line_plot = delete_line_plot + geom_smooth( data=data, aes(npod, delete_time, colour=testname, group=dataset), se=FALSE, method="loess", size=0.3) + delete_line_plot = delete_line_plot + geom_smooth(se=FALSE, method="loess", size=0.3) } # And get a 0 indexed Y axis plot