Skip to content

feat(rdb): add benchmarks for instance get, backup get/list, and database list#5125

Open
jremy42 wants to merge 17 commits intomainfrom
feat/rdb-benchmarks
Open

feat(rdb): add benchmarks for instance get, backup get/list, and database list#5125
jremy42 wants to merge 17 commits intomainfrom
feat/rdb-benchmarks

Conversation

@jremy42
Copy link
Copy Markdown
Contributor

@jremy42 jremy42 commented Nov 6, 2025

close 4429

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Release note for CHANGELOG:


@jremy42 jremy42 requested a review from a team as a code owner November 6, 2025 08:14
@github-actions github-actions bot added the rdb Managed MySQL and PostgreSQL issues, bugs and feature requests label Nov 6, 2025
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 0% with 270 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.00%. Comparing base (2ea12a9) to head (e2c5e28).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cmd/scw-benchstat/main.go 0.00% 228 Missing ⚠️
internal/testhelpers/helpers_benchmark.go 0.00% 42 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jremy42 jremy42 force-pushed the feat/rdb-benchmarks branch 3 times, most recently from 42f9347 to 1c79dea Compare November 6, 2025 08:50
@jremy42 jremy42 requested a review from remyleone as a code owner November 6, 2025 08:50
@jremy42 jremy42 force-pushed the feat/rdb-benchmarks branch 3 times, most recently from 182f63a to 8919284 Compare November 6, 2025 15:06
//
// To compare performance:
//
// benchstat testdata/benchmark.baseline <(CLI_RUN_BENCHMARKS=true go test -bench=. -benchtime=100x .)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can this tool be installed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be transferred in the acctest package ? It does not seem specific to this particular command

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need an internal env package similar to what exists in terraform.

@jremy42 jremy42 force-pushed the feat/rdb-benchmarks branch from 722814d to 8d9e91e Compare November 21, 2025 09:26
@jremy42 jremy42 marked this pull request as draft November 21, 2025 09:54
@jremy42 jremy42 marked this pull request as ready for review November 24, 2025 11:15
@yfodil yfodil changed the base branch from master to main February 27, 2026 10:37
@jremy42 jremy42 force-pushed the feat/rdb-benchmarks branch from 6e3283c to 9b04e25 Compare April 3, 2026 12:39
@jremy42 jremy42 force-pushed the feat/rdb-benchmarks branch from 9b04e25 to e2c5e28 Compare April 3, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rdb Managed MySQL and PostgreSQL issues, bugs and feature requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add full benchmark on scw rdb instance get

3 participants