@shopify/statsd
Advanced tools
Comparing version 0.0.0-snapshot-20221206230340 to 0.0.0-snapshot-20221216174116
@@ -57,23 +57,23 @@ 'use strict'; | ||
distribution(stat, value, tags) { | ||
distribution(stat, value, tags, options = {}) { | ||
return new Promise(resolve => { | ||
this.statsd.distribution(stat, value, this.normalizeTags(tags), this.createCallback(resolve)); | ||
this.statsd.distribution(stat, value, options.sampleRate, this.normalizeTags(tags), this.createCallback(resolve)); | ||
}); | ||
} | ||
timing(stat, value, tags) { | ||
timing(stat, value, tags, options = {}) { | ||
return new Promise(resolve => { | ||
this.statsd.timing(stat, value, this.normalizeTags(tags), this.createCallback(resolve)); | ||
this.statsd.timing(stat, value, options.sampleRate, this.normalizeTags(tags), this.createCallback(resolve)); | ||
}); | ||
} | ||
gauge(stat, value, tags) { | ||
gauge(stat, value, tags, options = {}) { | ||
return new Promise(resolve => { | ||
this.statsd.gauge(stat, value, this.normalizeTags(tags), this.createCallback(resolve)); | ||
this.statsd.gauge(stat, value, options.sampleRate, this.normalizeTags(tags), this.createCallback(resolve)); | ||
}); | ||
} | ||
increment(stat, tags) { | ||
increment(stat, tags, options = {}) { | ||
return new Promise(resolve => { | ||
this.statsd.increment(stat, 1, this.normalizeTags(tags), this.createCallback(resolve)); | ||
this.statsd.increment(stat, 1, options.sampleRate, this.normalizeTags(tags), this.createCallback(resolve)); | ||
}); | ||
@@ -80,0 +80,0 @@ } |
@@ -16,2 +16,5 @@ import { StatsD, ClientOptions as HotShotClientOptions, ChildClientOptions as HotShotChildOptions } from 'hot-shots'; | ||
} | ||
export interface MetricOptions { | ||
sampleRate?: number; | ||
} | ||
export declare type Options = ClientOptions | ChildOptions; | ||
@@ -23,6 +26,6 @@ export declare class StatsDClient { | ||
constructor(options: Options); | ||
distribution(stat: string | string[], value: number, tags?: Tags): Promise<void>; | ||
timing(stat: string | string[], value: number, tags?: Tags): Promise<void>; | ||
gauge(stat: string | string[], value: number, tags?: Tags): Promise<void>; | ||
increment(stat: string | string[], tags?: Tags): Promise<void>; | ||
distribution(stat: string | string[], value: number, tags?: Tags, options?: MetricOptions): Promise<void>; | ||
timing(stat: string | string[], value: number, tags?: Tags, options?: MetricOptions): Promise<void>; | ||
gauge(stat: string | string[], value: number, tags?: Tags, options?: MetricOptions): Promise<void>; | ||
increment(stat: string | string[], tags?: Tags, options?: MetricOptions): Promise<void>; | ||
close(): Promise<void>; | ||
@@ -29,0 +32,0 @@ childClient(options?: Omit<ChildOptions, 'client'>): StatsDClient; |
{ | ||
"name": "@shopify/statsd", | ||
"version": "0.0.0-snapshot-20221206230340", | ||
"version": "0.0.0-snapshot-20221216174116", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "An opinionated StatsD client for Shopify Node.js servers and other StatsD utilities", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
17206
260