Don't call callback if not provided when using mock instances
…ck on mocks
… tests, closes #16.
Enable option to cache DNS lookup once
Caching the dns lookup leads to significant throughput gains for non-ip hostnames.
…t it will have a reference error.
some formatting errors
some formatting changes
…to access to api
Refactored and added a few useful features.
…sts to prevent regression
…e for each item in the array with the same value
"npm test" wouldn't run under Windows due to the fact that Windows doesn't support shebang style executable scripts. Also the default binding for UDP Datagram servers is 0.0.0.0 which is invalid for Windows. I specified the binding in the test to be 127.0.0.1 and now everything passes and runs properly.
…che every time the client is initialized
* Upped the version to 0.4 * Added myself as a contributor :) * Removed OS dependencies as we should not prevent someone from installing the package unless we know for a fact it doesn't work on that OS * Removed mersenne dependencies * Changed main to be index.js as this is the accepted standard
There are quite a few changes here. * Ensured there were no more global memory leaks * Added defaults to the initializer variables. The default host is `localhost` and the default port is `8125` * Added Prefix and suffix to class to allow users to specify what the name of each stat will start and end with. This allows for things like `<environment>.<project>.<stat>.<machine-name>` and other templates. * Added a globalize function that gives the user the option to make this instance of statsd global * Standardized all functions to take a `stat`, `value`, `sampleRate` (optional), and `callback` (optional) * Added an optional `callback` to each of the functions that will get called when the message is successfully sent * Standardized on camel case in accordance with the JS recommended styl guide * Added a default value of `1` for increments and `-1` for decrements * Added an alias of `unique` to `set` as set is rather ambiguous * Removed `mersenne` dependency as V8s `Math.random()` is faster and still provides an even distribution. For sampling purposes this is sufficient, we don't need cryptographic security or seeds here. * Added full JSDoc style comments to all methods.
Adding set support.
it should be populated by npm. not be checked in git
I checked that the version in npm is the same