Skip to content

Commit ab299f4

Browse files
committed
Fix perf script
1 parent 0663518 commit ab299f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tools/inspection/benchmark_external_inspection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def benchmark(unwinder, duration_seconds=10):
174174
total_work_time = 0.0
175175
start_time = time.perf_counter()
176176
end_time = start_time + duration_seconds
177+
total_attempts = 0
177178

178179
colors = get_colors(can_colorize())
179180

@@ -183,6 +184,7 @@ def benchmark(unwinder, duration_seconds=10):
183184

184185
try:
185186
while time.perf_counter() < end_time:
187+
total_attempts += 1
186188
work_start = time.perf_counter()
187189
try:
188190
stack_trace = unwinder.get_stack_trace()
@@ -194,7 +196,6 @@ def benchmark(unwinder, duration_seconds=10):
194196
work_end = time.perf_counter()
195197
total_work_time += work_end - work_start
196198

197-
total_attempts = sample_count + fail_count
198199
if total_attempts % 10000 == 0:
199200
avg_work_time_us = (total_work_time / total_attempts) * 1e6
200201
work_rate = (
@@ -221,7 +222,6 @@ def benchmark(unwinder, duration_seconds=10):
221222

222223
actual_end_time = time.perf_counter()
223224
wall_time = actual_end_time - start_time
224-
total_attempts = sample_count + fail_count
225225

226226
# Return final statistics
227227
return {

0 commit comments

Comments
 (0)