Subtask of #79550: Automate gathering of quality metrics and Project metrics for drupal.org redesign:
I think it's safe to assume that the callbacks to generate various metrics are going to potentially be pretty expensive to run. We're not going to want to trigger all of this directly in hook_cron(). Instead, project_metrics should ship with a drush command. It's up to you to trigger this command periodically (e.g. via UNIX cron, hudson, whatever). The drush command should do the following:
- Invoke the info hook (see #889888: Design, document and invoke an info hook for modules to advertise metrics they support) to get info about all the available metrics (actually, it'd call project_metrics_load_info() or whatever, but you get the idea).
- For each metric, figure out the last timestamp it has data for. If it's time to compute again, invoke the right metrics callback and store the results. (Who does the iterating over the projects depends on how the callbacks are going to work over at #889888)...
...
We should probably design this drush command so it takes a command-line arg to limit it to only operate on a single metric (module, delta) so that you don't necessarily have to run all of it at once, but could stagger the processing on different metrics if you need to.
Comments
Comment #1
hunmonk commentedi'd say two optional args:
drush process-project-metrics [module] [delta]-- then, no args gives you all metrics, one arg gives you all metrics for one module, and two args gives you one metric.i'm also wondering if we'd want switches to specify the time range (in case we need to reprocess a period because of a bug, for example).
Comment #2
dwwand also an optional arg to only compute metrics for a single project, just like we have such an arg for the packaging script and the release history generation scripts. if nothing else, useful for debugging/development. but also potentially useful down the road...
Comment #3
hunmonk commentedno official project exists for this module yet. moving to redesign queue for now, and retagging
Comment #4
hunmonk commentedComment #5
hunmonk commentedmoving this issue to the new module's home...
Comment #6
hunmonk commenteddone and committed. includes support for: