Page MenuHomePhabricator

Special:Statistics and Special:ActiveUsers should use the same query
Open, LowPublic

Description

The queries for {{NUMBEROFACTIVEUSERS}} (same as Special:Statistics) and Special:ActiveUsers are currently different.

ActiveUsersPager
function getQueryInfo() > 
	$activeUserSeconds = $this->getConfig()->get( 'ActiveUserDays' ) * 86400;
	$timestamp = $dbr->timestamp( wfTimestamp( TS_UNIX ) - $activeUserSeconds );
	$tables = [ 'querycachetwo', 'user', 'recentchanges' ];
	$conds = [
		'qcc_type' => 'activeusers',
		'qcc_namespace' => NS_USER,
		'user_name = qcc_title',
		'rc_user_text = qcc_title',
		'rc_type != ' . $dbr->addQuotes( RC_EXTERNAL ), // Don't count wikidata.
		'rc_type != ' . $dbr->addQuotes( RC_CATEGORIZE ), // Don't count categorization changes.
		'rc_log_type IS NULL OR rc_log_type != ' . $dbr->addQuotes( 'newusers' ),
		'rc_timestamp >= ' . $dbr->addQuotes( $timestamp ),
	];
SiteStatsUpdate
$activeUsers = $dbr->selectField(
	'recentchanges',
	'COUNT( DISTINCT rc_user_text )',
	[
		'rc_user != 0',
		'rc_bot' => 0,
		'rc_log_type != ' . $dbr->addQuotes( 'newusers' ) . ' OR rc_log_type IS NULL',
		'rc_timestamp >= ' . $dbr->addQuotes( $dbr->timestamp( wfTimestamp( TS_UNIX )
			- $wgActiveUserDays * 24 * 3600 ) ),

Details

Reference
bz22920

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:59 PM
bzimport set Reference to bz22920.
bzimport added a subscriber: Unknown Object (MLST).

In the end the number of users on Special:ActiveUsers should be the same as listed on Special:Statistics and given by {{NUMBEROFACTIVEUSERS}}.

special page was removed with gerrit 55807

(In reply to comment #2)

special page was removed with Gerrit change #55807

Back with gerrit 58686

Krinkle renamed this task from NUMBEROFACTIVEUSERS vs Special:Activeusers to Special:Statistics, {{NUMBEROFACTIVEUSERS}} and Special:Activeusers should match.May 8 2017, 12:11 AM
Krinkle edited subscribers, added: EddieGP; removed: wikibugs-l-list.
Krinkle renamed this task from Special:Statistics, {{NUMBEROFACTIVEUSERS}} and Special:Activeusers should match to Special:Statistics and Special:ActiveUsers should use the same query.May 8 2017, 12:14 AM
Krinkle updated the task description. (Show Details)
Krinkle moved this task from Backlog to User list on the MediaWiki-User-management board.