-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metrics: graph improvements #271
metrics: graph improvements #271
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice improvements. thanks!
@@ -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)) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty_breaks, that's what I put into my code too
Testing done
Findings:
The used results files are attached and the output directory created too: |
@@ -8,6 +8,8 @@ author: "Auto generated" | |||
date: "`r format(Sys.time(), '%d %B, %Y')`" | |||
output: | |||
pdf_document: | |||
# Shrink the page margins so we get bigger/better resolution on the graphs | |||
geometry: margin=1cm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The page numbers get broke with this margin.
2bd4ac0
to
017c7c5
Compare
Thanks for the test and report @marcemq . I've an idea of most of what is going on:
I've pushed a PR update for (1). I think (2) and (3) we should reproduce, document the problem more clearly, and PR separately. I think (2) and (3) are not related to the changes in this PR. Could you:
It is possible there are some fixes in the HEAD branch that are not in this PR baseline - I can rebase and repush if we need etc. |
@grahamwhaley, LGTM. This makes it possible to see graphs in cases with many interfaces. I'm good with merging this already. But if something could be improved, then a combination of longish test name + host name + many interfaces makes the legend unreadable. Of course this cannot be fixed for all possible cases, but using smaller font would help at least in this case: The font in the caption looks slightly smaller than the font in the legend at the moment. |
@askervin thx. I think the problems @marcemq has seen are not specific to this PR (I have seen similar errors - I think there is something not quite write matching STEP!=1, but have not found an easy way to reproduce yet). Yeah, large amounts of data in the tables tends to blow them outside of the page :-( I've seen that many times with the 'device under test' table when I am comparing many data runs - you can see the 'shrink the font' sticky plaster on that table at https://github.com/clearlinux/cloud-native-setup/blob/master/metrics/report/report_dockerfile/dut-details.R#L92-L99 # Build us a text table of numerical results
# Set up as left hand justify, so the node data indent renders.
tablefontsize=8
tbody.style = tbody_style(hjust=0, x=0.1, size=tablefontsize)
stats_plot = suppressWarnings(ggtexttable(data.frame(spun_stats, check.names=FALSE),
theme=ttheme(base_size=tablefontsize, tbody.style=tbody.style),
rows=NULL
)) We could try applying that to the interface tables and see what it looks like - do you have a few cycles to try that with your data? |
Testing done
Findings:
The used results files are attached and the output directory created too: |
Heads up I've attempt to generate the report for the output files mentioned above separately and for So I'm not sure if the errors came from having multiple directories, which I've previously have tested w/o errors, or is it due to the rapid test, anyway, @grahamwhaley I've detailed the steps that I've followed in case you want to reproduce this behaviour. |
Thanks @marcemq - I tried to generate with the commit before this PR - commit In the meantime, do you think you can verify the commits in this PR are OK? |
OK, I think I know what the bug with the k8s-scaling (tidy) report is - there is a bad assumption in the R that tries to use a piece of data, even if there were no files to process in the directory it just scanned. The error is at https://github.com/clearlinux/cloud-native-setup/blob/master/metrics/report/report_dockerfile/tidy_scaling.R#L198 - and the two lines there need to be lifted inside the for loop. @marcemq - fancy seeing if you can move those lines and seeing if that helps - and if so, opening a PR to fix it? |
@grahamwhaley I've moved the lines that you've pointed out inside the inner loop and did not make any difference, and even if the reports gets generated only for scaling test the legend is still at the right side. |
Move the legends under the graphs to give more width, and thus resolution, to the final pictures. This works well for the collectd graphs as they are spread out into sets of single column graphs per page. Signed-off-by: Graham Whaley <[email protected]>
The pdf output by default has large page margins, which wastes a lot of page space, and reduces our 'resolution'. Shrink the margins to a pretty minimal 1cm to increase the graph resolution. The document itself then does not look as 'pretty', but we can see more data visually. Signed-off-by: Graham Whaley <[email protected]>
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 <[email protected]>
The bootdata assignments were outside the 'valid file' check loop, which meant in the case there was a data directory which did not contain a valid scaling file, we would fail the assignment (as the `local_bootdata` would be empty). Fix by moving the assignments into the loop, thus only assigning when we know we have valid data. Signed-off-by: Graham Whaley <[email protected]>
Move the legends to the bottom (underneath) for the tidy scaling graphs to make them wider on the page, and thus easier to read with more resolution. Signed-off-by: Graham Whaley <[email protected]>
017c7c5
to
21953a7
Compare
@marcemq - indeed, if you looked at the commits you would have seen they only updated the graph width for the collectd (rapid) graphs.... but....
What you will still see with your data is failure to render for the rapid case due to #276 not having been reviewed and merged (so I cannot rebase on it).... |
Testing done
Findings:
The generated report is attached below: |
@marcemq - can we check which commit you were based on? - the last commit in the new series (21953a7) moves the legends for the 'tidy' series under the graphttps://github.com//pull/271/commits/21953a75ad332c5f5cfd9c0da41e0d5eb490ec29hs, and I'm not seeing that in your PDF. It feels like maybe you need to pull a new version of my tree?? As for the failure in the collected rapid graphs - I suspect the code did not find the Can you check the commit you are on, the file names of the data files, and if it still fails, maybe do the first stage debug to work out why? |
Testing done Having a all-in-one Kubernetes clusted:
Findings:
The generated report is attached below: |
Thanks @marcemq . I think the issue with super wide, or many, legends is sadly an inherent issue in ggplot2 itself I suspect. I don't think there is any easy nice fix that I can find. The most relevant Issue I found was maybe tidyverse/ggplot2#1502 - which basically says 'solving legend placement and size in the core ggplot2 code is really really hard'. I had a play with legend bounding box size and placement, but did not find anything that worked. Two not so great workaround solutions I can think of then would be....
Interesting note then - if you double click (highlight) the cropped items in the pdf - you can see all of their text flowing off outside the page. So, in summary:
/cc @askervin as I think he's mentioned this before. |
@grahamwhaley I agree with your comments, and I'm OK on merging this PR as it is 😊 And lets open an issue to address 'what to do or how to report' the node names when it is large when creating a PDF report, so the fix can be applied to all report content. What do you think @grahamwhaley and @askervin about it? |
lgtm. @marcemq , opening an issue for handling very long hostnames is ok. |
Issue for the long label poor rendering opened at #287 . |
A small set of improvements to help graph readability in the report: