From 68a62f50bc92b93e85a0734a103780cf8101aa05 Mon Sep 17 00:00:00 2001 From: Graham Whaley Date: Fri, 15 Nov 2019 13:43:06 +0000 Subject: [PATCH] metrics: report: improve interface y axis divs Most of the time we have 0 interface errors or drops, so we pin the y scale to '1', so we don't hit 'infinity' errors. That left us with a strange y-axis label anomoly - as the axis was automatically divided into 5 labels, and we got for some reason the sequence '0,0,0,1,1'. That just plain looked wrong and confusing. Fix it by using `pretty_breaks()` for the error/drop y axis, whilst maintaining the `comma` count for the pod count y axis. Signed-off-by: Graham Whaley --- metrics/report/report_dockerfile/collectd_scaling.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metrics/report/report_dockerfile/collectd_scaling.R b/metrics/report/report_dockerfile/collectd_scaling.R index 28917d2..88e65bf 100755 --- a/metrics/report/report_dockerfile/collectd_scaling.R +++ b/metrics/report/report_dockerfile/collectd_scaling.R @@ -657,7 +657,7 @@ interface_drop_line_plot <- ggplot() + labs(colour="") + xlab("seconds") + ylab("drops") + - scale_y_continuous(labels=comma, sec.axis=sec_axis(~ ./drop_scale, name="pods")) + + scale_y_continuous(breaks=pretty_breaks(), sec.axis=sec_axis(~ ./drop_scale, name="pods", labels=comma)) + ggtitle("interface drops") + theme(legend.position="bottom") + theme(axis.text.x=element_text(angle=90)) @@ -692,7 +692,7 @@ interface_error_line_plot <- ggplot() + labs(colour="") + xlab("seconds") + ylab("errors") + - scale_y_continuous(labels=comma, sec.axis=sec_axis(~ ./error_scale, name="pods")) + + scale_y_continuous(breaks=pretty_breaks(), sec.axis=sec_axis(~ ./error_scale, name="pods", labels=comma)) + ggtitle("interface errors") + theme(legend.position="bottom") + theme(axis.text.x=element_text(angle=90))