Reintroduce compile sampling for analysis (#18217)

* Revert "Merge pull request #14143 from overleaf/jlm-unsampled-compiles"

This reverts commit 2457977d61756be52db506d7c84531b22a26abe0, reversing
changes made to 3c452b3943c453707aac90d38e7b5b2ea9df0df4.

* Re-add export of `getPercentile` in SplitTestHandler.js

Was previously removed in aa8c0aadec

GitOrigin-RevId: 42c48829e7246a6bdb9dbb2d075638c1eafdf2f0
This commit is contained in:
Antoine Clausse 2024-05-06 09:44:49 +02:00 committed by Copybot
parent 2f99e3ccf1
commit eca84b9370
2 changed files with 9 additions and 1 deletions

View file

@ -160,7 +160,14 @@ module.exports = CompileController = {
pdfDownloadDomain += outputUrlPrefix pdfDownloadDomain += outputUrlPrefix
} }
if (limits) { if (
limits &&
SplitTestHandler.getPercentile(
AnalyticsManager.getIdsFromSession(req.session).analyticsId,
'compile-result-backend',
'release'
) === 1
) {
// For a compile request to be sent to clsi we need limits. // For a compile request to be sent to clsi we need limits.
// If we get here without having the limits object populated, it is // If we get here without having the limits object populated, it is
// a reasonable assumption to make that nothing was compiled. // a reasonable assumption to make that nothing was compiled.

View file

@ -499,6 +499,7 @@ async function _getSplitTest(name) {
} }
module.exports = { module.exports = {
getPercentile,
getAssignment: callbackify(getAssignment), getAssignment: callbackify(getAssignment),
getAssignmentForMongoUser: callbackify(getAssignmentForMongoUser), getAssignmentForMongoUser: callbackify(getAssignmentForMongoUser),
getAssignmentForUser: callbackify(getAssignmentForUser), getAssignmentForUser: callbackify(getAssignmentForUser),