feat(rdb): add benchmarks for instance get, backup get/list, and database list#5125
feat(rdb): add benchmarks for instance get, backup get/list, and database list#5125
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5125 +/- ##
==========================================
- Coverage 51.18% 51.00% -0.19%
==========================================
Files 324 326 +2
Lines 75600 75870 +270
==========================================
Hits 38699 38699
- Misses 35424 35694 +270
Partials 1477 1477 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
42f9347 to
1c79dea
Compare
182f63a to
8919284
Compare
| // | ||
| // To compare performance: | ||
| // | ||
| // benchstat testdata/benchmark.baseline <(CLI_RUN_BENCHMARKS=true go test -bench=. -benchtime=100x .) |
There was a problem hiding this comment.
How can this tool be installed?
There was a problem hiding this comment.
The benchstat tool can be installed with go install golang.org/x/perf/cmd/benchstat@latest. That’s documented in the file header comment "(step 1 before the benchstat … compare command) and in more detail in docs/BENCHMARKS.md (e.g. the “benchstat not found” section)". Alternatively, go run ./cmd/scw-benchstat --install-benchstat can install it when running the wrapper.
| instanceReadyTimeout = 3 * time.Minute | ||
| ) | ||
|
|
||
| func setupBenchmark(b *testing.B) (*scw.Client, core.TestMetadata, func(args []string) any) { |
There was a problem hiding this comment.
Could this be transferred in the acctest package ? It does not seem specific to this particular command
There was a problem hiding this comment.
There isn’t an acctest package in this repository. The shared benchmark bootstrap already lives in internal/testhelpers. Do you think we should introduce a dedicated acctest ?
|
|
||
| func newBenchmarkStats() *benchmarkStats { | ||
| return &benchmarkStats{ | ||
| enabled: os.Getenv("CLI_BENCH_TRACE") == "true", |
There was a problem hiding this comment.
I think we need an internal env package similar to what exists in terraform.
722814d to
8d9e91e
Compare
6e3283c to
9b04e25
Compare
9b04e25 to
e2c5e28
Compare
close 4429
Community Note
Relates OR Closes #0000
Release note for CHANGELOG: