Skip to content

Commit a12facb

Browse files
committed
Use tabular JSON format
1 parent 8290362 commit a12facb

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

.github/workflows/performance.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030

3131
- name: Build
3232
run: |
33-
./test/regression-evm/test-statistics.sh ./. pull-request.csv
33+
./test/regression-evm/test-statistics.sh ./. test/regression-evm >pull-request.json
3434
git fetch origin
3535
git worktree add kore-master master
36-
./test/regression-evm/test-statistics.sh ./kore-master master.csv
37-
./scripts/join-statistics.sh master.csv pull-request.csv
36+
./test/regression-evm/test-statistics.sh ./kore-master test/regression-evm >master.json
37+
./scripts/join-statistics.sh master.json pull-request.json

scripts/join-statistics.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ new=${1:?}; shift
77
# 1. Join the statistics files by row according to name.
88
# Give the columns from each file a unique prefix.
99
# 2. Add a column for the (relative) difference between old and new values.
10-
mlr --csv join -j name --lp old_ --rp new_ -f "$old" "$new" \
11-
| mlr --csv put '$diff_allocated_bytes = 2 * ($new_allocated_bytes - $old_allocated_bytes) / ($new_allocated_bytes + $old_allocated_bytes)' \
12-
| mlr --csv put '$diff_max_live_bytes = 2 * ($new_max_live_bytes - $old_max_live_bytes) / ($new_max_live_bytes + $old_max_live_bytes)'
10+
mlr --json join -j name --lp old_ --rp new_ -f "$old" "$new" \
11+
| mlr --json put '$diff_allocated_bytes = ($new_allocated_bytes - $old_allocated_bytes) / $old_allocated_bytes' \
12+
| mlr --json put '$diff_max_live_bytes = ($new_max_live_bytes - $old_max_live_bytes) / $old_max_live_bytes'

scripts/test-statistics.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env nix-shell
2+
#!nix-shell ../test.nix -i bash
3+
4+
# Usage: test-statistics.sh KORE_DIR TEST_DIR
5+
# Output: tabular JSON on standard output
6+
7+
set -eou pipefail
8+
9+
kore_dir="${1:?}"; shift
10+
test_dir="${1:?}"; shift
11+
12+
export KORE_EXEC="$(nix-build "$kore_dir" -A kore --arg release true --no-out-link)/bin/kore-exec"
13+
14+
cd "$test_dir"
15+
16+
for each in $(find ./ -name 'test-*.sh')
17+
do
18+
json="${each%sh}.json"
19+
"${each}" --rts-statistics "$json" >/dev/null
20+
jq ". | { name: \"$each\", allocated_bytes: .allocated_bytes, max_live_bytes: .max_live_bytes }" < "$json"
21+
rm "$json"
22+
done

test/regression-evm/test-statistics.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)