Last modified: 2009-08-07 12:10:05 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 T20930, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18930 - initStats does not refresh active_users count (with patch)
initStats does not refresh active_users count (with patch)
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 20105 (view as bug list)
Depends on:
Blocks: 19133
  Show dependency treegraph
 
Reported: 2009-05-26 13:18 UTC by Przemek Piotrowski
Modified: 2009-08-07 12:10 UTC (History)
3 users (show)

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


Attachments

Description Przemek Piotrowski 2009-05-26 13:18:49 UTC
site_stats.ss_active_users count is refreshed on each visit to special:statistics page (modulo wgMiserMode switch) - to make it more up to date than the rest of stats (which are refreshed via maintenance/initStats script), presumably. But it is not refreshed by initStats script itself what is strange and what bites sites with premanent/frequent wgMiserMode states.

Patch:
Index: maintenance/initStats.inc
===================================================================
--- maintenance/initStats.inc   (revision 9043)
+++ maintenance/initStats.inc   (working copy)
@@ -20,8 +20,13 @@
        wfOut( "{$pages}\nCounting number of users..." );
 
        $users = $dbr->selectField( 'user', 'COUNT(*)', '', __METHOD__ );
-       wfOut( "{$users}\nCounting number of admins..." );
+       wfOut( "{$users}\nCounting number of active users..." );
 
+       $active_users = $dbr->selectField( 'recentchanges', 'COUNT( DISTINCT rc_user_text )',
+                array( 'rc_user != 0', 'rc_bot' => 0, "rc_log_type != 'newusers' OR rc_log_type IS NULL" ),
+                                        __METHOD__ );
+       wfOut( "{$active_users}\nCounting number of admins..." );
+
        $admin = $dbr->selectField( 'user_groups', 'COUNT(*)', array( 'ug_group' => 'sysop' ), __METHOD__ );
        wfOut( "{$admin}\nCounting number of images..." );
 
@@ -41,6 +46,7 @@
                                        'ss_good_articles' => $good,
                                        'ss_total_pages' => $pages,
                                        'ss_users' => $users,
+                                       'ss_active_users' => $active_users,
                                        'ss_admins' => $admin,
                                        'ss_images' => $image );
        $conds = array( 'ss_row_id' => 1 );
Comment 1 Brion Vibber 2009-05-26 23:02:04 UTC
Should probably call SiteStats::cacheUpdate here rather than duplicating the code.
Comment 2 Chad H. 2009-06-28 15:33:59 UTC
Fix committed to branch in r52513
Comment 3 Chad H. 2009-08-02 19:36:16 UTC
Fixed in trunk in r54225.
Comment 4 Chad H. 2009-08-07 12:10:05 UTC
*** Bug 20105 has been marked as a duplicate of this bug. ***

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


Navigation
Links