 		args = ["--linearize", src, tmpOutput]
 		logger.log args: args, "running qpdf command"
 
+		timer = new Metrics.Timer("qpdf")
 		proc = spawn("qpdf", args)
 		stdout = ""
 		proc.stdout.on "data", (chunk) ->

			logger.warn {err, args}, "qpdf failed"
			callback(null) # ignore the error
		proc.on "close", (code) ->
			if code != 0
				logger.warn {code, args}, "qpdf returned error"
				return callback(null) # ignore the error

Path = require "path"
spawn = require("child_process").spawn
logger = require "logger-sharelatex"
Metrics = require "./Metrics"
_ = require "underscore"

module.exports = OutputFileOptimiser =
