One of the metrics we're going to want for Project metrics for drupal.org redesign is a count of the number of releases created in a given week so that we can have a sparkline showing the history of releases for a project.

Comments

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
Issue tags: +drupal.org redesign sprint 4
StatusFileSize
new4.4 KB

Totally untested, but here's a first stab at this.

dww’s picture

Slightly more tested. Still not able to save the values with drush yet, but we're getting closer.

dww’s picture

This fixes the query so that we correctly record values with 0s for weeks without any releases. Not sure if we want the big nasty query in here now to get all the 0s, or if it's better to do the simpler query from the previous patches and handle the 0s via PHP.

Now also with a sort of functional default view for the corresponding sparkline, although I think we're getting nailed by #905902: Option for missing/empty values since we've now got a bunch of 0s in here. ;)

I'm also wondering if this should be a multi-valued metric, split by API compatibility terms (e.g. 6.x vs. 7.x) and a stacked bar-chart sparkline.

hunmonk’s picture

since new API compatibility terms are inevitable, i would advocate, if we want them split, for each to be a separate individual metric. this would be much easier to manage schema-wise.

dww’s picture

Title: Add a function for counting the number of releases created in a given time period » Metric for counting the number of releases created in a given time period
StatusFileSize
new8.94 KB

- Renamed the metric to "new releases" to make it more obvious this is the release "delta", not a total.
- Fixed the query to restrict to project nodes (given all the LEFT JOINing now, we need this).
- Fixed up some code comments.

hunmonk’s picture

Status: Needs review » Needs work
hunmonk’s picture

Status: Needs work » Needs review
StatusFileSize
new7.3 KB

update the patch in #6 for the sampler API changes -- seems to work perfectly in light testing.

hunmonk’s picture

latest patch, adds batch support.

hunmonk’s picture

Status: Needs review » Fixed

Automatically closed -- issue fixed for 2 weeks with no activity.