jsonapi-server
Advanced tools
Comparing version 1.14.0 to 1.15.0
@@ -0,1 +1,3 @@ | ||
- 2016-06-28 - v1.15.0 | ||
- 2016-06-28 - Scrap sub-millisecond accuracy on metrics | ||
- 2016-06-27 - v1.14.0 | ||
@@ -2,0 +4,0 @@ - 2016-06-27 - Enabled application metrics |
@@ -113,3 +113,3 @@ /* @flow weak */ | ||
res._request = request; | ||
res._startDate = router._getPreciseTime(); | ||
res._startDate = new Date(); | ||
router.authenticate(request, res, function() { | ||
@@ -189,3 +189,3 @@ return callback(request, resourceConfig, res); | ||
router.sendResponse = function(res, payload, httpCode) { | ||
var timeDiff = router._getTimeDiff(router._getPreciseTime(), res._startDate); | ||
var timeDiff = (new Date()) - res._startDate; | ||
metrics.processResponse(res._request, httpCode, payload, timeDiff); | ||
@@ -198,10 +198,1 @@ res.status(httpCode).json(payload); | ||
}; | ||
router._getTimeDiff = function(a, b) { | ||
return parseFloat((a - b).toFixed(2)); | ||
}; | ||
router._getPreciseTime = function() { | ||
var parts = process.hrtime(); | ||
return (((parts[0]*1000)+(parts[1]/1000000))%10000).toFixed(2); | ||
}; |
{ | ||
"name": "jsonapi-server", | ||
"version": "1.14.0", | ||
"version": "1.15.0", | ||
"description": "A config driven NodeJS framework implementing json:api", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
246943
5730