Skip to content

Commit

Permalink
feat: use ephemeral postgres for benchmarks (cause regression error)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Jan 17, 2025
1 parent 5108107 commit 221c26d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,12 @@ jobs:
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- run: go build -o /tmp/ledger ./
- run: echo "running actions as ${USER}"
- run: >
/tmp/ledger serve
--postgres-uri=postgres://formance:[email protected]/ledger
--postgres-conn-max-idle-time=120s
--postgres-max-open-conns=500
--postgres-max-idle-conns=100
--experimental-features
--otel-metrics-keep-in-memory &
- uses: extractions/setup-just@v2
- run: >
just
--justfile ./test/performance/justfile
--working-directory ./test/performance
run . 5 10s 1 http://localhost:3068
run . 5 10s 1
- run: >
just
--justfile ./test/performance/justfile
Expand Down
5 changes: 2 additions & 3 deletions test/performance/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ set positional-arguments

tmpdir := `mktemp -d`

run bench='.' p='1' benchtime='1s' count='1' ledger-url='' output='./report/benchmark-output.txt':
run bench='.' p='1' benchtime='1s' count='1' output='./report/benchmark-output.txt':
rm -f {{output}}
go test -run ^$ -tags it,local \
-report.file ./report/report.json \
-timeout 60m \
-bench={{bench}} \
-count={{count}} \
--ledger.url={{ledger-url}} \
-p {{p}} \
-test.benchtime {{benchtime}} . | tee -a {{output}}

compare bench='.' p='1' benchtime='1s' count='1' output='./report/benchmark-output.txt':
trap 'rm -rf {{tmpdir}}' EXIT
just run {{bench}} {{p}} {{benchtime}} {{count}} '' './report/benchmark-output-local.txt'
just run {{bench}} {{p}} {{benchtime}} {{count}} './report/benchmark-output-local.txt'
git clone --depth 1 -b main https://github.com/formancehq/ledger {{tmpdir}}
go test -run ^$ -tags it,local -report.file \
./report/report.json \
Expand Down

0 comments on commit 221c26d

Please sign in to comment.