ceejbot/statsd — pull request #1 by ceejbot (2013-08-05 21:00:14+00:00)
Title: make statsd wrappable

Moved the guts of the service into core.js, which exports `createServer()`, `flushMetrics()`, and the new function `setHealthStatus()`. createService() takes a configuration object and a log object as parameters. To shut down, you call flushMetrics(). With server setup moved out of the callback for the config file read, however, you now have far more flexibility about where you get the configuration. You can also control the signal handling or server life cycle differently.

The service is still invoked with `node stats.js configfile.js`. stats.js reads the config file, creates a logging object as before, and passes them to createServer(), exactly as before. All tests still pass.