Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template labels #12

Merged
merged 18 commits into from
Jan 27, 2022
Merged

Template labels #12

merged 18 commits into from
Jan 27, 2022

Conversation

replay
Copy link
Contributor

@replay replay commented Jan 26, 2022

This adds the ability to generate samples based on a template inside the extension, instead of generating them in the js and then passing them to the extension. The main benefit is performance.

Currently this is still missing documentation, that's why I opened it as draft only

replay and others added 17 commits November 3, 2021 22:34
goos: linux
goarch: amd64
pkg: github.com/grafana/xk6-client-prometheus-remote
cpu: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
BenchmarkEvaluateTemplatesSimple-8       5036028               265.0 ns/op            32 B/op          2 allocs/op
BenchmarkEvaluateTemplatesSimple-8       4212535               265.7 ns/op            32 B/op          2 allocs/op
BenchmarkEvaluateTemplatesSimple-8       4397311               289.6 ns/op            32 B/op          2 allocs/op
BenchmarkEvaluateTemplatesSimple-8       4099876               255.0 ns/op            32 B/op          2 allocs/op
BenchmarkEvaluateTemplatesSimple-8       4200105               265.6 ns/op            32 B/op          2 allocs/op
BenchmarkEvaluateTemplatesComplex-8      3664898               282.3 ns/op            28 B/op          2 allocs/op
BenchmarkEvaluateTemplatesComplex-8      4777549               299.3 ns/op            28 B/op          2 allocs/op
BenchmarkEvaluateTemplatesComplex-8      4231748               290.1 ns/op            28 B/op          2 allocs/op
BenchmarkEvaluateTemplatesComplex-8      4330029               245.6 ns/op            28 B/op          2 allocs/op
BenchmarkEvaluateTemplatesComplex-8      4678125               290.5 ns/op            28 B/op          2 allocs/op
This has less than the expected improvement but still something

name                        old time/op    new time/op    delta
EvaluateTemplatesSimple-8      268ns ± 8%     211ns ± 7%  -21.17%  (p=0.008 n=5+5)
EvaluateTemplatesComplex-8     282ns ±13%     164ns ± 6%  -41.79%  (p=0.008 n=5+5)

name                        old alloc/op   new alloc/op   delta
EvaluateTemplatesSimple-8      32.0B ± 0%     32.0B ± 0%     ~     (all equal)
EvaluateTemplatesComplex-8     28.0B ± 0%     28.0B ± 0%     ~     (all equal)

name                        old allocs/op  new allocs/op  delta
EvaluateTemplatesSimple-8       2.00 ± 0%      2.00 ± 0%     ~     (all equal)
EvaluateTemplatesComplex-8      2.00 ± 0%      2.00 ± 0%     ~     (all equal)
Sort labels when generating them from templates
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

LGTM can we though merge #11 as well either before merging this or quickly afterwards

@replay replay marked this pull request as ready for review January 27, 2022 13:29
Fixes around k6 v0.36.0 API changes
@replay
Copy link
Contributor Author

replay commented Jan 27, 2022

can we though merge #11 as well either before merging this or quickly afterwards

sure, i'm not expecting any complicated merge conflicts, so i don't think the order matters much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants