diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2014-05-08 22:42:21 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2014-07-08 02:04:00 -0500 |
| commit | 4844a257790deef231176557776754dde929f840 (patch) | |
| tree | 8055c40ae007029eb73900088c007b5c0553984c /openstackclient/common/clientmanager.py | |
| parent | ea938e8ddfa0f5f8832e09d61537f1e81e3121e9 (diff) | |
| download | python-openstackclient-4844a257790deef231176557776754dde929f840.tar.gz | |
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
Diffstat (limited to 'openstackclient/common/clientmanager.py')
| -rw-r--r-- | openstackclient/common/clientmanager.py | 5 |
1 files changed, 3 insertions, 2 deletions
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) ), |
