This commit is contained in:
Dave Horton
2020-02-28 10:25:43 -05:00
parent 19d674f531
commit 8cf107c34c
7 changed files with 9 additions and 8 deletions

View File

@@ -86,12 +86,12 @@ class Requestor {
const diff = process.hrtime(startAt);
const time = diff[0] * 1e3 + diff[1] * 1e-6;
const rtt = time.toFixed(0);
this.logger.debug(`Requestor:request ${method} ${url} succeeded in ${rtt}ms`);
if (buf) this.stats.histogram('app.hook.response_time', rtt, ['hook_type:app']);
if (buf && buf.toString().length > 0) {
try {
const json = JSON.parse(buf.toString());
this.logger.info({response: json}, `Requestor:request ${method} ${url} succeeded in ${rtt}ms`);
return json;
}
catch (err) {