mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
[node-statsd] Add function overloads for increment (#20359)
* [node-statsd] Add function overloads for increment * [node-statsd] Add a type test for the increment call
This commit is contained in:
committed by
Wesley Wigham
parent
ea4008d4e8
commit
874881be27
Vendored
+2
@@ -109,6 +109,8 @@ export class StatsD {
|
||||
* @param {Callback} callback Callback when message is done being delivered. Optional.
|
||||
*/
|
||||
increment(stat: string | string[], value?: number, sampleRate?: number, tags?: string[], callback?: Callback): void;
|
||||
increment(stat: string | string[], value: any, sampleRateOrTags?: number | string [], callback?: Callback): void;
|
||||
increment(stat: string | string[], value: any, callback?: Callback): void;
|
||||
|
||||
/**
|
||||
* Sends a stat across the wire
|
||||
|
||||
@@ -10,6 +10,8 @@ client.timing('response_time', 42);
|
||||
// Increment: Increments a stat by a value (default is 1)
|
||||
client.increment('my_counter');
|
||||
|
||||
client.increment('my_counter', 1, ['foo:1', 'bar:abc']);
|
||||
|
||||
// Decrement: Decrements a stat by a value (default is -1)
|
||||
client.decrement('my_counter');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user