Subtask of #79550: Automate gathering of quality metrics and Project metrics for drupal.org redesign:
We need to create a new "metrics" subdirectory of project and create a project_metrics.module and .info file with the basic skeleton for the module. This should include a basic README.txt, @file PHPDoc, etc. Other issues to follow for other aspects of this whole effort...
Comments
Comment #1
hunmonk commentedposting this discussion w/ drumm on IRC, regarding a more generalized approach:
Comment #2
mikey_p commentedhunmonk is working on what a sample info hook from a provider module would look like, and I think that'll answer alot of these questions. From my perspective, being able to change the time window, and possible have different time windows for different metrics, is a key requirement for a 'genric' solution. There may be other features that would go into making this generic, but I think that is probably the biggest, most complex that I can think of (or I have use case for) at this time.
Comment #3
hunmonk commentedwhile this may be true, i don't think we have to solve this problem the first time around to make this module generally useful -- it would just be more useful with time flexibility. that said, it might be fairly easy to allow for time flexibility, i don't think it's totally off the table. what about if we provided a default implementation of weekly calculation native to the module, but allowed modules to specify a callback to return their own time periods? that seems like a fair solution
Comment #4
drummWe don't have to make everything generic & configurable upfront. As long as the code is clean, don't have 60*60*24*7 everywhere, at least use a constant. When the time comes to make things alterable by API or configurable by UI, we can swap in what is needed.
Comment #5
hunmonk commentedthe start of the code is now living here:
http://drupalcode.org/viewvc/drupal/contributions/sandbox/thehunmonkgrou...
so far i've got:
Comment #6
hunmonk commentedthis is basically done. updated code at the sandbox listed in #5. brief summary of what's been accomplished:
the code still needs to be tested, but it's definitely far enough along to start work on #889892: Expose metrics data to views
Comment #7
drummLooks generally okay. Any specific areas that might need closer review?
Comment #8
hunmonk commentedi struck on a fairly easy way make this API much more flexible, so i spend about two hours reworking the sample set logic so that it can both be used more flexibly when querying for a metric, and can accept custom sample periods and sample sets. i also updated the example module to showcase the custom sample sets. latest code in the sandbox mentioned in #5.
Comment #9
hunmonk commentedi've given the module an extensive workover, debugged thoroughly, and documented everything, so i think we can put this issue to bed, and open new issues for anything that comes up.
brief list of more stuff i accomplished from my sandbox commit log:
Comment #10
hunmonk commentedno official project exists for this module yet. moving to redesign queue for now, and retagging
Comment #11
hunmonk commenteddeployment will be handled over at #893912: deploy Sampler API with project metrics
Comment #12
hunmonk commentedmoving this issue to the new module's home...
Comment #13
hunmonk commentedanother complete rewrite has been done in my spare time... :P
now it's object-oriented, and storage, sampling method, and sampling adjustments are all pluggable.