metrics job: update for nix-2.2
Fixes https://github.com/NixOS/nixpkgs/issues/53858 I think I managed to keep all numbers the same as before nix-2.2.
This commit is contained in:
parent
9b61b2bd90
commit
61b8c03a78
@ -3,7 +3,7 @@
|
|||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
runCommand "nixpkgs-metrics"
|
runCommand "nixpkgs-metrics"
|
||||||
{ buildInputs = [ nix time ];
|
{ nativeBuildInputs = with pkgs.lib; map getBin [ nix time jq ];
|
||||||
requiredSystemFeatures = [ "benchmark" ];
|
requiredSystemFeatures = [ "benchmark" ];
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
@ -19,23 +19,26 @@ runCommand "nixpkgs-metrics"
|
|||||||
shift
|
shift
|
||||||
|
|
||||||
echo "running $@"
|
echo "running $@"
|
||||||
NIX_SHOW_STATS=1 time "$@" 2>&1 > /dev/null | tee stats
|
NIX_SHOW_STATS=1 time -o stats-time "$@" 2>stats-nix
|
||||||
|
sed '/^warning:/d' -i stats-nix
|
||||||
|
|
||||||
cat stats
|
cat stats-nix; echo; cat stats-time; echo
|
||||||
|
|
||||||
x=$(sed -e 's/.*time elapsed: \([0-9\.]\+\).*/\1/ ; t ; d' stats)
|
x=$(jq '.cpuTime' < stats-nix)
|
||||||
[[ -n $x ]] || exit 1
|
[[ -n $x ]] || exit 1
|
||||||
echo "$name.time $x s" >> $out/nix-support/hydra-metrics
|
echo "$name.time $x s" >> $out/nix-support/hydra-metrics
|
||||||
|
|
||||||
x=$(sed -e 's/.* \([0-9]\+\)maxresident.*/\1/ ; t ; d' stats)
|
x=$(sed -e 's/.* \([0-9]\+\)maxresident.*/\1/ ; t ; d' < stats-time)
|
||||||
[[ -n $x ]] || exit 1
|
[[ -n $x ]] || exit 1
|
||||||
echo "$name.maxresident $x KiB" >> $out/nix-support/hydra-metrics
|
echo "$name.maxresident $x KiB" >> $out/nix-support/hydra-metrics
|
||||||
|
|
||||||
x=$(sed -e 's/.*total allocations: \([0-9]\+\) bytes.*/\1/ ; t ; d' stats)
|
# nix-2.2 also outputs .symbols.bytes but that wasn't summed originally
|
||||||
|
# https://github.com/NixOS/nix/pull/2392/files#diff-8e6ba8c21672fc1a5f6f606e1e101c74L1762
|
||||||
|
x=$(jq '[.envs,.list,.values,.sets] | map(.bytes) | add' < stats-nix)
|
||||||
[[ -n $x ]] || exit 1
|
[[ -n $x ]] || exit 1
|
||||||
echo "$name.allocations $x B" >> $out/nix-support/hydra-metrics
|
echo "$name.allocations $x B" >> $out/nix-support/hydra-metrics
|
||||||
|
|
||||||
x=$(sed -e 's/.*values allocated count: \([0-9]\+\).*/\1/ ; t ; d' stats)
|
x=$(jq '.values.number' < stats-nix)
|
||||||
[[ -n $x ]] || exit 1
|
[[ -n $x ]] || exit 1
|
||||||
echo "$name.values $x" >> $out/nix-support/hydra-metrics
|
echo "$name.values $x" >> $out/nix-support/hydra-metrics
|
||||||
}
|
}
|
||||||
@ -52,7 +55,9 @@ runCommand "nixpkgs-metrics"
|
|||||||
num=$(nix-env -f ${nixpkgs} -qa | wc -l)
|
num=$(nix-env -f ${nixpkgs} -qa | wc -l)
|
||||||
echo "nix-env.qaCount $num" >> $out/nix-support/hydra-metrics
|
echo "nix-env.qaCount $num" >> $out/nix-support/hydra-metrics
|
||||||
|
|
||||||
export GC_INITIAL_HEAP_SIZE=128k
|
# TODO: this has been ignored for some time
|
||||||
|
# GC Warning: Bad initial heap size 128k - ignoring it.
|
||||||
|
#export GC_INITIAL_HEAP_SIZE=128k
|
||||||
run nix-env.qaAggressive nix-env -f ${nixpkgs} -qa
|
run nix-env.qaAggressive nix-env -f ${nixpkgs} -qa
|
||||||
run nix-env.qaDrvAggressive nix-env -f ${nixpkgs} -qa --drv-path --meta --xml
|
run nix-env.qaDrvAggressive nix-env -f ${nixpkgs} -qa --drv-path --meta --xml
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user