Unverified Commit 66cc5bf2 authored by Wolfgang Walther's avatar Wolfgang Walther Committed by GitHub
Browse files

ci/eval: remove left-over stats.json (#408411)

parents 7db93ab8 edaf51cb
Loading
Loading
Loading
Loading
+0 −38
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@
  procps,
  nixVersions,
  jq,
  sta,
  python3,
}:

@@ -188,10 +187,7 @@ let
          rm "$chunkOutputDir"/stats/"$seq_end"
        fi

        # Make sure the glob doesn't break when there's no files
        shopt -s nullglob
        cat "$chunkOutputDir"/result/* > $out/paths
        cat "$chunkOutputDir"/stats/* > $out/stats.jsonstream
      '';

  combine =
@@ -202,7 +198,6 @@ let
      {
        nativeBuildInputs = [
          jq
          sta
        ];
      }
      ''
@@ -225,39 +220,6 @@ let
            ) | from_entries
          ' > $out/outpaths.json

        # Computes min, mean, error, etc. for a list of values and outputs a JSON from that
        statistics() {
          local stat=$1
          sta --transpose |
            jq --raw-input --argjson stat "$stat" -n '
              [
                inputs |
                  split("\t") |
                  { key: .[0], value: (.[1] | fromjson) }
              ] |
                from_entries |
                {
                  key: ($stat | join(".")),
                  value: .
                }'
        }

        # Gets all available number stats (without .sizes because those are constant and not interesting)
        readarray -t stats < <(jq -cs '.[0] | del(.sizes) | paths(type == "number")' ${resultsDir}/*/stats.jsonstream)

        # Combines the statistics from all evaluations
        {
          echo "{ \"key\": \"minAvailMemory\", \"value\": $(cat ${resultsDir}/*/min-avail-memory | sta --brief --min) }"
          echo "{ \"key\": \"minFreeSwap\", \"value\": $(cat ${resultsDir}/*/min-free-swap | sta --brief --min) }"
          cat ${resultsDir}/*/total-time | statistics '["totalTime"]'
          for stat in "''${stats[@]}"; do
            cat ${resultsDir}/*/stats.jsonstream |
              jq --argjson stat "$stat" 'getpath($stat)' |
              statistics "$stat"
          done
        } |
          jq -s from_entries > $out/stats.json

        mkdir -p $out/stats

        for d in ${resultsDir}/*; do