fix tagname for graphite

This commit is contained in:
Brian Gough
2016-05-10 09:41:39 +01:00
parent dfd2bc31ef
commit 143913c67f

View File

@@ -32,8 +32,8 @@ 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 # find the image tag to log it as a metric, e.g. 2015.1 (convert . to - for graphite)
tag = request.imageName?.match(/:(.*)/)?[1] or "default" tag = request.imageName?.match(/:(.*)/)?[1]?.replace(/\./g,'-') or "default"
tag = "other" if project_id?.match(/^[0-9a-f]{24}$/) # exclude smoke test 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}") Metrics.inc("compiles-with-image.#{tag}")