[Stats] Fix a second/nanoseconds bug in process-stats-dir

Times are expected to be represented in nanoseconds in process-stats-dir,
but times with the 'swift.time.' prefix (e.g. times for specific
requests) were not converted.

It appears the reasons that this hasn’t been caught so far, is that
these times are not shown in Swift-CI's please test compiler performance
report.
This commit is contained in:
Alex Hoppen
2021-01-22 10:25:22 +01:00
parent 6c41322f0d
commit 92073c671e

View File

@@ -328,11 +328,12 @@ def load_stats_dir(path, select_module=[], select_stat=[],
for (k, v) in j.items(): for (k, v) in j.items():
if sre.search(k) is None: if sre.search(k) is None:
continue continue
if k.startswith('time.'):
v = int(1000000.0 * float(v))
if k.startswith('time.') and exclude_timers: if k.startswith('time.') and exclude_timers:
continue continue
tm = match_timerpat(k) tm = match_timerpat(k)
if tm: if tm:
v = int(1000000.0 * float(v))
if tm['jobkind'] == jobkind and \ if tm['jobkind'] == jobkind and \
tm['timerkind'] == 'wall': tm['timerkind'] == 'wall':
dur_usec = v dur_usec = v