Преглед изворни кода

add a metric for the TeXLive image used on each compile

Brian Gough пре 10 година
родитељ
комит
ebcf9a75ae
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      services/clsi/app/coffee/CompileManager.coffee

+ 4 - 0
services/clsi/app/coffee/CompileManager.coffee

@@ -32,7 +32,11 @@ module.exports = CompileManager =
 			injectDraftModeIfRequired (error) ->
 			injectDraftModeIfRequired (error) ->
 				return callback(error) if error?
 				return callback(error) if error?
 				timer = new Metrics.Timer("run-compile")
 				timer = new Metrics.Timer("run-compile")
+				# find the image tag to log it as a metric
+				tag = request.imageName?.match(/:(.*)/)?[1] or "default"
+				tag = "other" if project_id?.match(/^[0-9a-f]{24}$/) # exclude smoke test
 				Metrics.inc("compiles")
 				Metrics.inc("compiles")
+				Metrics.inc("compiles-with-image.#{tag}")
 				LatexRunner.runLatex request.project_id, {
 				LatexRunner.runLatex request.project_id, {
 					directory: compileDir
 					directory: compileDir
 					mainFile:  request.rootResourcePath
 					mainFile:  request.rootResourcePath