analyticalmonk / Rperform

:bar_chart: R package for tracking performance metrics across git versions and branches.
https://analyticalmonk.github.io/Rperform
GNU General Public License v3.0
65 stars 9 forks source link

generate web page that summarizes all results #8

Closed tdhock closed 9 years ago

tdhock commented 9 years ago

After rbinding together all the memory+time profiles for all the test files of a package, it would be nice to see a plot on a web page that summarizes that info.

Can you try to do a plot of all the data with facet_grid(metric_name ~ test.name, scales="free") ?

tdhock commented 9 years ago

@da-ta-vinci21 after you get this working then you can try to push the web page and plots from travis to github as described in https://github.com/rstats-gsoc/gsoc2015/wiki/Test-timings-on-Travis#project-ideas

analyticalmonk commented 9 years ago

@tdhock I was able to plot the data using the above command. However, do I need to generate a webpage containing the plots, store that webpage in the directory and then push it from local machine/travis to github? If yes, I am a bit confused about how to generate the webpage. Can you suggest me a method to look into?

tdhock commented 9 years ago

why can't you plot the data with facet_grid? You should be able to. What was the error message you saw?

to generate a web page with the resulting plot, try writing a Rmd file and using library(knitr)

On Fri, Jul 17, 2015 at 9:30 PM, Akash Tandon notifications@github.com wrote:

@tdhock https://github.com/tdhock I was able to plot the data using the above command. However, do I need to generate a webpage containing the plots, store that webpage in the directory and then push it from local machine/travis to github? If yes, I am a bit confused about how to generate the webpage. Can you suggest me a method to look into?

— Reply to this email directly or view it on GitHub https://github.com/da-ta-vinci21/Rperform/issues/8#issuecomment-122465744 .

analyticalmonk commented 9 years ago

Oh, I think you misread my post. I was able to plot the data.

tdhock commented 9 years ago

great, can you post one of the facet_grid plots so we can discuss tomorrow?

On Sat, Jul 18, 2015 at 6:41 PM, Akash Tandon notifications@github.com wrote:

Oh, I think you misread my post. I was able to plot the data.

— Reply to this email directly or view it on GitHub https://github.com/da-ta-vinci21/Rperform/issues/8#issuecomment-122602588 .

analyticalmonk commented 9 years ago
> t_data <- Rperform::time_compare(test_path = "./tests/testthat/test-dup.r", num_commits = 5)
> m_data <- Rperform::mem_compare(test_path = "./tests/testthat/test-dup.r", num_commits = 5)
> data <- rbind(m_data, t_data)
> ggplot2::qplot(data = data, x = msg_val, y = metric_val, color = test_name) + ggplot2::facet_grid(metric_name ~ test_name) + ggplot2::theme(axis.text.x = ggplot2::element_text(angle = -90)) + ggplot2::scale_x_discrete(limits = rev(levels(data$msg))) + ggplot2::xlab(label = "Commit messages") + ggplot2::ggtitle("Variation in metrics across Git versions")

rperform_grid

tdhock commented 9 years ago

Thanks for making that plot.

A couple of suggestions:

No need to put test_name as both color and a facet variable (one or the other is sufficient, and both is potentially confusing).

It would be better to change metric_name="time" to metric_name="seconds" so the reader is able to see the units of time.

It would be better to make a facet_grid(metric_name ~ ., units="free") plot for each value of test_name. There are two reasons: (1) it is not interesting to compare metric_val numbers between different tests. (2) metric_val numbers are on very different scales so when you force them to be on the same scale it is impossible to see differences and variation.

On Tue, Jul 21, 2015 at 9:16 AM, Akash Tandon notifications@github.com wrote:

t_data <- Rperform::time_compare(test_path = "./tests/testthat/test-dup.r", num_commits = 5) m_data <- Rperform::mem_compare(test_path = "./tests/testthat/test-dup.r", num_commits = 5) data <- rbind(m_data, t_data) ggplot2::qplot(data = data, x = msg_val, y = metric_val, color = test_name) + ggplot2::facet_grid(metric_name ~ test_name) + ggplot2::theme(axis.text.x = ggplot2::element_text(angle = -90)) + ggplot2::scale_x_discrete(limits = rev(levels(data$msg))) + ggplot2::xlab(label = "Commit messages") + ggplot2::ggtitle("Variation in metrics across Git versions")

[image: rperform_grid] https://cloud.githubusercontent.com/assets/4419448/8801476/953c0e86-2fd8-11e5-9dfb-7a734c7553d2.jpeg

— Reply to this email directly or view it on GitHub https://github.com/da-ta-vinci21/Rperform/issues/8#issuecomment-123301156 .

tdhock commented 9 years ago

maybe use library(xtable)

or library(knitr)

tdhock commented 9 years ago

maybe include a link to RData files on the web page.

tdhock commented 9 years ago

check this related work into generating a web page for plotly https://github.com/ropensci/plotly-test-table/tree/gh-pages

tdhock commented 9 years ago

this is the script that Carson used to automatically push a web page and a comment from Travis to Github https://github.com/ropensci/plotly/blob/master/inst/testscripts/.push_test_table.sh

tdhock commented 9 years ago

Update from Akash:

I was able to successfully run Rperform on the Travis machine and then push the results to a gh-pages branch. I did it for a clone of ggplotly which also happens to not use the testthat package for testing.

You can find more relevant information at the links below:

Travis Build: https://travis-ci.org/da-ta-vinci21/Rperform_ggplotly/builds/73873163

ggplotly gh-pages branch: https://github.com/da-ta-vinci21/Rperform_ggplotly/tree/gh-pages

Commit featuring the sample travis.yml file and push_gh_pages script: https://github.com/da-ta-vinci21/Rperform/commit/949315de477466f60a26ed47ba01d40503eab14b

.travis.yml for the ggplotly clone: https://github.com/da-ta-vinci21/Rperform_ggplotly/blob/master/.travis.yml

.push_gh_pages.sh for the ggplotly clone: https://github.com/da-ta-vinci21/Rperform_ggplotly/blob/master/.push_gh_pages.sh

tdhock commented 9 years ago

TODO ggtitle(test_name) instead of aes(color=test_name)

analyticalmonk commented 9 years ago

Link to the wiki for integrating Rperform with Travis-CI: Rperform Wiki

I will make changes as we had discussed today (such as inclusion of a custom Rperform script instead of using echo). Still, here is the initial wiki about the work done till now.

tdhock commented 9 years ago

Hey Akash thanks for writing that wiki page. It is very informative and I just tried it on https://travis-ci.org/tdhock/PeakError/builds/73955726

On Mon, Aug 3, 2015 at 2:19 PM, Akash Tandon notifications@github.com wrote:

Link to the wiki for integrating Rperform with Travis-CI: Rperform Wiki https://github.com/da-ta-vinci21/Rperform/wiki#integrating-rperform-with-travis-ci

I will make changes as we had discussed today (such as inclusion of a custom Rperform script instead of using echo). Still, here is the initial wiki about the work done till now.

— Reply to this email directly or view it on GitHub https://github.com/da-ta-vinci21/Rperform/issues/8#issuecomment-127360212 .

tdhock commented 9 years ago

Actually I got an error, https://travis-ci.org/tdhock/PeakError/builds/73955726#L1266

Are you sure it shouldn't be https://tdhock@github.com/PeakError instead of https://${GH_TOKEN}@github.com/PeakError? This error message compromised the security of my token, so I deleted it.

On Mon, Aug 3, 2015 at 4:38 PM, Toby Hocking tdhock5@gmail.com wrote:

Hey Akash thanks for writing that wiki page. It is very informative and I just tried it on https://travis-ci.org/tdhock/PeakError/builds/73955726

On Mon, Aug 3, 2015 at 2:19 PM, Akash Tandon notifications@github.com wrote:

Link to the wiki for integrating Rperform with Travis-CI: Rperform Wiki https://github.com/da-ta-vinci21/Rperform/wiki#integrating-rperform-with-travis-ci

I will make changes as we had discussed today (such as inclusion of a custom Rperform script instead of using echo). Still, here is the initial wiki about the work done till now.

— Reply to this email directly or view it on GitHub https://github.com/da-ta-vinci21/Rperform/issues/8#issuecomment-127360212 .

analyticalmonk commented 9 years ago

Oh, I think it wasn't clear enough from the wiki. For the repo PeakError, it should be https://${GH_TOKEN}@github.com/tdhock/PeakError.

tdhock commented 9 years ago

thanks for the info. I will try that.

However you don't think there is any security problem?

On Mon, Aug 3, 2015 at 10:53 PM, Akash Tandon notifications@github.com wrote:

Oh, I think it wasn't clear enough from the wiki. For the repo PeakError, it should be https://${GH_TOKEN}@github.com/tdhock/PeakError.

— Reply to this email directly or view it on GitHub https://github.com/da-ta-vinci21/Rperform/issues/8#issuecomment-127461148 .

tdhock commented 9 years ago

works for me http://tdhock.github.io/PeakError/

https://travis-ci.org/tdhock/PeakError/builds/74065947

tdhock commented 9 years ago

great job with the coding and documentation.