Created
July 20, 2020 16:57
-
-
Save jcass8695/249e7c9c85a57ca9455a84d2aff6b4d7 to your computer and use it in GitHub Desktop.
StatsdClient typings update example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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