diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-04-17 20:47:55 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-04-17 20:47:55 +0000 |
| commit | cb681706fa5da9bf7ab4ebf9c4500896b2f90ca0 (patch) | |
| tree | c476aaa5591f14f50a9392224a88be0de4af7b66 /openstackclient/common/timing.py | |
| parent | 6c4f81516c6ad119d39c4952f3ab274f3d3f2efa (diff) | |
| parent | 0d689871b4d8c060e1d48a9472449f3d670333bb (diff) | |
| download | python-openstackclient-cb681706fa5da9bf7ab4ebf9c4500896b2f90ca0.tar.gz | |
Merge "Fix session timing"
Diffstat (limited to 'openstackclient/common/timing.py')
| -rw-r--r-- | openstackclient/common/timing.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/openstackclient/common/timing.py b/openstackclient/common/timing.py index 1c94682c..d13c86e7 100644 --- a/openstackclient/common/timing.py +++ b/openstackclient/common/timing.py @@ -33,10 +33,12 @@ class Timing(lister.Lister): results = [] total = 0.0 - for url, start, end in self.app.timing_data: - seconds = end - start - total += seconds - results.append((url, seconds)) + for url, td in self.app.timing_data: + # NOTE(dtroyer): Take the long way here because total_seconds() + # was added in py27. + sec = (td.microseconds + (td.seconds + td.days*86400) * 1e6) / 1e6 + total += sec + results.append((url, sec)) results.append(('Total', total)) return ( column_headers, |
