diff --git a/src/newrelic.coffee b/src/newrelic.coffee index 04d42de..5456038 100644 --- a/src/newrelic.coffee +++ b/src/newrelic.coffee @@ -42,6 +42,10 @@ prepareEvent = (job) -> slush: slush input_bytes: job.input_bytes output_bytes: job.output_bytes + input_width: job.input_width + input_height: job.input_height + output_width: job.output_width + output_height: job.output_height # error error: job.error?.result?.error diff --git a/src/processing.coffee b/src/processing.coffee index 4d8b1d4..83df716 100644 --- a/src/processing.coffee +++ b/src/processing.coffee @@ -213,9 +213,13 @@ class JobExecutor extends EventEmitter inputType = if downloads.input? then common.typeFromMime downloads.input.type else null inputFile = if downloads.input? then downloads.input.path else null - processor.process outf, req.outtype, graph, req.iips, inputFile, inputType, (err, stderr) => + processor.process outf, req.outtype, graph, req.iips, inputFile, inputType, (err, stderr, metadata={}) => job.processed_at = Date.now() + job.input_width = metadata.input?.width + job.input_height = metadata.input?.height + job.output_width = metadata.output?.width + job.output_height = metadata.output?.height @collectImageStats inputFile, (err, inStats) => @logEvent 'image-stats-error', { request: request_url, err: err } if err @collectImageStats outf, (err, outStats) =>