/breezy/3.0

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/3.0

« back to all changes in this revision

Viewing changes to breezy/bzr/smart/protocol.py

  • Committer: Breezy landing bot
  • Author(s): Vincent Ladeuil
  • Date: 2019-03-06 11:29:23 UTC
  • mfrom: (7304.1.2 3.0)
  • Revision ID: breezy.the.bot@gmail.com-20190306112923-4j11qd9eo5kk8h8i
Release 3.0.0

Merged from https://code.launchpad.net/~vila/brz/3.0.0/+merge/364029

Show diffs side-by-side

added added

removed removed

Lines of Context:
639
639
            mutter('hpss call:   %s', repr(args)[1:-1])
640
640
            if getattr(self._request._medium, 'base', None) is not None:
641
641
                mutter('             (to %s)', self._request._medium.base)
642
 
            self._request_start_time = osutils.timer_func()
 
642
            self._request_start_time = osutils.perf_counter()
643
643
        self._write_args(args)
644
644
        self._request.finished_writing()
645
645
        self._last_verb = args[0]
655
655
                mutter('                  (to %s)',
656
656
                       self._request._medium._path)
657
657
            mutter('              %d bytes', len(body))
658
 
            self._request_start_time = osutils.timer_func()
 
658
            self._request_start_time = osutils.perf_counter()
659
659
            if 'hpssdetail' in debug.debug_flags:
660
660
                mutter('hpss body content: %s', body)
661
661
        self._write_args(args)
675
675
            if getattr(self._request._medium, '_path', None) is not None:
676
676
                mutter('                  (to %s)',
677
677
                       self._request._medium._path)
678
 
            self._request_start_time = osutils.timer_func()
 
678
            self._request_start_time = osutils.perf_counter()
679
679
        self._write_args(args)
680
680
        readv_bytes = self._serialise_offsets(body)
681
681
        bytes = self._encode_bulk_data(readv_bytes)
707
707
        if 'hpss' in debug.debug_flags:
708
708
            if self._request_start_time is not None:
709
709
                mutter('   result:   %6.3fs  %s',
710
 
                       osutils.timer_func() - self._request_start_time,
 
710
                       osutils.perf_counter() - self._request_start_time,
711
711
                       repr(result)[1:-1])
712
712
                self._request_start_time = None
713
713
            else:
1173
1173
 
1174
1174
    def _trace(self, action, message, extra_bytes=None, include_time=False):
1175
1175
        if self._response_start_time is None:
1176
 
            self._response_start_time = osutils.timer_func()
 
1176
            self._response_start_time = osutils.perf_counter()
1177
1177
        if include_time:
1178
 
            t = '%5.3fs ' % (time.clock() - self._response_start_time)
 
1178
            t = '%5.3fs ' % (osutils.perf_counter() - self._response_start_time)
1179
1179
        else:
1180
1180
            t = ''
1181
1181
        if extra_bytes is None:
1318
1318
            base = getattr(self._medium_request._medium, 'base', None)
1319
1319
            if base is not None:
1320
1320
                mutter('             (to %s)', base)
1321
 
            self._request_start_time = osutils.timer_func()
 
1321
            self._request_start_time = osutils.perf_counter()
1322
1322
        self._write_protocol_version()
1323
1323
        self._write_headers(self._headers)
1324
1324
        self._write_structure(args)
1336
1336
            if path is not None:
1337
1337
                mutter('                  (to %s)', path)
1338
1338
            mutter('              %d bytes', len(body))
1339
 
            self._request_start_time = osutils.timer_func()
 
1339
            self._request_start_time = osutils.perf_counter()
1340
1340
        self._write_protocol_version()
1341
1341
        self._write_headers(self._headers)
1342
1342
        self._write_structure(args)
1355
1355
            path = getattr(self._medium_request._medium, '_path', None)
1356
1356
            if path is not None:
1357
1357
                mutter('                  (to %s)', path)
1358
 
            self._request_start_time = osutils.timer_func()
 
1358
            self._request_start_time = osutils.perf_counter()
1359
1359
        self._write_protocol_version()
1360
1360
        self._write_headers(self._headers)
1361
1361
        self._write_structure(args)
1372
1372
            path = getattr(self._medium_request._medium, '_path', None)
1373
1373
            if path is not None:
1374
1374
                mutter('                  (to %s)', path)
1375
 
            self._request_start_time = osutils.timer_func()
 
1375
            self._request_start_time = osutils.perf_counter()
1376
1376
        self.body_stream_started = False
1377
1377
        self._write_protocol_version()
1378
1378
        self._write_headers(self._headers)