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")