Closed (fixed)
Project:
Project
Version:
5.x-1.x-dev
Component:
Usage statistics
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
4 Dec 2008 at 06:02 UTC
Updated:
26 Dec 2008 at 01:21 UTC
Jump to comment: Most recent file
Now that #326197: Empty data for latest week is fixed and deployed, there are a handful of cleanups to the new project-usage-process.php script I'd like to do:
A) The log messages when each process is completed should print out exactly how long each step took. We can figure out minute granularity from the watchdog, but it'd be nice to see seconds and just have it right there in the message.
B) The log messages about removing old data that timed out should include the number of rows effected.
C) The error messages when it fails to insert something should print out the SQL of the failed query.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 342543_project-usage-process_logging.8.patch | 6.3 KB | dww |
| #7 | 342543_project-usage-process_logging.7.patch | 6.3 KB | dww |
| #6 | project_usage_342543.patch | 5.63 KB | drewish |
| #3 | 342543_project-usage-process_logging.3.patch | 9.66 KB | dww |
| #2 | 342543_project-usage-process_logging.2.patch | 9.65 KB | dww |
Comments
Comment #1
dwwTotally untested, but I think this will do it.
Comment #2
dwwTested it and found some bugs in the previous patch. Running this one on p.d.o using the mysqldumps from before we processed the 6 week backlog of weekly data (along with #342546-2: Optimizing processing usage data) to see it all in action on real data. If that all looks good, and the resulting pages look the same as what's on d.o, I'll commit this.
Comment #3
dwwThe daily processing finished on p.d.o and the messages look good (although the story they reveal is unfortunate):
(The timestamps on the watchdog messages themselves agree it it was 7 minutes total...)
There was 1 minor bug in the log messages for the weekly processing, but otherwise those look ok: I ended up having the p.d.o DB in an inconsistent state, so things don't make normal sense, but here's a sample of the messages, anyway (at least we get to see the SQL query error messages in their full glory):
That "Removed !rows (!delta)." is the dumb bug mentioned above, fixed with the attached patch.
Any final objections to the approach taken in this patch before I commit?
Comment #4
dwwCommitted to HEAD, DRUPAL-5, and deployed on d.o and p.d.o.
Comment #5
drewish commentedi'd love to see a followup that logs the db error message.
Comment #6
drewish commentedhere's a follow up.
Comment #7
dwwMostly looks good, with a few adjustments. I'm resetting p.d.o so I can try running this again and see how it looks.
Comment #8
dwwHeh, this time, without the PHP syntax error. ;)
Comment #9
drewish commentedi think the whole last db error message isn't feasible. when the query fails _db_query() calls trigger_error() which in turn invokes drupal_error_handler() which calls watchdog() which in turn ends up writing a record and overwriting the last error message. i think logging the queries is a good idea though.
perhaps we can do a full clone of d.o to p.d.o and run this against a clean slate?
Comment #10
dwwRemoved the attempts to capture and print the SQL errors, committed to HEAD + DRUPAL-5, and deployed on d.o and p.d.o.