Show More
@@ -70,6 +70,7 b' def lsprofile(ui, fp):' | |||||
70 | stats = lsprof.Stats(p.getstats()) |
|
70 | stats = lsprof.Stats(p.getstats()) | |
71 | stats.sort(pycompat.sysstr(field)) |
|
71 | stats.sort(pycompat.sysstr(field)) | |
72 | stats.pprint(limit=limit, file=fp, climit=climit) |
|
72 | stats.pprint(limit=limit, file=fp, climit=climit) | |
|
73 | fp.flush() | |||
73 |
|
74 | |||
74 |
|
75 | |||
75 | @contextlib.contextmanager |
|
76 | @contextlib.contextmanager | |
@@ -97,14 +98,15 b' def flameprofile(ui, fp):' | |||||
97 | finally: |
|
98 | finally: | |
98 | thread.stop() |
|
99 | thread.stop() | |
99 | thread.join() |
|
100 | thread.join() | |
100 | print( |
|
101 | m = b'Collected %d stack frames (%d unique) in %2.2f seconds.' | |
101 | b'Collected %d stack frames (%d unique) in %2.2f seconds.' |
|
102 | m %= ( | |
102 |
|
|
103 | ( | |
103 | util.timer() - start_time, |
|
104 | util.timer() - start_time, | |
104 | thread.num_frames(), |
|
105 | thread.num_frames(), | |
105 | thread.num_frames(unique=True), |
|
106 | thread.num_frames(unique=True), | |
106 | ) |
|
107 | ), | |
107 | ) |
|
108 | ) | |
|
109 | print(m, flush=True) | |||
108 |
|
110 | |||
109 |
|
111 | |||
110 | @contextlib.contextmanager |
|
112 | @contextlib.contextmanager | |
@@ -170,6 +172,7 b' def statprofile(ui, fp):' | |||||
170 | kwargs['showtime'] = showtime |
|
172 | kwargs['showtime'] = showtime | |
171 |
|
173 | |||
172 | statprof.display(fp, data=data, format=displayformat, **kwargs) |
|
174 | statprof.display(fp, data=data, format=displayformat, **kwargs) | |
|
175 | fp.flush() | |||
173 |
|
176 | |||
174 |
|
177 | |||
175 | class profile: |
|
178 | class profile: |
General Comments 0
You need to be logged in to leave comments.
Login now