Add health status functionality #280

Merged
merged 3 commits into from Apr 8, 2013

Conversation

Projects
None yet
2 participants
Contributor

draco2003 commented Mar 28, 2013

Adds health check functionality to Statsd. This allows the ability to check the current status, as well as the ability to change the state manually in preparation for cluster mode functionality.

@mrtazz mrtazz commented on an outdated diff Mar 29, 2013

@@ -402,3 +415,13 @@ config.configFile(process.argv[2], function (config, oldConfig) {
}
}
});
+
+process.on('SIGTERM', function() {
+ if (config.debug) {
+ l.log('Going Down in ' + flushInterval + 'ms');
+ }
+ healthStatus = 'down';
+ setTimeout(function() {
+ process.exit();
+ }, flushInterval);
@mrtazz

mrtazz Mar 29, 2013

Owner

Maybe we just want to flush directly here and then just wait 1 or 2 seconds and call process.exit() afterwards.

Owner

mrtazz commented Mar 29, 2013

otherwise lgtm

Owner

mrtazz commented Apr 8, 2013

:shipit:

@draco2003 draco2003 added a commit that referenced this pull request Apr 8, 2013

@draco2003 draco2003 Merge pull request #280 from etsy/health_status
Add health status functionality, and handle SIGTERM more gracefully.
3b1bbac

@draco2003 draco2003 merged commit 3b1bbac into master Apr 8, 2013

1 check passed

default The Travis build passed
Details

draco2003 deleted the health_status branch Apr 8, 2013

@hbouvier hbouvier pushed a commit to hbouvier/statsd that referenced this pull request May 25, 2013

@draco2003 draco2003 Merge pull request #280 from etsy/health_status
Add health status functionality, and handle SIGTERM more gracefully.
4f9f216
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment