Skip to content

Commit b34c322

Browse files
committed
fixup! Replace --interval with --sampling-rate
1 parent a59e178 commit b34c322

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

Lib/test/test_profiling/test_sampling_profiler/test_advanced.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ def worker(x):
219219
"run",
220220
"-d",
221221
"5",
222-
"-i",
223-
"100000",
222+
"-r",
223+
"10",
224224
script,
225225
stdout=subprocess.PIPE,
226226
stderr=subprocess.PIPE,

Lib/test/test_profiling/test_sampling_profiler/test_children.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ def test_monitor_creation(self):
279279

280280
monitor = ChildProcessMonitor(
281281
pid=os.getpid(),
282-
cli_args=["-i", "100", "-d", "5"],
282+
cli_args=["-r", "10khz", "-d", "5"],
283283
output_pattern="test_{pid}.pstats",
284284
)
285285
self.assertEqual(monitor.parent_pid, os.getpid())
286-
self.assertEqual(monitor.cli_args, ["-i", "100", "-d", "5"])
286+
self.assertEqual(monitor.cli_args, ["-r", "10khz", "-d", "5"])
287287
self.assertEqual(monitor.output_pattern, "test_{pid}.pstats")
288288

289289
def test_monitor_lifecycle(self):
@@ -384,7 +384,7 @@ def test_build_child_profiler_args(self):
384384
from profiling.sampling.cli import _build_child_profiler_args
385385

386386
args = argparse.Namespace(
387-
interval=200,
387+
sampling_rate=200,
388388
duration=15,
389389
all_threads=True,
390390
realtime_stats=False,
@@ -418,7 +418,7 @@ def assert_flag_value_pair(flag, value):
418418
f"'{child_args[flag_index + 1]}' in args: {child_args}",
419419
)
420420

421-
assert_flag_value_pair("-i", 200)
421+
assert_flag_value_pair("-r", 5000)
422422
assert_flag_value_pair("-d", 15)
423423
assert_flag_value_pair("--mode", "cpu")
424424

@@ -442,7 +442,7 @@ def test_build_child_profiler_args_no_gc(self):
442442
from profiling.sampling.cli import _build_child_profiler_args
443443

444444
args = argparse.Namespace(
445-
interval=100,
445+
sampling_rate=100,
446446
duration=5,
447447
all_threads=False,
448448
realtime_stats=False,
@@ -508,7 +508,7 @@ def test_setup_child_monitor(self):
508508
from profiling.sampling.cli import _setup_child_monitor
509509

510510
args = argparse.Namespace(
511-
interval=100,
511+
sampling_rate=100,
512512
duration=5,
513513
all_threads=False,
514514
realtime_stats=False,
@@ -688,7 +688,7 @@ def test_monitor_respects_max_limit(self):
688688
# Create a monitor
689689
monitor = ChildProcessMonitor(
690690
pid=os.getpid(),
691-
cli_args=["-i", "100", "-d", "5"],
691+
cli_args=["-r", "10khz", "-d", "5"],
692692
output_pattern="test_{pid}.pstats",
693693
)
694694

@@ -925,8 +925,8 @@ def test_subprocesses_flag_spawns_child_and_creates_output(self):
925925
"--subprocesses",
926926
"-d",
927927
"3",
928-
"-i",
929-
"10000",
928+
"-r",
929+
"100",
930930
"-o",
931931
output_file,
932932
script_file,
@@ -987,8 +987,8 @@ def test_subprocesses_flag_with_flamegraph_output(self):
987987
"--subprocesses",
988988
"-d",
989989
"2",
990-
"-i",
991-
"10000",
990+
"-r",
991+
"100",
992992
"--flamegraph",
993993
"-o",
994994
output_file,
@@ -1041,8 +1041,8 @@ def test_subprocesses_flag_no_crash_on_quick_child(self):
10411041
"--subprocesses",
10421042
"-d",
10431043
"2",
1044-
"-i",
1045-
"10000",
1044+
"-r",
1045+
"100",
10461046
"-o",
10471047
output_file,
10481048
script_file,

Lib/test/test_profiling/test_sampling_profiler/test_modes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ def test_gil_mode_cli_argument_parsing(self):
306306
"12345",
307307
"--mode",
308308
"gil",
309-
"-i",
310-
"500",
309+
"-r",
310+
"2000",
311311
"-d",
312312
"5",
313313
]
@@ -488,8 +488,8 @@ def test_exception_mode_cli_argument_parsing(self):
488488
"12345",
489489
"--mode",
490490
"exception",
491-
"-i",
492-
"500",
491+
"-r",
492+
"2000",
493493
"-d",
494494
"5",
495495
]

0 commit comments

Comments
 (0)