File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ )
Original file line number Diff line number Diff line change 2626from cliff import command
2727from cliff import complete
2828from cliff import help
29+ from osc_lib .command import timing
2930from osc_lib import exceptions as exc
3031from osc_lib import logs
3132from osc_lib import utils
3536import openstackclient
3637from openstackclient .common import clientmanager
3738from openstackclient .common import commandmanager
38- from openstackclient .common import timing
3939
4040from os_client_config import config as cloud_config
4141
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments