summaryrefslogtreecommitdiff
path: root/openstackclient/shell.py
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2014-09-05 02:00:36 -0500
committerlin-hua-cheng <os.lcheng@gmail.com>2015-04-07 23:53:31 -0700
commit0d689871b4d8c060e1d48a9472449f3d670333bb (patch)
treecdef140b5a66875ddbd9ff0ea7a561b5e2ec2b3a /openstackclient/shell.py
parenta9d1e3d2192aa965d15c89eb6a603faf2e95b7ec (diff)
downloadpython-openstackclient-0d689871b4d8c060e1d48a9472449f3d670333bb.tar.gz
Fix session timing
Subclass keystoneclient.session.Session to add the timing hooks to record the elapsed time returned by requests.Response objects, including the redirection history. Redirects are included individually and not rolled into the total time for the original request. This works for all clients that use OSC's session. Closes-Bug: #1402577 Change-Id: I9360c90c151579b89a37edb8c11c17feb15b3cb9
Diffstat (limited to 'openstackclient/shell.py')
-rw-r--r--openstackclient/shell.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index 3cfd7312..05882488 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -316,11 +316,10 @@ class OpenStackShell(app.App):
# Process collected timing data
if self.options.timing:
- # Loop through extensions
- for mod in self.ext_modules:
- client = getattr(self.client_manager, mod.API_NAME)
- if hasattr(client, 'get_timings'):
- self.timing_data.extend(client.get_timings())
+ # Get session data
+ self.timing_data.extend(
+ self.client_manager.session.get_timings(),
+ )
# Use the Timing pseudo-command to generate the output
tcmd = timing.Timing(self, self.options)