Track duration of TestLicense.init
Testing how often we generate a test license and how long it takes.
Summary
- Amount of licenses created: 13298
- Total runtime of license key generations: 2230 seconds
- Total runtime of factory geneartions: 129 seconds
- Total rutime: 2359
But how?
Use https://gitlab.com/splattael/gitlab-tools/-/blob/master/bin/ci_logs
# Collect logs starting with `TestLicense: key`:
~/devel/gitlab/gitlab-tools/bin/ci_logs gitlab-org/gitlab 870231414 ".*" 'TestLicense: key' > .local/test-license-bench.txt
# Total amount of license creations:
rg "TestLicense: key" .local/test-license-bench.txt | wc -l
13298
# Sum runtime of all key generations
rg -I -r '$1' -o "TestLicense:.*key=(\S+)" .local/test-license-bench.txt | paste -sd+ | bc -
2230.478385488152980132
# Sum rutime of all factory creations
rg -I -r '$1' -o "TestLicense:.*factory=(\S+)" .local/test-license-bench.txt | paste -sd+ | bc -l
129.0858113130620949828
# Total sum
rg -I -r '$1' -o "TestLicense:.*sum=(\S+)" .local/test-license-bench.txt | paste -sd+ | bc -l
2359.564196801215074739
## Follow-up
See https://gitlab.com/gitlab-org/gitlab/-/issues/411920+
Edited by Peter Leitzen