From a3e85f53578eba0eb007f7040494cd625a2351c9 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Wed, 2 Mar 2022 12:59:49 +0000 Subject: [PATCH] Merge pull request #6959 from overleaf/jpa-clsi-zero-bucket [clsi] add zero bucket and collect histogram data in timing as well GitOrigin-RevId: 6390f1c213e4850ceb629dae1e6406f6077759aa --- services/clsi/app/js/CompileManager.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/services/clsi/app/js/CompileManager.js b/services/clsi/app/js/CompileManager.js index 2ef8abba1e..1cf362cd1f 100644 --- a/services/clsi/app/js/CompileManager.js +++ b/services/clsi/app/js/CompileManager.js @@ -22,7 +22,7 @@ const SynctexOutputParser = require('./SynctexOutputParser') const COMPILE_TIME_BUCKETS = [ // NOTE: These buckets are locked in per metric name. // If you want to change them, you will need to rename metrics. - 1, 2, 3, 4, 6, 8, 11, 15, 22, 31, 43, 61, 86, 121, 170, 240, + 0, 1, 2, 3, 4, 6, 8, 11, 15, 22, 31, 43, 61, 86, 121, 170, 240, ].map(seconds => seconds * 1000) function getCompileName(projectId, userId) { @@ -63,7 +63,7 @@ function doCompile(request, callback) { const outputDir = getOutputDir(request.project_id, request.user_id) const timerE2E = new Metrics.Timer( - 'compile-e2e', + 'compile-e2e-v2', 1, request.metricsOpts, COMPILE_TIME_BUCKETS @@ -270,11 +270,17 @@ function doCompile(request, callback) { ) if (stats['latex-runs'] > 0) { Metrics.histogram( - 'avg-compile-per-pass', + 'avg-compile-per-pass-v2', ts / stats['latex-runs'], COMPILE_TIME_BUCKETS, request.metricsOpts ) + Metrics.timing( + 'avg-compile-per-pass-v2', + ts / stats['latex-runs'], + 1, + request.metricsOpts + ) } if (stats['latex-runs'] > 0 && timings['cpu-time'] > 0) { Metrics.timing( @@ -321,6 +327,12 @@ function doCompile(request, callback) { // Emit e2e compile time. timings.compileE2E = timerE2E.done() + Metrics.timing( + 'compile-e2e-v2', + timings.compileE2E, + 1, + request.metricsOpts + ) if (stats['pdf-size']) { emitPdfStats(stats, timings, request)