Skip to content

Instantly share code, notes, and snippets.

@phuedx
Last active August 11, 2017 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phuedx/d580f01c501d207398828b717bf9870b to your computer and use it in GitHub Desktop.
Save phuedx/d580f01c501d207398828b717bf9870b to your computer and use it in GitHub Desktop.
MediaWiki experiment session generator!!1
(function () {
// ---
// EXPERIMENT DEFINITION
// ---
const experiment = {
enabled: true,
name: 'ext.Popups.instrumentation.eventLogging',
buckets: {
control: 1 - 0.001,
A: 0.001
}
}
const ITERATIONS = 1000000
const LIMIT = 10
for (let i = j = 0; i < ITERATIONS, j < LIMIT; ++i) {
if (mw.experiments.getBucket(experiment, i.toString()) === 'A') {
console.log(`mw.storage.session.set('mwuser-sessionId', ${i})`)
++j
}
}
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment