Skip to content

Instantly share code, notes, and snippets.

@jcass8695
Created July 20, 2020 16:57
Show Gist options
  • Save jcass8695/249e7c9c85a57ca9455a84d2aff6b4d7 to your computer and use it in GitHub Desktop.
Save jcass8695/249e7c9c85a57ca9455a84d2aff6b4d7 to your computer and use it in GitHub Desktop.
StatsdClient typings update example
import SDC from 'statsd-client';
export default class StatsDClient {
private client: SDC;
constructor(config: any) { # config must be passed as any or we reimpliment CommonOptions/TcpOptions etc.
this.client = new SDC(config);
}
counter(metricName: string, delta: number, tags?: any) {
this.client.counter("mycompany." + metricName, delta, { ...tags, myStandardTag: getSomeValue() });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment