Skip to content

Commit a9fe391

Browse files
committed
fix: make sure instrumentation policy numbers are properly passed in
1 parent 3feda50 commit a9fe391

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

traincheck/instrumentor/tracer.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def __init__(
543543
funcs_to_instr: Optional[list[str]] = None,
544544
API_dump_stack_trace: bool = False,
545545
sampling_interval: int = 1,
546-
warm_up_steps: int = 0,
546+
warm_up_steps: int = 1,
547547
):
548548
"""
549549
Instruments the specified target with additional tracing functionality.
@@ -605,6 +605,14 @@ def __init__(
605605
self.API_dump_stack_trace = API_dump_stack_trace
606606
self.instr_opts = config.load_instr_opts()
607607

608+
self.sampling_interval = sampling_interval
609+
self.warm_up_steps = warm_up_steps
610+
# set to config too
611+
if self.sampling_interval:
612+
config.INSTRUMENTATION_POLICY["interval"] = self.sampling_interval
613+
if self.warm_up_steps:
614+
config.INSTRUMENTATION_POLICY["warm_up"] = self.warm_up_steps
615+
608616
if self.funcs_to_instr is not None and self.use_full_instr:
609617
get_instrumentation_logger_for_process().fatal(
610618
"Invariants are provided but use_full_instr is True. Selective instrumentation cannot be done. Please remove the `--use-full-instr` flag or remove the invariants"

0 commit comments

Comments
 (0)