+5
-2
@@ -690,3 +690,3 @@ <!DOCTYPE html> | ||
| <li>tags: array of "tag:value"'s to use for the metric</li> | ||
| <li>metric_type: which metric type to use ("gauge" or "counter") [default: gauge]</li> | ||
| <li>metric_type|type: which metric type to use ("gauge" or "count") [default: gauge]</li> | ||
| </ul> | ||
@@ -716,2 +716,5 @@ </dd> | ||
| }); | ||
| dogapi.metric.send("my.counter", 5, {type: "count"}, function(err, results){ | ||
| console.dir(results); | ||
| }); | ||
| </code></pre> | ||
@@ -733,3 +736,3 @@ </div> | ||
| <li>host: the source hostname to use for the metrics</li> | ||
| <li>metric_type: the type of metric to use ("gauge" or "counter") [default: gauge]</li> | ||
| <li>metric_type|type: the type of metric to use ("gauge" or "count") [default: gauge]</li> | ||
| </ul> | ||
@@ -736,0 +739,0 @@ </dd> |
+10
-14
@@ -15,3 +15,3 @@ var client = require("../client"); | ||
| * * tags: array of "tag:value"'s to use for the metric | ||
| * * metric_type|type: which metric type to use ("gauge" or "counter") [default: gauge] | ||
| * * metric_type|type: which metric type to use ("gauge" or "count") [default: gauge] | ||
| * callback: | | ||
@@ -37,3 +37,3 @@ * function(err, res) | ||
| * }); | ||
| * dogapi.metric.send("my.counter", 5, {type: "counter"}, function(err, results){ | ||
| * dogapi.metric.send("my.counter", 5, {type: "count"}, function(err, results){ | ||
| * console.dir(results); | ||
@@ -73,3 +73,3 @@ * }); | ||
| * * host: the source hostname to use for the metrics | ||
| * * metric_type|type: the type of metric to use ("gauge" or "counter") [default: gauge] | ||
| * * metric_type|type: the type of metric to use ("gauge" or "count") [default: gauge] | ||
| * callback: | | ||
@@ -202,18 +202,14 @@ * function(err, res) | ||
| " --host <host> the hostname that should be associated with this metric", | ||
| " --type <type> the type of metric \"gauge\" or \"counter\"" | ||
| " --type <type> the type of metric \"gauge\" or \"count\"" | ||
| ] | ||
| }, | ||
| handleCli: function(subcommand, args, callback){ | ||
| if(subcommand === "send"){ | ||
| if(args._.length > 5 && subcommand === "send"){ | ||
| var extra = {}; | ||
| if(args["--tags"]){ | ||
| extra.tags = args["--tags"].split(","); | ||
| if(args.tags){ | ||
| extra.tags = args.tags.split(","); | ||
| } | ||
| if(args["--host"]){ | ||
| extra.host = args["--host"]; | ||
| } | ||
| if(args["--type"]){ | ||
| extra.metric_type = args["--type"]; | ||
| } | ||
| send(args["<metric>"], args["<point>"], extra, callback); | ||
| extra.host = args.host; | ||
| extra.type = args.type; | ||
| send(args._[4], args._[5], extra, callback); | ||
| } else if(subcommand === "query" && args._.length > 6){ | ||
@@ -220,0 +216,0 @@ var from = parseInt(args._[4]); |
+1
-1
| { | ||
| "name": "dogapi", | ||
| "version": "2.1.1", | ||
| "version": "2.1.2", | ||
| "description": "Datadog API Node.JS Client", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
+14
-14
@@ -137,3 +137,3 @@ var assert = require("assert"); | ||
| // Make our api call | ||
| metric.send("metrics.send.counter", 5, {type: "counter"}); | ||
| metric.send("metrics.send.counter", 5, {type: "count"}); | ||
@@ -154,7 +154,7 @@ // Assert we called `client.request` with the correct `points` | ||
| // Assert the first series is properly formatted | ||
| // first_series = {metric: "", type: "counter", points: [], ...} | ||
| // first_series = {metric: "", type: "count", points: [], ...} | ||
| var first_series = series[0] | ||
| assert.equal(first_series.metric, "metrics.send.counter"); | ||
| assert(first_series.hasOwnProperty("type")); | ||
| assert.equal(first_series.type, "counter"); | ||
| assert.equal(first_series.type, "count"); | ||
| }); | ||
@@ -164,3 +164,3 @@ | ||
| // Make our api call | ||
| metric.send("metrics.send.counter", 5, {metric_type: "counter"}); | ||
| metric.send("metrics.send.counter", 5, {metric_type: "count"}); | ||
@@ -182,7 +182,7 @@ // Assert we called `client.request` with the correct `points` | ||
| // Assert the first series is properly formatted | ||
| // first_series = {metric: "", type: "counter", points: [], ...} | ||
| // first_series = {metric: "", type: "count", points: [], ...} | ||
| var first_series = series[0] | ||
| assert.equal(first_series.metric, "metrics.send.counter"); | ||
| assert(first_series.hasOwnProperty("type")); | ||
| assert.equal(first_series.type, "counter"); | ||
| assert.equal(first_series.type, "count"); | ||
| }); | ||
@@ -287,3 +287,3 @@ }); | ||
| points: 5, | ||
| type: "counter" | ||
| type: "count" | ||
| } | ||
@@ -301,3 +301,3 @@ ]; | ||
| // Properly formatted body | ||
| // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "counter"} ] } | ||
| // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "count"} ] } | ||
| // DEV: host/tags are optional and should be undefined for this case | ||
@@ -315,7 +315,7 @@ var data = call_args[2]; | ||
| // Assert the first series is properly formatted | ||
| // first_series = {metric: "", type: "counter", points: [], ...} | ||
| // first_series = {metric: "", type: "count", points: [], ...} | ||
| var first_series = series[0] | ||
| assert.equal(first_series.metric, "metric.send.counter"); | ||
| assert(Array.isArray(first_series.points)); | ||
| assert.deepEqual(first_series.type, "counter"); | ||
| assert.deepEqual(first_series.type, "count"); | ||
| }); | ||
@@ -329,3 +329,3 @@ | ||
| points: 5, | ||
| metric_type: "counter" | ||
| metric_type: "count" | ||
| } | ||
@@ -343,3 +343,3 @@ ]; | ||
| // Properly formatted body | ||
| // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "counter"} ] } | ||
| // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "count"} ] } | ||
| // DEV: host/tags are optional and should be undefined for this case | ||
@@ -357,9 +357,9 @@ var data = call_args[2]; | ||
| // Assert the first series is properly formatted | ||
| // first_series = {metric: "", type: "counter", points: [], ...} | ||
| // first_series = {metric: "", type: "count", points: [], ...} | ||
| var first_series = series[0] | ||
| assert.equal(first_series.metric, "metric.send.counter"); | ||
| assert(Array.isArray(first_series.points)); | ||
| assert.deepEqual(first_series.type, "counter"); | ||
| assert.deepEqual(first_series.type, "count"); | ||
| }); | ||
| }); | ||
| }); |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
174545
-0.01%3181
-0.13%