On Wed, Jun 29, 2011 at 10:19 AM, Ashar Voultoiz hashar+wmf@free.fr wrote:
You gave me the git repo at one point. Still haven't managed to look at the code and enhance it. Maybe we could add it to the subversion repository and have volunteers enhance it.
Here's the repo: https://gitorious.org/mwcrstats/mwcrstats
On Wed, Jun 29, 2011 at 10:22 AM, Chad innocentkiller@gmail.com wrote:
Even cooler would be integrating this into CodeReview itself, perhaps alongside what we have [here:] http://www.mediawiki.org/wiki/Special:Code/MediaWiki/stats
That would be cool. The code I wrote is in Python, so it would need to be ported PHP. I took an approach that gave me a lot of flexibility, but it also made things a little complicated. Bryan Tong Minh's approach may be a better starting point for the data generation part. I don't remember where he posted the queries he uses, but I'll post them here now:
mysql -hsql-s3 mediawikiwiki_p -e"SELECT MAX(cpc_timestamp) AS ok_timestamp FROM code_rev JOIN code_prop_changes ON cpc_repo_id = 1 AND cpc_rev_id = cr_id WHERE cr_repo_id = 1 AND cr_status IN ('ok', 'resolved') AND cr_path LIKE '/trunk/phase3%' GROUP BY cr_id ORDER BY ok_timestamp ASC" -N
code_ok.txt
mysql -hsql-s3 mediawikiwiki_p -e"SELECT cr_timestamp FROM code_rev LEFT JOIN code_prop_changes ON cpc_repo_id = 1 AND cpc_rev_id = cr_id WHERE cr_repo_id = 1 AND cr_status IN ('ok', 'resolved', 'fixme', 'new') AND cr_path LIKE '/trunk/phase3%' AND (cpc_rev_id IS NOT NULL OR cr_status = 'new') GROUP BY cr_id ORDER BY cr_timestamp ASC" -N >code_all.txt
Nimish and Erik Zachte are in the process of working on some jqPlot-based reporting tools, and it might be best to leverage their work rather than using Flot (which is what my code uses). jqPlot is a fork of Flot, from what I understand, so much of what is possible in Flot should also be possible in jqPlot. Some more info on that is here: http://www.mediawiki.org/wiki/Wikimedia_Report_Card_2.0 ...and http://www.mediawiki.org/wiki/Wikimedia_Report_Card_2.0/status
Rob
On 29/06/11 21:35, Rob Lanphier wrote:
Even cooler would be integrating this into CodeReview itself
<snip>
That would be cool. The code I wrote is in Python, so it would need to be ported PHP.
<snip>
I consider your code as a *successful* proof of concept. It is trivial to port it to PHP and integrate it in codereview. It is mostly about figuring the right queries, caching the result and output it as json for JavaScript to render it as a chart.
We would need some additions to the repo administration interface: - ability to manually add the branch points revision numbers - a list of extensions we want to include in the report. From there it is all about figuring out the right queries which you already did :-)
Nimish and Erik Zachte are in the process of working on some jqPlot-based reporting tools, and it might be best to leverage their work rather than using Flot (which is what my code uses).<snip>
Something worth looking at is the RaphaelJS library [1] which comes with a charting plugin [2]. RaphaelJS uses SVG/VML, everything is thus in the DOM and you can make them interactive by adding handlers to the elements. In the long term, it looks like integrating RaphaelJS will open us much more possibilities than just generating graphs. A new version is pending in github [3].
== links ==
[1] http://raphaeljs.com/ [2] http://g.raphaeljs.com/ [3] https://github.com/DmitryBaranovskiy/raphael/tree/2.0
== demos == http://raphaeljs.com/analytics.html http://raphaeljs.com/scape/ (for Wolfenstein 3D fans) http://g.raphaeljs.com/piechart2.html
cheers,
wikitech-l@lists.wikimedia.org