Replace the jq-based result merging (control char strip + jq -s merge) with a Python script that also calculates avg (sum/count) for all Stats objects in vm-switch metrics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
644 B
Nix
36 lines
644 B
Nix
{
|
|
pkgs,
|
|
makeRootfsNixos,
|
|
crosvm,
|
|
vmSwitch,
|
|
}:
|
|
|
|
let
|
|
# Build the benchmark rootfs
|
|
rootfs = makeRootfsNixos { guestConfig = import ./guest-config.nix; };
|
|
|
|
# Get the NixOS system closure for init=
|
|
systemToplevel = rootfs.passthru.nixos.config.system.build.toplevel;
|
|
|
|
mergeScript = ./merge-results.py;
|
|
|
|
testScript = pkgs.replaceVars ./run-test.sh {
|
|
inherit
|
|
rootfs
|
|
crosvm
|
|
vmSwitch
|
|
systemToplevel
|
|
mergeScript
|
|
;
|
|
};
|
|
in
|
|
pkgs.writeShellApplication {
|
|
name = "bufferbloat-test";
|
|
runtimeInputs = [
|
|
pkgs.python3
|
|
pkgs.coreutils
|
|
];
|
|
text = ''
|
|
exec bash ${testScript} "$@"
|
|
'';
|
|
}
|