refactor: one load threshold for every probe

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 19:50:33 +01:00
1 parent 91e385598e
commit eddb26f104
5 files changed
+32 -8

No files matched your search

+1 -2
View File
@@ -3,7 +3,6 @@
from __future__ import annotations
import argparse
import os
import re
import shutil
import subprocess
@@ -101,7 +100,7 @@ def measure(args: argparse.Namespace, emu: Emulator) -> dict:
meta, tree = installed(emu, args.sha256)
except (cp.ProbeError, OSError, subprocess.SubprocessError) as exc:
raise RunFailed(exc) from exc
max_load = args.max_load if args.max_load is not None else (os.cpu_count() or 1) / 4
max_load = args.max_load if args.max_load is not None else cp.default_max_load()
load_before = cp.load_average()
if args.record and load_before and load_before[0] > max_load:
raise Busy(f"load average {load_before[0]} exceeds {max_load}: the machine is busy, "