Socket
Socket
Sign inDemoInstall

hot-shots

Package Overview
Dependencies
16
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.4.1 to 6.5.1

9

CHANGES.md
CHANGELOG
=========
## 6.5.1 (2019-9-28)
@msiebuhr Fix crasher when closing Unix Datagram Sockets without callback
## 6.5.0 (2019-9-22)
* @bdeitte Update decrement to handle missing arguments the same way
that increment does
* @bdeitte Document that memory may grow unbounded in mock mode
* @bdeitte Only load in unix-dgram library when uds protocol in use
## 6.4.1 (2019-9-19)

@@ -5,0 +14,0 @@ * @jfirebaugh Fix cacheDns option when obtaining host from DD_AGENT_HOST

21

lib/statsd.js

@@ -8,10 +8,4 @@ const dgram = require('dgram'),

// installed below, only if needed
let unixDgram;
try {
// this will not always be available
unixDgram = require('unix-dgram'); // eslint-disable-line global-require
}
catch (err) {
// ignore, with better details showing up in the npm install
}

@@ -65,6 +59,11 @@ const TCP = 'tcp';

} else if (args.protocol === UDS) {
if (! unixDgram) {
try {
// this will not always be available, as noted in the error message below
unixDgram = require('unix-dgram'); // eslint-disable-line global-require
}
catch (err) {
errMessage = 'The library unix_dgram, needed for the uds protocol to work, is not installed. You need to pick another protocol to use hot-shots. See the hot-shots README for additional details.';
}
else {
if (unixDgram) {
const udsPath = args.path ? args.path : UDS_PATH_DEFAULT;

@@ -496,3 +495,5 @@ try {

// close event, so we can callback right away
callback();
if (callback) {
callback();
}
}

@@ -499,0 +500,0 @@ else {

@@ -126,3 +126,16 @@ const helpers = require('./helpers');

Client.prototype.decrement = function (stat, value, sampleRate, tags, callback) {
this.sendAll(stat, -value || -1, 'c', sampleRate, tags, callback);
// allow use of tags without explicit value or sampleRate
if (arguments.length < 3) {
if (typeof value !== 'number') {
tags = value;
value = undefined;
}
}
// we explicitly check for undefined and null (and don't do a "! value" check)
// so that 0 values are allowed and sent through as-is
if (value === undefined || value === null) {
value = 1;
}
this.sendAll(stat, -value, 'c', sampleRate, tags, callback);
};

@@ -129,0 +142,0 @@

{
"name": "hot-shots",
"description": "Node.js client for StatsD, DogStatsD, and Telegraf",
"version": "6.4.1",
"version": "6.5.1",
"author": "Steve Ivy",

@@ -6,0 +6,0 @@ "types": "./types.d.ts",

@@ -36,5 +36,7 @@ # hot-shots

* `suffix`: What to suffix each stat name with `default: ''`
* `globalize`: Expose this StatsD instance globally? `default: false`
* `globalize`: Expose this StatsD instance globally. `default: false`
* `cacheDns`: Cache the initial dns lookup to *host* `default: false`
* `mock`: Create a mock StatsD instance, sending no stats to the server and allowing data to be read from mockBuffer? `default: false`
* `mock`: Create a mock StatsD instance, sending no stats to
the server and allowing data to be read from mockBuffer. Note that
mockBuffer will keep growing, so only use for testing or clear out periodically. `default: false`
* `globalTags`: Tags that will be added to every metric. Can be either an object or list of tags. The *Datadog* `dd.internal.entity_id` tag is appended to `globalTags` from the `DD_ENTITY_ID` environment variable if the latter is set. `default: {}`

@@ -41,0 +43,0 @@ * `maxBufferSize`: If larger than 0, metrics will be buffered and only sent when the string length is greater than the size. `default: 0`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc