One of the metrics we want for Project metrics for drupal.org redesign is a count of the total number of issue comments for a project in a given week.

This is a bit wonky when you look at comments that move an issue from one queue to another. ;) For simplicity, I think we just count that as a comment in the *new* project's tally. So, my proposal is the rule is whatever project an issue is in after your comment is the project we increment the counter for...

Comments

hunmonk’s picture

Assigned: Unassigned » hunmonk
Status: Active » Needs review
StatusFileSize
new4.03 KB

first stab at this.

couple of problems:

  1. the query that pulls all the projects + new issue counts doesn't seem to actually pull all of the projects. i get somewhere in the neighborhood of 2200 rows with that query, but the {project_projects} table says there's closer to 7800
  2. both queries are ridiculously expensive -- on my laptop, 30 seconds for the issue query, and a minute and a half for the comments :( i *think* the comments query can by improved dramatically by added an index on {project_issue_comments}.timestamp

otherwise, it seems to do what it's supposed to.

hunmonk’s picture

latest patch, adds batch support.

hunmonk’s picture

Title: Add a function to count the total number of issue comments in a week » Add a function to count the total number of new issues/issue comments in a week
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -drupal.org redesign, -drupal.org redesign project, -project metrics

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