fixing stats

From: Date: Tue, 17 Oct 2006 16:02:46 +0000
Subject: fixing stats
Groups: php.pear.webmaster 
Request: Send a blank email to pear-webmaster+get-5301@lists.php.net to get a copy of this message
Hi, I have fixed stats, but it is a complicated process that also affects pecl.php.net First, I created a table of aggregated package statistics that contains a per-month/per-release counter (each release of every package can have a counter defining the downloads in a certain month) Then, I took my offline copy of the stats, and processed all downloads pre-October 1, 2006 to create the file, and have synced the resulting table with pear.php.net. Now, to continue, I need to commit changes to pear-database.php wherein every time a file is downloaded, the counter in aggregated_package_stats is updated, but the counter in downloads is not. Things would be simpler, but the downloads table has no index on package/dl_when, which is needed to speed up the query, but would kill the speed of the server on the insert/update end. So, the only solution is to DELETE FROM downloads where dl_when < '2006-10-01', and to run my little processing script on the downloads since october 1 after the new code kicks in, and then remove the downloads table altogether. This will save TONS of disk space on the server, and speed downloading up considerably as well. This will also work well until we have a better method using some kind of trigger on access. I have tested the code, and get the same results in statistics for both pecl and pear. I'm writing this because this is a major database change, and need feedback before implementing it, as there was some concern on irc from the pecl camp. Thanks, Greg

« previous php.pear.webmaster (#5301) next »