registry icon indicating copy to clipboard operation
registry copied to clipboard

Benchmark test for CRUD operations on Api/Api Version/Api spec/Artifact

Open giteshk opened this issue 2 years ago • 3 comments

The benchmark tests can be used against any running registry service

To run it against a local running service you can run

source auth/LOCAL.sh
export REGISTRY_PROJECT_IDENTIFIER=bench
apg admin create-project --project_id=$REGISTRY_PROJECT_IDENTIFIER
go test --bench=Create ./tests/benchmark --benchtime=10x
go test --bench=Update ./tests/benchmark --benchtime=10x
go test --bench=Get ./tests/benchmark --benchtime=10x
go test --bench=List ./tests/benchmark --benchtime=10x
go test --bench=Delete ./tests/benchmark --benchtime=10x

If you wish to create 5 versions for every API set export REGISTRY_VERSION_COUNT=5

To run this test against hosted version

source auth/HOSTED.sh
export REGISTRY_PROJECT_IDENTIFIER=<Registry project name>
apg admin create-project --project_id=$REGISTRY_PROJECT_IDENTIFIER
go test --bench=Create ./tests/benchmark --benchtime=10x
go test --bench=Update ./tests/benchmark --benchtime=10x
go test --bench=Get ./tests/benchmark --benchtime=10x
go test --bench=List ./tests/benchmark --benchtime=10x
go test --bench=Delete ./tests/benchmark --benchtime=10x

giteshk avatar Mar 07 '22 22:03 giteshk

Codecov Report

Merging #480 (8a46fe7) into main (6affe78) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 8a46fe7 differs from pull request most recent head cbaffe0. Consider uploading reports for the commit cbaffe0 to get more accurate results

@@           Coverage Diff           @@
##             main     #480   +/-   ##
=======================================
  Coverage   40.79%   40.79%           
=======================================
  Files          68       68           
  Lines        7956     7956           
=======================================
  Hits         3246     3246           
  Misses       4319     4319           
  Partials      391      391           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6affe78...cbaffe0. Read the comment docs.

codecov[bot] avatar Apr 18 '22 20:04 codecov[bot]

Hi, I was looking into this today to try to better understand how it got stuck, and I think we're probably trying to do too much in an initial PR. I'll go back and add some comments here-and-there, but I think it might be more productive to restart with something very minimal at first that we later expand to measure more things.

timburks avatar Jun 24 '22 20:06 timburks

See #631 which contains some initial benchmarks with smaller scope (and is based on these commits)

timburks avatar Jun 29 '22 20:06 timburks

@giteshk feel free to reopen this if needed

timburks avatar Sep 01 '22 16:09 timburks