Skip to content

Commit a55eb91

Browse files
author
Dean Troyer
committed
osc-lib: timing
Change-Id: I3fe27d98efa5090e084c676f7f8e6dad0157ed21
1 parent 9e2b8e6 commit a55eb91

3 files changed

Lines changed: 9 additions & 119 deletions

File tree

openstackclient/common/timing.py

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,15 @@
1111
# under the License.
1212
#
1313

14-
"""Timing Implementation"""
14+
# NOTE(dtroyer): This file is deprecated in Jun 2016, remove after 4.x release
15+
# or Jun 2017.
1516

16-
from osc_lib.command import command
17+
import sys
1718

19+
from osc_lib.command.timing import * # noqa
1820

19-
class Timing(command.Lister):
20-
"""Show timing data"""
2121

22-
def take_action(self, parsed_args):
23-
column_headers = (
24-
'URL',
25-
'Seconds',
26-
)
27-
28-
results = []
29-
total = 0.0
30-
for url, td in self.app.timing_data:
31-
# NOTE(dtroyer): Take the long way here because total_seconds()
32-
# was added in py27.
33-
sec = (td.microseconds + (td.seconds + td.days *
34-
86400) * 1e6) / 1e6
35-
total += sec
36-
results.append((url, sec))
37-
results.append(('Total', total))
38-
return (
39-
column_headers,
40-
results,
41-
)
22+
sys.stderr.write(
23+
"WARNING: %s is deprecated and will be removed after Jun 2017. "
24+
"Please use osc_lib.command.timing\n" % __name__
25+
)

openstackclient/shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from cliff import command
2727
from cliff import complete
2828
from cliff import help
29+
from osc_lib.command import timing
2930
from osc_lib import exceptions as exc
3031
from osc_lib import logs
3132
from osc_lib import utils
@@ -35,7 +36,6 @@
3536
import openstackclient
3637
from openstackclient.common import clientmanager
3738
from openstackclient.common import commandmanager
38-
from openstackclient.common import timing
3939

4040
from os_client_config import config as cloud_config
4141

openstackclient/tests/common/test_timing.py

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)