Merge pull request #4210 from overleaf/jpa-pdf-caching-5-percent

[misc] pdf caching out of beta with 5%/5% control/treatment split test

GitOrigin-RevId: 06a741f56510b866be3380a99304d8ee67f849dd
This commit is contained in:
Jakob Ackermann 2021-06-16 10:15:09 +02:00 committed by Copybot
parent 3414646290
commit a6cce9d2f6
4 changed files with 12 additions and 38 deletions

View file

@ -715,7 +715,7 @@ const ProjectController = {
if (!userId) return cb(null, '')
SplitTestHandler.getTestSegmentation(
userId,
'pdf_caching_beta_full',
'pdf_caching_5',
(err, segmentation) => {
if (err) {
// Do not fail loading the editor.
@ -813,8 +813,7 @@ const ProjectController = {
return false
}
const canSeeFeaturePreview =
user.alphaProgram ||
(user.betaProgram && pdfCachingFeatureFlag.includes(flag))
user.alphaProgram || pdfCachingFeatureFlag.includes(flag)
if (!canSeeFeaturePreview) {
// The user is not in the target group.
return false

View file

@ -347,16 +347,16 @@ module.exports = {
],
},
{
id: 'pdf_caching_beta_full',
active: process.env.SPLIT_TEST_PDF_CACHING_BETA_ACTIVE === 'true',
id: 'pdf_caching_5',
active: process.env.SPLIT_TEST_PDF_CACHING_5_ACTIVE === 'true',
variants: [
{
id: 'collect-metrics-only',
rolloutPercent: 50,
rolloutPercent: 5,
},
{
id: 'collect-metrics-and-enable-caching',
rolloutPercent: 50,
rolloutPercent: 5,
},
],
},

View file

@ -79,7 +79,7 @@ function submitCompileMetrics(metrics) {
compileTimeServerE2E: timings.compileE2E,
}
sl_console.log('/event/compile-metrics', JSON.stringify(metrics))
sendMB('compile-metrics-v3', leanMetrics, SAMPLING_RATE)
sendMB('compile-metrics-v4', leanMetrics, SAMPLING_RATE)
}
function submitPDFBandwidth(metrics) {
@ -91,5 +91,5 @@ function submitPDFBandwidth(metrics) {
})
})
sl_console.log('/event/pdf-bandwidth', JSON.stringify(metrics))
sendMB('pdf-bandwidth-v3', metricsFlat, SAMPLING_RATE)
sendMB('pdf-bandwidth-v4', metricsFlat, SAMPLING_RATE)
}

View file

@ -1230,11 +1230,6 @@ describe('ProjectController', function () {
this.user.alphaProgram = true
})
}
function tagBeta() {
beforeEach(function () {
this.user.betaProgram = true
})
}
beforeEach(function () {
this.settings.enablePdfCaching = true
@ -1252,13 +1247,9 @@ describe('ProjectController', function () {
tagAlpha()
expectToCollectMetricsAndCachePDF()
})
describe('beta user', function () {
tagBeta()
expectToNotBeEnrolledAtAll()
})
})
describe('during beta roll-out', function () {
describe('during regular roll-out', function () {
describe('disabled', function () {
showNoVariant()
@ -1273,17 +1264,13 @@ describe('ProjectController', function () {
tagAlpha()
expectToCollectMetricsAndCachePDF()
})
describe('beta user', function () {
tagBeta()
expectToNotBeEnrolledAtAll()
})
})
describe('variant=collect-metrics', function () {
showVariant('collect-metrics')
describe('regular user', function () {
expectToNotBeEnrolledAtAll()
expectToCollectMetricsOnly()
})
describe('anonymous user', function () {
tagAnonymous()
@ -1293,17 +1280,13 @@ describe('ProjectController', function () {
tagAlpha()
expectToCollectMetricsAndCachePDF()
})
describe('beta user', function () {
tagBeta()
expectToCollectMetricsOnly()
})
})
describe('variant=collect-metrics-and-enable-caching', function () {
showVariant('collect-metrics-and-enable-caching')
describe('regular user', function () {
expectToNotBeEnrolledAtAll()
expectToCollectMetricsAndCachePDF()
})
describe('anonymous user', function () {
tagAnonymous()
@ -1313,17 +1296,13 @@ describe('ProjectController', function () {
tagAlpha()
expectToCollectMetricsAndCachePDF()
})
describe('beta user', function () {
tagBeta()
expectToCollectMetricsAndCachePDF()
})
})
describe('variant=enable-caching-only', function () {
showVariant('enable-caching-only')
describe('regular user', function () {
expectToNotBeEnrolledAtAll()
expectToCachePDFOnly()
})
describe('anonymous user', function () {
tagAnonymous()
@ -1333,10 +1312,6 @@ describe('ProjectController', function () {
tagAlpha()
expectToCollectMetricsAndCachePDF()
})
describe('beta user', function () {
tagBeta()
expectToCachePDFOnly()
})
})
})
})