Sapan Bhatia | 11a3294 | 2015-01-07 01:09:02 -0500 | [diff] [blame] | 1 | from django.http import HttpResponse |
| 2 | from monitor import driver |
| 3 | import json |
| 4 | |
| 5 | def Stats(request): |
| 6 | model = request.GET['model_name'] |
| 7 | pk = int(request.GET['pk']) |
Sapan Bhatia | 0255e20 | 2015-01-10 04:51:57 +0000 | [diff] [blame] | 8 | meter = request.GET['meter'] |
| 9 | controller_name = request.GET['controller_name'] |
Sapan Bhatia | 11a3294 | 2015-01-07 01:09:02 -0500 | [diff] [blame] | 10 | |
Sapan Bhatia | 0255e20 | 2015-01-10 04:51:57 +0000 | [diff] [blame] | 11 | meters = driver.get_meter(meter, model, pk) |
| 12 | return HttpResponse(json.dumps(meters)) |