Permalink
Browse files

Store executino time as an IntField in ms so we can filter on it.

  • Loading branch information...
1 parent 200b6cc commit 281712346b3eb284b4542123f8afea49d39c8388 @thomasst thomasst committed Nov 12, 2012
Showing with 4 additions and 3 deletions.
  1. +1 −1 README.md
  2. +1 −1 flask_tracking/__init__.py
  3. +2 −1 flask_tracking/documents.py
View
@@ -46,7 +46,7 @@ The following query shows all requests that took longer than one second to execu
```
from flask.ext.tracking.documents import Tracking
-Tracking.objects.filter(execution_time__gte='1.0')
+Tracking.objects.filter(execution_time__gte=1000)
```
The following query shows all requests that were served between 23:40 and 23:45 UTC on October 22th, 2012:
@@ -57,7 +57,7 @@ def track_after(self, response):
ua = request.user_agent
if getattr(request, '_start_time', None):
- execution_time = time.time() - request._start_time
+ execution_time = int((time.time() - request._start_time) * 1000)
else:
execution_time = None
@@ -25,7 +25,8 @@ class Tracking(Document):
response_headers = ListField()
response_body = BinaryField()
- execution_time = DecimalField()
+ # Execution time in ms
+ execution_time = IntField()
custom_data = DynamicField()

0 comments on commit 2817123

Please sign in to comment.