@@ -224,6 +224,8 @@ def __codspeed_root_frame__() -> T:
224
224
# Benchmark
225
225
iter_range = range (iter_per_round )
226
226
run_start = perf_counter_ns ()
227
+ if self .instrument_hooks :
228
+ self .instrument_hooks .start_benchmark ()
227
229
for _ in range (rounds ):
228
230
start = perf_counter_ns ()
229
231
for _ in iter_range :
@@ -234,6 +236,9 @@ def __codspeed_root_frame__() -> T:
234
236
if end - run_start > benchmark_config .max_time_ns :
235
237
# TODO: log something
236
238
break
239
+ if self .instrument_hooks :
240
+ self .instrument_hooks .stop_benchmark ()
241
+ self .instrument_hooks .set_executed_benchmark (uri )
237
242
benchmark_end = perf_counter_ns ()
238
243
total_time = (benchmark_end - run_start ) / 1e9
239
244
@@ -250,7 +255,7 @@ def __codspeed_root_frame__() -> T:
250
255
)
251
256
return out
252
257
253
- def measure_pedantic (
258
+ def measure_pedantic ( # noqa: C901
254
259
self ,
255
260
marker_options : BenchmarkMarkerOptions ,
256
261
pedantic_options : PedanticOptions [T ],
@@ -277,6 +282,8 @@ def __codspeed_root_frame__(*args, **kwargs) -> T:
277
282
# Benchmark
278
283
times_per_round_ns : list [float ] = []
279
284
benchmark_start = perf_counter_ns ()
285
+ if self .instrument_hooks :
286
+ self .instrument_hooks .start_benchmark ()
280
287
for _ in range (pedantic_options .rounds ):
281
288
start = perf_counter_ns ()
282
289
args , kwargs = pedantic_options .setup_and_get_args_kwargs ()
@@ -286,7 +293,9 @@ def __codspeed_root_frame__(*args, **kwargs) -> T:
286
293
times_per_round_ns .append (end - start )
287
294
if pedantic_options .teardown is not None :
288
295
pedantic_options .teardown (* args , ** kwargs )
289
-
296
+ if self .instrument_hooks :
297
+ self .instrument_hooks .stop_benchmark ()
298
+ self .instrument_hooks .set_executed_benchmark (uri )
290
299
benchmark_end = perf_counter_ns ()
291
300
total_time = (benchmark_end - benchmark_start ) / 1e9
292
301
stats = BenchmarkStats .from_list (
0 commit comments