Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/218017
Change subject: Log 'resourceloader.forbidden' events from readers ...................................................................... Log 'resourceloader.forbidden' events from readers Follows-up f0625fe7d2a9a. No events were being logged from logged-in users, increasing scope to sampled logged-out users. Could be cache related. The problem definitely still exists because we're still seeing events logged server-side with production wiki page urls as referrers. Bug: T101806 Change-Id: Ie3084f19d03e7198ab21cb832f5a20bf14b263ff --- M WikimediaEvents.php M modules/ext.wikimediaEvents.deprecate.js M modules/ext.wikimediaEvents.resourceloader.js 3 files changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents refs/changes/17/218017/1 diff --git a/WikimediaEvents.php b/WikimediaEvents.php index 880b365..2f316d2 100644 --- a/WikimediaEvents.php +++ b/WikimediaEvents.php @@ -72,6 +72,7 @@ // Loaded globally for all users (including logged-out) // Don't remove if empty! 'scripts' => array( + 'ext.wikimediaEvents.resourceloader.js', ), 'localBasePath' => __DIR__ . '/modules', 'remoteExtPath' => 'WikimediaEvents/modules', @@ -82,7 +83,6 @@ // Don't remove if empty! 'scripts' => array( 'ext.wikimediaEvents.deprecate.js', - 'ext.wikimediaEvents.resourceloader.js', ), 'localBasePath' => __DIR__ . '/modules', 'remoteExtPath' => 'WikimediaEvents/modules', diff --git a/modules/ext.wikimediaEvents.deprecate.js b/modules/ext.wikimediaEvents.deprecate.js index cbd5811..164dc3f 100644 --- a/modules/ext.wikimediaEvents.deprecate.js +++ b/modules/ext.wikimediaEvents.deprecate.js @@ -7,7 +7,7 @@ return Math.floor( Math.random() * populationSize ) === 0; } - // Filter: Logged-in users + // Filter: Logged-in users only // Filter: Sampled if ( !mw.config.get( 'wgUserName' ) || !oneIn( 100 ) ) { return; diff --git a/modules/ext.wikimediaEvents.resourceloader.js b/modules/ext.wikimediaEvents.resourceloader.js index 080e72e..b9e1ab9 100644 --- a/modules/ext.wikimediaEvents.resourceloader.js +++ b/modules/ext.wikimediaEvents.resourceloader.js @@ -4,9 +4,13 @@ * @see https://phabricator.wikimedia.org/T101806 */ ( function ( mw ) { + function oneIn( populationSize ) { + return Math.floor( Math.random() * populationSize ) === 0; + } - // Filter: Logged-in users - if ( !mw.config.get( 'wgUserName' ) ) { + // Filter: Unsampled logged-in users + // Filter: Sampled logged-ou users + if ( !mw.config.get( 'wgUserName' ) && !oneIn( 100 ) ) { return; } -- To view, visit https://gerrit.wikimedia.org/r/218017 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3084f19d03e7198ab21cb832f5a20bf14b263ff Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaEvents Gerrit-Branch: wmf/1.26wmf9 Gerrit-Owner: Krinkle <krinklem...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits