diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/policy.js | 2 | ||||
-rw-r--r-- | lib/promise_request.js | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/policy.js b/lib/policy.js index d471cff..7c47dd3 100644 --- a/lib/policy.js +++ b/lib/policy.js @@ -26,7 +26,7 @@ const config = process.mainModule.exports.config; const createError = require('./dispatcher-error').createDispatcherError; const logger = require('./logging').getLogger(); -var cloudify = require("./cloudify.js"); +const cloudify = require("./cloudify.js"); // Set config for cloudify interface library cloudify.setAPIAddress(config.cloudify.url); diff --git a/lib/promise_request.js b/lib/promise_request.js index 68e8c2f..c34227d 100644 --- a/lib/promise_request.js +++ b/lib/promise_request.js @@ -113,16 +113,18 @@ exports.doRequest = function(mainReq, options, body, targetEntity) { } opInfo.respCode = resp.statusCode || 500; + const metrics_text = "res: " + result.body + + ((reqBody && " req: " + ((typeof(reqBody) !== 'string' && typeof(reqBody)) || reqBody)) || ""); if (resp.statusCode > 199 && resp.statusCode < 300) { // HTTP status code indicates success - resolve the promise opInfo.complete = true; - logger.metrics(mainReq, opInfo, result.body); + logger.metrics(mainReq, opInfo, metrics_text); resolve(result); } else { // Reject the promise opInfo.complete = false; - logger.metrics(mainReq, opInfo, result.body); + logger.metrics(mainReq, opInfo, metrics_text); reject(result); } |