Monthly Stats

From Perforce Workshop
Jump to: navigation, search


About This Project

The Monthly Stats MediaWiki extension adds a new special page, Special:MonthlyStats, that contains charts showing month-by-month contribution statistics.

If the $wgP4EXEC, $wgP4PORT, $wgP4WEBURL, etc variables are defined (as for the Perforce MediaWiki extension), the same information will be shown for Perforce changelist submissions.


  • The charts are drawn by the Google Chart API. The server doesn't need to have any special software installed to make this work, since the images are served up by Google, but users will need to be able to connect to
  • Per-user information will be displayed in the bar charts if it's possible to fit it into a URL of less than 2048 characters. If not, the bar chart will just show the totals for all users.
  • The default timespan shown on the bar chart is one year. Any span from one to ten years can be shown by adding the number of years to the page URL, e.g. Special:MonthlyStats/2.


Copyright (C) 2009 Sam Stafford

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <>.

Recent Changes RssIcon.gif

  • Change 7308 sam_stafford@samwise-silver-mwiki
      Just for fun, added a way to specify a path for the changelist query in
      Special:MonthlyStats. With the "-i" option this actually generates
      some interesting pictures of overall contributions to a project branch.
      Might break this out into a distinct parser function at some point so
      changelist bar charts can be inserted into project or user pages.
  • Change 7303 sam_stafford@samwise-silver-mwiki
      Replace URL encoding with more selective " "/"%20" replacement. Full
      URL encoding seems a little more aggressive than what is necessary and
      causes the character limit to get overrun faster than it should.
  • Change 7302 sam_stafford@samwise-silver-mwiki
      URL-encode chart data before checking it for the 2048-character limit.
  • Change 7301 sam_stafford@samwise-silver-mwiki
      Fine-tune the logic for which users are color-coded and listed in the
      graphs and which aren't. Rather than a fixed percent, users are now
      sorted by greatest number of submissions in a month and the top N are
      selected over two passes (the first with exemptions for users active in
      the pie chart months, the second without if the first wasn't enough to
      whittle it down to N).
      N is currently set to 18 since that seems to be just enough to fill up
      the bar chart legend.
  • Change 7299 sam_stafford@samwise-silver-mwiki
      Have Monthly Stats default to a 1 year period instead of 2.