File tree Expand file tree Collapse file tree 1 file changed +0
-38
lines changed Expand file tree Collapse file tree 1 file changed +0
-38
lines changed Original file line number Diff line number Diff line change 88 procps ,
99 nixVersions ,
1010 jq ,
11- sta ,
1211 python3 ,
1312} :
1413
188187 rm "$chunkOutputDir"/stats/"$seq_end"
189188 fi
190189
191- # Make sure the glob doesn't break when there's no files
192- shopt -s nullglob
193190 cat "$chunkOutputDir"/result/* > $out/paths
194- cat "$chunkOutputDir"/stats/* > $out/stats.jsonstream
195191 '' ;
196192
197193 combine =
202198 {
203199 nativeBuildInputs = [
204200 jq
205- sta
206201 ] ;
207202 }
208203 ''
225220 ) | from_entries
226221 ' > $out/outpaths.json
227222
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-
261223 mkdir -p $out/stats
262224
263225 for d in ${ resultsDir } /*; do
You can’t perform that action at this time.
0 commit comments