diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2016-05-13 17:34:03 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2016-06-13 11:08:21 -0500 |
| commit | a55eb915a0d563ead7bd90ad91b9c86e98e87f7c (patch) | |
| tree | 824749feaae8e8342123856dc40fbef80ae4787c /openstackclient/common/timing.py | |
| parent | 9e2b8e67307e739008307e977ce545d49d0956a6 (diff) | |
| download | python-openstackclient-a55eb915a0d563ead7bd90ad91b9c86e98e87f7c.tar.gz | |
osc-lib: timing
Change-Id: I3fe27d98efa5090e084c676f7f8e6dad0157ed21
Diffstat (limited to 'openstackclient/common/timing.py')
| -rw-r--r-- | openstackclient/common/timing.py | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/openstackclient/common/timing.py b/openstackclient/common/timing.py index dd2aeb83..facbec35 100644 --- a/openstackclient/common/timing.py +++ b/openstackclient/common/timing.py @@ -11,31 +11,15 @@ # under the License. # -"""Timing Implementation""" +# NOTE(dtroyer): This file is deprecated in Jun 2016, remove after 4.x release +# or Jun 2017. -from osc_lib.command import command +import sys +from osc_lib.command.timing import * # noqa -class Timing(command.Lister): - """Show timing data""" - def take_action(self, parsed_args): - column_headers = ( - 'URL', - 'Seconds', - ) - - results = [] - total = 0.0 - 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, - results, - ) +sys.stderr.write( + "WARNING: %s is deprecated and will be removed after Jun 2017. " + "Please use osc_lib.command.timing\n" % __name__ +) |
