Statistics view for ceilometer-based stats
Sapan Bhatia [Wed, 7 Jan 2015 06:09:02 +0000 (01:09 -0500)]
planetstack/core/views/stats.py [new file with mode: 0644]

diff --git a/planetstack/core/views/stats.py b/planetstack/core/views/stats.py
new file mode 100644 (file)
index 0000000..46ebe2e
--- /dev/null
@@ -0,0 +1,11 @@
+from django.http import HttpResponse
+from monitor import driver
+import json
+
+def Stats(request):
+    model = request.GET['model_name']
+    pk = int(request.GET['pk'])
+    meter = int(request.GET['meter'])
+    
+    meters = monitor.get_meters(meter, model, pk)
+    return json.dumps(meters)