소스 검색

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 https://github.com/overleaf/internal/commit/aa8c0aadec90b23ead60a4baeb33d6c3c6a2e536

GitOrigin-RevId: 42c48829e7246a6bdb9dbb2d075638c1eafdf2f0
Antoine Clausse 2 년 전
부모
커밋
eca84b9370
2개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      services/web/app/src/Features/Compile/CompileController.js
  2. 1 0
      services/web/app/src/Features/SplitTests/SplitTestHandler.js

+ 8 - 1
services/web/app/src/Features/Compile/CompileController.js

@@ -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.

+ 1 - 0
services/web/app/src/Features/SplitTests/SplitTestHandler.js

@@ -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),