MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / expected_flags

Function expected_flags

crates/exec-harness/src/runtime_env/node/tests.rs:24–74  ·  view source on GitHub ↗

Expected flags, following codspeed-node `getV8Flags()`, plus the perf map in memory mode.

(mode: &str, major: u32, v8_log: Option<&str>)

Source from the content-addressed store, hash-verified

22/// Expected flags, following codspeed-node `getV8Flags()`, plus the perf map
23/// in memory mode.
24fn expected_flags(mode: &str, major: u32, v8_log: Option<&str>) -> Vec<String> {
25 let mut flags = vec![
26 "--interpreted-frames-native-stack".to_owned(),
27 "--allow-natives-syntax".to_owned(),
28 ];
29 if mode == "walltime" {
30 flags.push("--perf-prof".to_owned());
31 match v8_log {
32 Some(dir) => flags.extend([
33 "--log-code".to_owned(),
34 "--no-log-source-code".to_owned(),
35 "--no-logfile-per-isolate".to_owned(),
36 format!("--logfile={dir}/codspeed-v8-%p.log"),
37 ]),
38 None => flags.push("--perf-basic-prof".to_owned()),
39 }
40 return flags;
41 }
42 flags.extend(
43 [
44 "--hash-seed=1",
45 "--random-seed=1",
46 "--no-opt",
47 "--always-sparkplug",
48 "--predictable",
49 "--predictable-gc-schedule",
50 "--expose-gc",
51 "--no-concurrent-sweeping",
52 "--max-old-space-size=4096",
53 ]
54 .map(str::to_owned),
55 );
56 if major < 18 {
57 flags.push("--no-randomize-hashes".to_owned());
58 }
59 flags.push(
60 if major < 20 {
61 "--no-scavenge-task"
62 } else {
63 "--no-minor-gc-task"
64 }
65 .to_owned(),
66 );
67 if major >= 24 {
68 flags.push("--no-maglev".to_owned());
69 }
70 if mode == "memory" {
71 flags.push("--perf-basic-prof".to_owned());
72 }
73 flags
74}
75
76fn check(mode: &str, major: u32, v8_log: Option<&str>) {
77 let fake_dir = tempfile::tempdir().unwrap();

Callers 1

checkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected