Re: "Popular Packages"

From: Date: Tue, 01 Nov 2011 10:49:46 +0000
Subject: Re: "Popular Packages"
References: 1  Groups: php.pear.dev php.pear.webmaster 
Request: Send a blank email to pear-dev+get-54558@lists.php.net to get a copy of this message
Hi, On 29.10.2011 14:23, Alexey Borzov wrote:
I've looked up a query in pearweb and it looks legit:
In fact the query only initially looks legit...
SELECT packages.name, releases.version, downloads, releasedate, downloads/(CEIL((unix_timestamp(NOW()) - unix_timestamp(releases.releasedate))/86400)) as releasenotes
...
a.yearmonth = "' . date('Y-m-01 00:00:00', time()) . '" ORDER BY releasenotes DESC';
If one looks more closely, it takes downloads for a current month and then divides them by the age of the package, so "* downloads per day" comment is bogus for all releases except those done this month. I traced the problem back to this commit: https://github.com/pear/pearweb/commit/c22f9f34c5b78a5035a380b40b842f8d334edd3e The notes there state
+ * Implement *much* better popular packages algorithm: only + count downloads per day for the current month. This gives + newer packages a fighting chance to be popular :)
I suspect the original intention was to divide by a min(package age in days, current day of month), not by a package age. BTW, if the query is fixed, File_Mogile 0.2.0 mentioned below will reign supreme at the "Popular packages" list. It isn't on the first place because its 100K+ downloads-per-month are spread thin across its two-year age.
Also WTF is File_Mogile? Does it really have 100K downloads a month or is this creative approach to foreign key constraints? http://pear.php.net/package-stats.php?pid=843&cid=9


« previous php.pear.dev (#54558) next »