Last modified: 2011-03-28 16:46:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30286, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28286 - $wgHitcounterUpdateFreq is either not working or needs proper description
$wgHitcounterUpdateFreq is either not working or needs proper description
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-27 23:32 UTC by Subfader
Modified: 2011-03-28 16:46 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Subfader 2011-03-27 23:32:34 UTC
http://www.mediawiki.org/wiki/Manual:$wgHitcounterUpdateFreq

$wgHitcounterUpdateFreq is not described properly. It is totally unclear how it saves CPU load. The description is false. See the talk page.
Comment 1 Subfader 2011-03-27 23:45:22 UTC
For those who are too lazy to click:

It seems that nobody knows how $wgHitcounterUpdateFreq works or even saves CPU load.

A few weeks ago someone FINALLY added a description about the technical details:
"When this setting is set to a number bigger than 1, the page id of any page viewed is stored in the hitcounter table. About 1 in every ($wgHitcounterUpdateFreq)*0.25 hits, the number of entries in the hit counter table is checked. If there is more than $wgHitcounterUpdateFreq entries in the hitcounter table, then for each entry in the hitcounter table, the relevant page_counter field in the page table is updated by 1 (and the hitcounter table is emptied). Note if the same page is visited twice (or more) between updates of the page table, it is only counted once."

But this doesn't seem to be true:

Meanwhile I observed that the description ("if the same page is visited twice (or more) between updates of the page table, it is only counted once.") can't be true:
I use $wgHitcounterUpdateFreq = '1100';. According to the description this means that the view counter of an accessed page is raised by 1 within 1100 total wiki page accesses, no matter if said page has been accessed more than once within those 1100 page accesses. Today I added a new page which I knew would be HOT. After 15 minutes the footer did not read the view count yet (less than 1100 total page accesses within that time, which seems ok with ~200,000 real page hits per day). After 30 mins it read that the page was accessed 50 times. This seems real too but can't be true with $wgHitcounterUpdateFreq = '1100'; according to the description! Cos this would mean that my wiki had 1100 x 50 = 55,000 page access in 30 minutes. No way!
Comment 2 Bawolff (Brian Wolff) 2011-03-28 03:48:02 UTC
This bug seems to lack a problem statement.

I added the stuff you're referring to on the page on mw.org. Hopefully I didn't say anything stupid and wrong.

The behaviour of how $wgHitcounterUpdateFreq updates is what I see on my computer. However the code seems to indicate the more expected behaviour should happen (it does a group by on hc_id, which is pointless unless you somehow get duplicate rows into that table). On my computer, inserting a duplicate row into the hitcounter table doesn't create two identical rows (As one expects in a relational database...).
Comment 3 Max Semenik 2011-03-28 15:09:03 UTC
(In reply to comment #2)
> The behaviour of how $wgHitcounterUpdateFreq updates is what I see on my
> computer. However the code seems to indicate the more expected behaviour should
> happen (it does a group by on hc_id, which is pointless unless you somehow get
> duplicate rows into that table). On my computer, inserting a duplicate row into
> the hitcounter table doesn't create two identical rows (As one expects in a
> relational database...).

C:\Projects\MediaWiki\maintenance>php sql.php
> insert into hitcounter values(1);
Query OK, 1 row(s) affected
> insert into hitcounter values(1);
Query OK, 1 row(s) affected
> select count(*) from hitcounter;
stdClass Object
(
    [count(*)] => 2
)
> select * from hitcounter;
stdClass Object
(
    [hc_id] => 1
)
stdClass Object
(
    [hc_id] => 1
)
>
Comment 4 Max Semenik 2011-03-28 15:14:27 UTC
Please don't use Bugzilla for support questions, and wiki pages are also offtopic here. In plain words, if you set $wgHitcounterUpdateFreq to 1000, it will update page view stats once in 1000 views, but if you press F5 1000 times on one page, its view counter will be increased by 1000, not by one. No bug ==> closed.
Comment 5 Subfader 2011-03-28 16:46:16 UTC
"if you set $wgHitcounterUpdateFreq to 1000, it
will update page view stats once in 1000 views, but if you press F5 1000 times
on one page, its view counter will be increased by 1000, not by one"

Then how is it performing better than without using it?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links