From 4844a257790deef231176557776754dde929f840 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 8 May 2014 22:42:21 -0500 Subject: Add basic timing support Add support for --timing options. Use cliff via a pseudo-command 'Timing' to support multiple outputformats. If an output format other than the default 'table' is selected use CSV since the timing data is in list form. Will pick up timing data for any client object that has a method similar to novaclient's get_timings(). TODO: * Stop instantiating all of the clientmanager client objects just to check for timing data. Descriptor magic required? Change-Id: I7f1076b7a250fba6a8b24b2ae9353a7f51b792b2 --- openstackclient/common/clientmanager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'openstackclient/common/clientmanager.py') diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py index b310f3ac..a2f85aff 100644 --- a/openstackclient/common/clientmanager.py +++ b/openstackclient/common/clientmanager.py @@ -49,7 +49,7 @@ class ClientManager(object): user_domain_id=None, user_domain_name=None, project_domain_id=None, project_domain_name=None, region_name=None, api_version=None, verify=True, - trust_id=None): + trust_id=None, timing=None): self._token = token self._url = url self._auth_url = auth_url @@ -67,6 +67,7 @@ class ClientManager(object): self._api_version = api_version self._trust_id = trust_id self._service_catalog = None + self.timing = timing # verify is the Requests-compatible form self._verify = verify @@ -116,7 +117,7 @@ def get_extension_modules(group): setattr( ClientManager, - ep.name, + module.API_NAME, ClientCache( getattr(sys.modules[ep.module_name], 'make_client', None) ), -- cgit v1.2.1