From d02f46fba75b8d7c770f07bf8dc4ad9701be8357 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Thu, 18 Apr 2013 16:58:32 -0400 Subject: [PATCH] Log a statsd event when restarting the server (imported from commit e9fa632a39f0a6b6aa7311e80e68faf4178a2cf3) --- tools/restart-server | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/restart-server b/tools/restart-server index 4692767931..a4b5eca726 100755 --- a/tools/restart-server +++ b/tools/restart-server @@ -5,6 +5,7 @@ import subprocess import pylibmc import traceback import logging +import time logging.basicConfig(format="%(asctime)s restart-server: %(message)s", level=logging.INFO) @@ -18,6 +19,9 @@ ENDC = '\033[0m' os.chdir("/home/humbug/humbug-deployments/current") +# Send a statsd event on restarting the server +subprocess.check_call(["python", "./manage.py", "send_stats", "gauge", "events.server_restart", str(int(time.time()))]) + # Restart the FastCGI process, which is running in a shell loop in screen. # TODO: real daemonization logging.info("Killing daemons")