##// END OF EJS Templates
cleanup: make all uses of timedcm specify what they're timing...
Augie Fackler -
r39294:331ab85e default
parent child Browse files
Show More
@@ -177,7 +177,7 b' def load(ui, name, path, log=lambda *a: '
177 177 return _extensions[shortname]
178 178 log(' - loading extension: %r\n', shortname)
179 179 _extensions[shortname] = None
180 with util.timedcm() as stats:
180 with util.timedcm('load extension %r', shortname) as stats:
181 181 mod = _importext(name, path, bind(_reportimporterror, ui))
182 182 log(' > %r extension loaded in %s\n', shortname, stats)
183 183
@@ -196,7 +196,7 b' def load(ui, name, path, log=lambda *a: '
196 196 _extensions[shortname] = mod
197 197 _order.append(shortname)
198 198 log(' - invoking registered callbacks: %r\n', shortname)
199 with util.timedcm() as stats:
199 with util.timedcm('callbacks extension %r', shortname) as stats:
200 200 for fn in _aftercallbacks.get(shortname, []):
201 201 fn(loaded=True)
202 202 log(' > callbacks completed in %s\n', stats)
@@ -243,7 +243,7 b' def loadall(ui, whitelist=None):'
243 243 newindex = len(_order)
244 244 log('loading %sextensions\n', 'additional ' if newindex else '')
245 245 log('- processing %d entries\n', len(result))
246 with util.timedcm() as stats:
246 with util.timedcm('load all extensions') as stats:
247 247 for (name, path) in result:
248 248 if path:
249 249 if path[0:1] == '!':
@@ -286,7 +286,7 b' def loadall(ui, whitelist=None):'
286 286 log('- executing uisetup hooks\n')
287 287 for name in _order[newindex:]:
288 288 log(' - running uisetup for %r\n', name)
289 with util.timedcm() as stats:
289 with util.timedcm('uisetup %r', name) as stats:
290 290 if not _runuisetup(name, ui):
291 291 log(' - the %r extension uisetup failed\n', name)
292 292 broken.add(name)
@@ -297,7 +297,7 b' def loadall(ui, whitelist=None):'
297 297 if name in broken:
298 298 continue
299 299 log(' - running extsetup for %r\n', name)
300 with util.timedcm() as stats:
300 with util.timedcm('extsetup %r', name) as stats:
301 301 if not _runextsetup(name, ui):
302 302 log(' - the %r extension extsetup failed\n', name)
303 303 broken.add(name)
@@ -309,7 +309,7 b' def loadall(ui, whitelist=None):'
309 309
310 310 # Call aftercallbacks that were never met.
311 311 log('- executing remaining aftercallbacks\n')
312 with util.timedcm() as stats:
312 with util.timedcm('aftercallbacks') as stats:
313 313 for shortname in _aftercallbacks:
314 314 if shortname in _extensions:
315 315 continue
@@ -353,7 +353,7 b' def loadall(ui, whitelist=None):'
353 353 ('templatefunc', templatefuncs, 'loadfunction'),
354 354 ('templatekeyword', templatekw, 'loadkeyword'),
355 355 ]
356 with util.timedcm() as stats:
356 with util.timedcm('load registration objects') as stats:
357 357 _loadextra(ui, newindex, extraloaders)
358 358 log('> extension registration object loading took %s\n', stats)
359 359 log('extension loading complete\n')
@@ -2929,7 +2929,7 b' def timed(func):'
2929 2929 '''
2930 2930
2931 2931 def wrapper(*args, **kwargs):
2932 with timedcm() as time_stats:
2932 with timedcm(pycompat.bytestr(func.__name__)) as time_stats:
2933 2933 result = func(*args, **kwargs)
2934 2934 stderr = procutil.stderr
2935 2935 stderr.write('%s%s: %s\n' % (
@@ -78,7 +78,7 b' class timedtests(unittest.TestCase):'
78 78 def testtimedcmcleanexit(self):
79 79 # timestamps 1, 4, elapsed time of 4 - 1 = 3
80 80 with mocktimer([1, 3], _start_default):
81 with util.timedcm() as stats:
81 with util.timedcm('pass') as stats:
82 82 # actual context doesn't matter
83 83 pass
84 84
@@ -89,8 +89,8 b' class timedtests(unittest.TestCase):'
89 89 def testtimedcmnested(self):
90 90 # timestamps 1, 3, 6, 10, elapsed times of 6 - 3 = 3 and 10 - 1 = 9
91 91 with mocktimer([1, 2, 3, 4], _start_default):
92 with util.timedcm() as outer_stats:
93 with util.timedcm() as inner_stats:
92 with util.timedcm('outer') as outer_stats:
93 with util.timedcm('inner') as inner_stats:
94 94 # actual context doesn't matter
95 95 pass
96 96
@@ -106,7 +106,7 b' class timedtests(unittest.TestCase):'
106 106 # timestamps 1, 4, elapsed time of 4 - 1 = 3
107 107 with mocktimer([1, 3], _start_default):
108 108 try:
109 with util.timedcm() as stats:
109 with util.timedcm('exceptional') as stats:
110 110 raise ValueError()
111 111 except ValueError:
112 112 pass
General Comments 0
You need to be logged in to leave comments. Login now