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

Function select_profiler

src/executor/wall_time/executor.rs:92–106  ·  view source on GitHub ↗
(profiler_override: Option<WalltimeProfiler>)

Source from the content-addressed store, hash-verified

90}
91
92fn select_profiler(profiler_override: Option<WalltimeProfiler>) -> Option<Box<dyn Profiler>> {
93 match profiler_override {
94 Some(WalltimeProfiler::Perf) => Some(Box::new(PerfProfiler::new())),
95 Some(WalltimeProfiler::Samply) => Some(Box::new(SamplyProfiler::new())),
96 None => {
97 if cfg!(target_os = "linux") {
98 Some(Box::new(PerfProfiler::new()))
99 } else if cfg!(target_os = "macos") {
100 Some(Box::new(SamplyProfiler::new()))
101 } else {
102 None
103 }
104 }
105 }
106}
107
108impl WallTimeExecutor {
109 pub fn new(profiler_override: Option<WalltimeProfiler>) -> Self {

Callers 1

newMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected