Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG3f81d58aae25: statprof: clarify by naming tuple members while enumerate()'ing
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
pulkit |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/statprof.py (3 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
41b42f58c5f9 | 6a551a2dc666 | Martin von Zweigbergk | Aug 30 2019, 6:12 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
laststack.appendleft(f) | laststack.appendleft(f) | ||||
path, name = f | path, name = f | ||||
sid = stackid(tuple(laststack)) | sid = stackid(tuple(laststack)) | ||||
samples.append(dict(ph='B', name=name, cat=path, ts=sample.time*1e6, | samples.append(dict(ph='B', name=name, cat=path, ts=sample.time*1e6, | ||||
sf=sid, pid=0)) | sf=sid, pid=0)) | ||||
laststack = collections.deque(stack) | laststack = collections.deque(stack) | ||||
while laststack: | while laststack: | ||||
poplast() | poplast() | ||||
events = [s[1] for s in enumerate(samples) if s[0] not in blacklist] | events = [sample for idx, sample in enumerate(samples) | ||||
if idx not in blacklist] | |||||
frames = collections.OrderedDict((str(k), v) | frames = collections.OrderedDict((str(k), v) | ||||
for (k,v) in enumerate(id2stack)) | for (k,v) in enumerate(id2stack)) | ||||
json.dump(dict(traceEvents=events, stackFrames=frames), fp, indent=1) | json.dump(dict(traceEvents=events, stackFrames=frames), fp, indent=1) | ||||
fp.write('\n') | fp.write('\n') | ||||
def printusage(): | def printusage(): | ||||
print(r""" | print(r""" | ||||
The statprof command line allows you to inspect the last profile's results in | The statprof command line allows you to inspect the last profile's results in |