Skip to content

Commit cc79130

Browse files
committed
fix: only show fifo warnings when perf env is present
1 parent d712959 commit cc79130

File tree

3 files changed

+10
-2
lines changed
  • crates

3 files changed

+10
-2
lines changed

crates/codspeed/src/utils.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ pub fn running_with_codspeed_runner() -> bool {
4242
std::env::var("CODSPEED_ENV").is_ok()
4343
}
4444

45+
pub fn is_perf_enabled() -> bool {
46+
std::env::var("CODSPEED_PERF_ENABLED").is_ok()
47+
}
48+
4549
#[cfg(test)]
4650
mod tests {
4751
use super::*;

crates/criterion_compat/criterion_fork/src/analysis/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ mod codspeed {
305305
uri: uri.clone(),
306306
})
307307
{
308-
if codspeed::utils::running_with_codspeed_runner() {
308+
if codspeed::utils::running_with_codspeed_runner()
309+
&& codspeed::utils::is_perf_enabled()
310+
{
309311
eprintln!("Failed to send benchmark URI to runner: {error:?}");
310312
}
311313
}

crates/divan_compat/divan_fork/src/divan.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,9 @@ mod codspeed {
438438
uri: uri.clone(),
439439
})
440440
{
441-
if codspeed::utils::running_with_codspeed_runner() {
441+
if codspeed::utils::running_with_codspeed_runner()
442+
&& codspeed::utils::is_perf_enabled()
443+
{
442444
eprintln!("Failed to send benchmark URI to runner: {error:?}");
443445
}
444446
}

0 commit comments

Comments
 (0)