Clean APIs to retrieve project related statistics
Dries - February 10, 2009 - 08:56
| Project: | Project |
| Version: | 6.x-1.x-dev |
| Component: | Usage statistics |
| Category: | feature request |
| Priority: | normal |
| Assigned: | dww |
| Status: | closed |
| Issue tags: | drupal.org redesign |
Description
On the "Get involved" page of the new Drupal.org design (http://drupal.markboultondesign.com/iteration11/getinvolved.html) there is a "Drupal.org activity" block that needs to be implemented.
Specifically, the activity block shows:
* 3,100,342 Sites running Drupal
* 68,094 Comments and issue follow-upsWe need to implement clean APIs for this so they can be used on drupal.org -- if they don't exist already. The parent issue for the block itself is #371970: Drupal.org activity block .

#1
This patch provides an API to fetch usage stats. See #431144: Clean API to provide statistics from core for issue stats.
#2
would these API's be more useful if more information could be passed in the call? for example, an optional timestamp parameter to allow grabbing olders usage stats, which would default to the current week.
that may be overengineering at this point, i just wanted to put it out there for consideration.
otherwise, the code looks good.
#3
I thought of exactly the same thing, but decided against it for a few reasons:
a) less complication
b) there are settings which control how far back you save usage, and there's no _guarantee_ that the current week from the calendar point of view matches which week we have data for.
I thought it'd be better to just always provide a "current" total based on the data we really have. I think if there's a use-case for fetching data for specific weeks, we can add the optional final argument and complicate things when we need it. Let's not preemptively complicate.
#4
Committed to HEAD. If there are other project-related statistics we need, lets use new issues for those.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.