Comparing version 10.0.0 to 10.1.0
CHANGELOG | ||
========= | ||
## 10.0 (2023-2-3) | ||
@imyourmanzi In TypeScript, narrow callback parameter types | ||
@bdeitte Remove Node 8 from supported list and add testing of Node 18 | ||
## 10.1.0 (2024-9-6) | ||
* @lachlankidson Add gaugeDelta function | ||
* @bdeitte Various dev library updates | ||
* @bdeitte Add Node 20 testing | ||
## 10.0.0 (2023-2-3) | ||
* @imyourmanzi In TypeScript, narrow callback parameter types | ||
* @bdeitte Remove Node 8 from supported list and add testing of Node 18 | ||
## 9.3.0 (2022-10-23) | ||
@@ -9,0 +15,0 @@ * @albert-mirzoyan add stream property type to ClientOptions |
@@ -204,2 +204,15 @@ const helpers = require('./helpers'); | ||
/** | ||
* Gauges a stat by a delta | ||
* @param stat {String|Array} The stat(s) to send | ||
* @param value The value to send | ||
* @param sampleRate {Number=} The Number of times to sample (0 to 1). Optional. | ||
* @param tags {Array=} The Array of tags to add to metrics. Optional. | ||
* @param callback {Function=} Callback when message is done being delivered. Optional. | ||
*/ | ||
Client.prototype.gaugeDelta = function (stat, value, sampleRate, tags, callback) { | ||
const sign = value >= 0 ? '+' : '-'; | ||
this.sendAll(stat, `${sign}${Math.abs(value)}`, 'g', sampleRate, tags, callback); | ||
}; | ||
/** | ||
* Counts unique values by a specified amount | ||
@@ -206,0 +219,0 @@ * @param stat {String|Array} The stat(s) to send |
{ | ||
"name": "hot-shots", | ||
"description": "Node.js client for StatsD, DogStatsD, and Telegraf", | ||
"version": "10.0.0", | ||
"version": "10.1.0", | ||
"author": "Steve Ivy", | ||
@@ -6,0 +6,0 @@ "types": "./types.d.ts", |
@@ -62,3 +62,3 @@ # hot-shots | ||
* `closingFlushInterval`: Before closing, StatsD will check for inflight messages. Time (ms) between each check. Defaults to `50`. | ||
* `udpSocketOptions`: Used only when the protocol is `uds`. Specify the options passed into dgram.createSocket(). Defaults to `{ type: 'udp4' }` | ||
* `udpSocketOptions`: Used only when the protocol is `udp`. Specify the options passed into dgram.createSocket(). Defaults to `{ type: 'udp4' }` | ||
@@ -131,2 +131,6 @@ ### StatsD methods | ||
// Gauge: Gauge a stat by a specified amount, but change it rather than setting it | ||
client.gaugeDelta('my_gauge', -10); | ||
client.gaugeDelta('my_gauge', 4); | ||
// Set: Counts unique occurrences of a stat (alias of unique) | ||
@@ -133,0 +137,0 @@ client.set('my_unique', 'foobar'); |
@@ -130,2 +130,7 @@ import dgram = require("dgram"); | ||
gaugeDelta(stat: string | string[], value: number, sampleRate?: number, tags?: Tags, callback?: StatsCb): void; | ||
gaugeDelta(stat: string | string[], value: number, tags?: Tags, callback?: StatsCb): void; | ||
gaugeDelta(stat: string | string[], value: number, callback?: StatsCb): void; | ||
gaugeDelta(stat: string | string[], value: number, sampleRate?: number, callback?: StatsCb): void; | ||
set(stat: string | string[], value: number | string, sampleRate?: number, tags?: Tags, callback?: StatsCb): void; | ||
@@ -132,0 +137,0 @@ set(stat: string | string[], value: number | string, tags?: Tags, callback?: StatsCb): void; |
Sorry, the diff of this file is not supported yet
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
92309
1628
312