diff --git a/resources/ext.popups.logger.js b/resources/ext.popups.logger.js index e08297c25..81a26d440 100644 --- a/resources/ext.popups.logger.js +++ b/resources/ext.popups.logger.js @@ -6,6 +6,12 @@ */ var logger = {}; + /** + * Sampling rate at which events are logged + * @property samplingRate + */ + logger.samplingRate = 10; + /** * Get action based on click event * @@ -35,7 +41,10 @@ * @return {jQuery.Promise} */ logger.log = function ( event ) { - if ( mw.eventLog === undefined ) { + if ( + mw.eventLog === undefined || + Math.floor( Math.random() * logger.samplingRate ) !== 0 + ) { return $.Deferred().resolve(); }