From 36aa5b691d50f156244647415596327f7646e2dc Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Fri, 22 Feb 2019 16:59:29 +0000 Subject: [PATCH 1/2] metrics.nix: add nix-env.qaCountDrv metric Before ae16dd1a15dfbe29c6a1de61c4cc23e2cd6487f0 `nix-env.qaCount` and `nix-env.qaCountDrv` were equivalent, after that change that is no longer the case so this needs a separate metric now. --- pkgs/top-level/metrics.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/top-level/metrics.nix b/pkgs/top-level/metrics.nix index c4253973cbb..d9cf985e41f 100644 --- a/pkgs/top-level/metrics.nix +++ b/pkgs/top-level/metrics.nix @@ -55,6 +55,9 @@ runCommand "nixpkgs-metrics" num=$(nix-env -f ${nixpkgs} -qa | wc -l) echo "nix-env.qaCount $num" >> $out/nix-support/hydra-metrics + num=$(nix-env -f ${nixpkgs} -qa --drv-path | wc -l) + echo "nix-env.qaCountDrv $num" >> $out/nix-support/hydra-metrics + # TODO: this has been ignored for some time # GC Warning: Bad initial heap size 128k - ignoring it. #export GC_INITIAL_HEAP_SIZE=128k From a593f64cd7404666ac8364486773452cefa9baa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 1 Mar 2019 13:59:30 +0100 Subject: [PATCH 2/2] metrics.nix: track qaCountBroken instead of qaCountDrv From these three values, I believe it's most meaningful to track one of the higher ones and their difference (qaCountBroken). It's a bit unclear which of the higher ones - I have no data on that, so I kept the one used before the parent commit. --- pkgs/top-level/metrics.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/top-level/metrics.nix b/pkgs/top-level/metrics.nix index d9cf985e41f..e60f42e14e2 100644 --- a/pkgs/top-level/metrics.nix +++ b/pkgs/top-level/metrics.nix @@ -52,11 +52,12 @@ runCommand "nixpkgs-metrics" run nix-env.qa nix-env -f ${nixpkgs} -qa run nix-env.qaDrv nix-env -f ${nixpkgs} -qa --drv-path --meta --xml + # It's slightly unclear which of the set to track: qaCount, qaCountDrv, qaCountBroken. num=$(nix-env -f ${nixpkgs} -qa | wc -l) echo "nix-env.qaCount $num" >> $out/nix-support/hydra-metrics - - num=$(nix-env -f ${nixpkgs} -qa --drv-path | wc -l) - echo "nix-env.qaCountDrv $num" >> $out/nix-support/hydra-metrics + qaCountDrv=$(nix-env -f ${nixpkgs} -qa --drv-path | wc -l) + num=$((num - $qaCountDrv)) + echo "nix-env.qaCountBroken $num" >> $out/nix-support/hydra-metrics # TODO: this has been ignored for some time # GC Warning: Bad initial heap size 128k - ignoring it.