Comparing version 1.0.5 to 1.0.6
@@ -41,2 +41,18 @@ var client = require("../client"); | ||
} | ||
// Try to normalize `points` | ||
// DEV: We need `points` to be an array of arrays regardless of what they give us | ||
// Always wrap points in an array, this way we will get: | ||
// 500 => [500] | ||
// [<timestamp>, 500] => [[<timestamp>, 500]] | ||
points = [points]; | ||
points = points.map(function(point){ | ||
// Make sure each point is an array, if not make array with current timestamp | ||
// 500 => [<timestamp>, 500] | ||
// [<timestamp>, 500] => unchanged | ||
if(!Array.isArray(point)){ | ||
var now = parseInt(new Date().getTime() / 1000); | ||
point = [now, point]; | ||
} | ||
return point; | ||
}); | ||
@@ -43,0 +59,0 @@ extra = extra || {}; |
{ | ||
"name": "dogapi", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Datadog API Node.JS Client", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha ./test", | ||
"test": "./node_modules/.bin/mocha --recursive ./test", | ||
"docs": "node ./docs/create.js > index.html" | ||
@@ -46,4 +46,5 @@ }, | ||
"marked": "^0.3.3", | ||
"mocha": "^2.2.5" | ||
"mocha": "^2.2.5", | ||
"sinon": "^1.15.4" | ||
} | ||
} |
@@ -13,2 +13,9 @@ node-dogapi | ||
## StatsD | ||
`dogapi` does not provide any functionality to talk to a local `dogstatsd` server. | ||
This library is purely an interface to the HTTP api. | ||
If you are looking for a good Datadog StatsD library, I recommend checking out [node-dogstatsd](https://github.com/joybro/node-dogstatsd). | ||
## Installation | ||
@@ -15,0 +22,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
150476
27
2727
117
7