Skip to content

Commit

Permalink
metrics: report: improve interface y axis divs
Browse files Browse the repository at this point in the history
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 lable 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 <[email protected]>
  • Loading branch information
Graham Whaley committed Nov 15, 2019
1 parent f4c7cc5 commit 2bd4ac0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metrics/report/report_dockerfile/collectd_scaling.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 2bd4ac0

Please sign in to comment.