462 return functools.partial(stub_timer, fm), fm |
462 return functools.partial(stub_timer, fm), fm |
463 |
463 |
464 # experimental config: perf.all-timing |
464 # experimental config: perf.all-timing |
465 displayall = ui.configbool(b"perf", b"all-timing", True) |
465 displayall = ui.configbool(b"perf", b"all-timing", True) |
466 |
466 |
|
467 # ui.warnnoi18n was introduced in 5209fc94b982 |
|
468 ui_warn = ui.warn |
|
469 |
467 # experimental config: perf.run-limits |
470 # experimental config: perf.run-limits |
468 limitspec = ui.configlist(b"perf", b"run-limits", []) |
471 limitspec = ui.configlist(b"perf", b"run-limits", []) |
469 limits = [] |
472 limits = [] |
470 for item in limitspec: |
473 for item in limitspec: |
471 parts = item.split(b'-', 1) |
474 parts = item.split(b'-', 1) |
472 if len(parts) < 2: |
475 if len(parts) < 2: |
473 ui.warn((b'malformatted run limit entry, missing "-": %s\n' % item)) |
476 ui_warn(b'malformatted run limit entry, missing "-": %s\n' % item) |
474 continue |
477 continue |
475 try: |
478 try: |
476 time_limit = float(_sysstr(parts[0])) |
479 time_limit = float(_sysstr(parts[0])) |
477 except ValueError as e: |
480 except ValueError as e: |
478 ui.warn( |
481 ui_warn( |
479 ( |
482 b'malformatted run limit entry, %s: %s\n' % (_bytestr(e), item) |
480 b'malformatted run limit entry, %s: %s\n' |
|
481 % (_bytestr(e), item) |
|
482 ) |
|
483 ) |
483 ) |
484 continue |
484 continue |
485 try: |
485 try: |
486 run_limit = int(_sysstr(parts[1])) |
486 run_limit = int(_sysstr(parts[1])) |
487 except ValueError as e: |
487 except ValueError as e: |
488 ui.warn( |
488 ui_warn( |
489 ( |
489 b'malformatted run limit entry, %s: %s\n' % (_bytestr(e), item) |
490 b'malformatted run limit entry, %s: %s\n' |
|
491 % (_bytestr(e), item) |
|
492 ) |
|
493 ) |
490 ) |
494 continue |
491 continue |
495 limits.append((time_limit, run_limit)) |
492 limits.append((time_limit, run_limit)) |
496 if not limits: |
493 if not limits: |
497 limits = DEFAULTLIMITS |
494 limits = DEFAULTLIMITS |