mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-21 04:52:47 -05:00
51 lines
1.9 KiB
JavaScript
51 lines
1.9 KiB
JavaScript
// leaderboardsGroup A/B Results
|
|
// Test started 2015-01-30, ended 2015-02-26
|
|
// Final results: no differences in level starts or completions. Perhaps they affect playtime or purchases, but harder to say. At least they don't hurt, so wejust turned them on for everyone always.
|
|
|
|
// Usage:
|
|
// mongo <address>:<port>/<database> <script file> -u <username> -p <password>
|
|
|
|
load('abTestHelpers.js');
|
|
|
|
var scriptStartTime = new Date();
|
|
try {
|
|
var startDay = '2015-02-07';
|
|
log("Today is " + new Date().toISOString().substr(0, 10));
|
|
log("Start day is " + startDay);
|
|
|
|
var eventFunnel = ['Started Level', 'Saw Victory'];
|
|
var levelSlugs = ['dungeons-of-kithgard', 'gems-in-the-deep', 'shadow-guard', 'forgetful-gemsmith', 'kounter-kithwise', 'kithgard-gates', 'rich-forager', 'village-guard'];
|
|
|
|
// getLeaderboardsGroup
|
|
var testGroupFn = function (testGroupNumber) {
|
|
var group = testGroupNumber % 64;
|
|
if (group < 16) return 'always';
|
|
if (group < 32) return 'early';
|
|
if (group < 48) return 'late';
|
|
return 'never';
|
|
};
|
|
|
|
var funnelData = getFunnelData(startDay, eventFunnel, testGroupFn, levelSlugs);
|
|
|
|
printFunnelData(funnelData, function (day, level, browser, group, started, finished, rate) {
|
|
if (day && level && browser && group) {
|
|
log(day + "\t" + group + "\t" + started + "\t" + finished + "\t" + rate.toFixed(2));
|
|
}
|
|
else if (level && browser && group) {
|
|
log(level + "\t" + browser + "\t" + (browser.length < 8 ? "\t": "") + group + "\t" + started + "\t" + finished + "\t" + rate.toFixed(2));
|
|
}
|
|
else if (level && group) {
|
|
log(level + "\t" + group + "\t" + started + "\t" + finished + "\t" + rate.toFixed(2));
|
|
}
|
|
else if (group) {
|
|
log(group + "\t" + started + "\t" + finished + "\t" + rate.toFixed(2));
|
|
}
|
|
});
|
|
}
|
|
catch(err) {
|
|
log("ERROR: " + err);
|
|
printjson(err);
|
|
}
|
|
finally {
|
|
log("Script runtime: " + (new Date() - scriptStartTime));
|
|
}
|