Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: compute_engine_scripts/monitoring/graphite.wsgi

Issue 310253003: Add setup scripts for a Graphite server. (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compute_engine_scripts/monitoring/graphite.wsgi
diff --git a/compute_engine_scripts/monitoring/graphite.wsgi b/compute_engine_scripts/monitoring/graphite.wsgi
new file mode 100644
index 0000000000000000000000000000000000000000..5503f6893f3e672e4ed74a610c886acb24c3070a
--- /dev/null
+++ b/compute_engine_scripts/monitoring/graphite.wsgi
@@ -0,0 +1,18 @@
+import os, sys
+sys.path.append('/home/www-data/graphite/lib')
+sys.path.append('/home/www-data/graphite/webapp')
+os.environ['DJANGO_SETTINGS_MODULE'] = 'graphite.settings'
+
+import django.core.handlers.wsgi
+
+application = django.core.handlers.wsgi.WSGIHandler()
+
+# READ THIS
+# Initializing the search index can be very expensive, please include
+# the WSGIImportScript directive pointing to this script in your vhost
+# config to ensure the index is preloaded before any requests are handed
+# to the process.
+from graphite.logger import log
+log.info("graphite.wsgi - pid %d - reloading search index" % os.getpid())
+import graphite.metrics.search
+

Powered by Google App Engine
This is Rietveld 408576698