From ddc2293d4bb517b16d4bdf887238e7474d2dd365 Mon Sep 17 00:00:00 2001 From: Andrew Melton <andrew.melton@rackspace.com> Date: Tue, 12 Feb 2013 16:07:46 -0500 Subject: [PATCH 1/3] Updating pip-requires --- etc/pip-requires.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/pip-requires.txt b/etc/pip-requires.txt index 3dcf02d..46c7581 100644 --- a/etc/pip-requires.txt +++ b/etc/pip-requires.txt @@ -1,3 +1,6 @@ Django>=1.4.2 MySQL-python>=1.2.3 eventlet>=0.9.17 +kombu==2.5.4 +Pympler==0.3.0 +librabbitmq==1.0.1 From fda6d67b85331ea9ee1f206500e68b604e8a6f0c Mon Sep 17 00:00:00 2001 From: Andrew Melton <andrew.melton@rackspace.com> Date: Thu, 14 Feb 2013 14:45:00 -0500 Subject: [PATCH 2/3] Revert "Updating pip-requires" This reverts commit ddc2293d4bb517b16d4bdf887238e7474d2dd365. --- etc/pip-requires.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/etc/pip-requires.txt b/etc/pip-requires.txt index 46c7581..3dcf02d 100644 --- a/etc/pip-requires.txt +++ b/etc/pip-requires.txt @@ -1,6 +1,3 @@ Django>=1.4.2 MySQL-python>=1.2.3 eventlet>=0.9.17 -kombu==2.5.4 -Pympler==0.3.0 -librabbitmq==1.0.1 From e54a95be6bbd70f2fcfa13c9b10bda0686e9f63a Mon Sep 17 00:00:00 2001 From: Andrew Melton <andrew.melton@rackspace.com> Date: Thu, 14 Feb 2013 15:27:02 -0500 Subject: [PATCH 3/3] Improving str_time_to_unix() --- stacktach/views.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/stacktach/views.py b/stacktach/views.py index d770645..10e6a6d 100644 --- a/stacktach/views.py +++ b/stacktach/views.py @@ -321,17 +321,25 @@ def aggregate_usage(raw): def str_time_to_unix(when): - try: - when = datetime.datetime.strptime(when, "%Y-%m-%d %H:%M:%S") - except ValueError: + if 'T' in when: + try: + # Old way of doing it + when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S.%f") + except ValueError: + try: + # Old way of doing it, no millis + when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S") + except Exception, e: + print "BAD DATE: ", e + else: try: when = datetime.datetime.strptime(when, "%Y-%m-%d %H:%M:%S.%f") except ValueError: try: - # Old way of doing it - when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S.%f") + when = datetime.datetime.strptime(when, "%Y-%m-%d %H:%M:%S") except Exception, e: print "BAD DATE: ", e + return dt.dt_to_decimal(when)