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

authored by Wolfgang Walther and committed by GitHub 66cc5bf2 7db93ab8

-38
-38
ci/eval/default.nix
··· 8 8 procps, 9 9 nixVersions, 10 10 jq, 11 - sta, 12 11 python3, 13 12 }: 14 13 ··· 188 187 rm "$chunkOutputDir"/stats/"$seq_end" 189 188 fi 190 189 191 - # Make sure the glob doesn't break when there's no files 192 - shopt -s nullglob 193 190 cat "$chunkOutputDir"/result/* > $out/paths 194 - cat "$chunkOutputDir"/stats/* > $out/stats.jsonstream 195 191 ''; 196 192 197 193 combine = ··· 202 198 { 203 199 nativeBuildInputs = [ 204 200 jq 205 - sta 206 201 ]; 207 202 } 208 203 '' ··· 224 219 end) | from_entries} 225 220 ) | from_entries 226 221 ' > $out/outpaths.json 227 - 228 - # Computes min, mean, error, etc. for a list of values and outputs a JSON from that 229 - statistics() { 230 - local stat=$1 231 - sta --transpose | 232 - jq --raw-input --argjson stat "$stat" -n ' 233 - [ 234 - inputs | 235 - split("\t") | 236 - { key: .[0], value: (.[1] | fromjson) } 237 - ] | 238 - from_entries | 239 - { 240 - key: ($stat | join(".")), 241 - value: . 242 - }' 243 - } 244 - 245 - # Gets all available number stats (without .sizes because those are constant and not interesting) 246 - readarray -t stats < <(jq -cs '.[0] | del(.sizes) | paths(type == "number")' ${resultsDir}/*/stats.jsonstream) 247 - 248 - # Combines the statistics from all evaluations 249 - { 250 - echo "{ \"key\": \"minAvailMemory\", \"value\": $(cat ${resultsDir}/*/min-avail-memory | sta --brief --min) }" 251 - echo "{ \"key\": \"minFreeSwap\", \"value\": $(cat ${resultsDir}/*/min-free-swap | sta --brief --min) }" 252 - cat ${resultsDir}/*/total-time | statistics '["totalTime"]' 253 - for stat in "''${stats[@]}"; do 254 - cat ${resultsDir}/*/stats.jsonstream | 255 - jq --argjson stat "$stat" 'getpath($stat)' | 256 - statistics "$stat" 257 - done 258 - } | 259 - jq -s from_entries > $out/stats.json 260 222 261 223 mkdir -p $out/stats 262 224