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

Benchmark API response parsing code #17046

Merged
merged 3 commits into from
Mar 17, 2020

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Mar 17, 2020

What does this PR do?

This PR makes the API response parsing code in the elasticsearch/index metricset benchmark-able, and adds a benchmark test for it. It is in preparation for #16538.

Why is it important?

To prove that the changes in #16538 will have a significant impact on memory usage while parsing the API response from Elasticsearch.

Checklist

  • My code follows the style guidelines of this project
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works

How to test this PR locally

cd $GOPATH/src/github.com/elastic/beats
go test -bench=. -benchmem ./metricbeat/module/elasticsearch/index/

Sample benchmark results

goos: darwin
goarch: amd64
pkg: github.com/elastic/beats/v7/metricbeat/module/elasticsearch/index
BenchmarkParseAPIResponse-8           25          44391131 ns/op        13464952 B/op     207889 allocs/op
PASS
ok      github.com/elastic/beats/v7/metricbeat/module/elasticsearch/index       1.585s

In terms of memory, the current API response parsing implementation consumed 13.46 MB.

Related issues

@ycombinator ycombinator added the Team:Services (Deprecated) Label for the former Integrations-Services team label Mar 17, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@ycombinator ycombinator added needs_backport PR is waiting to be backported to other branches. v7.7.0 v8.0.0 Metricbeat Metricbeat module Feature:Stack Monitoring labels Mar 17, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/stack-monitoring (Stack monitoring)

@ycombinator ycombinator requested review from a team and removed request for a team March 17, 2020 05:10
@ycombinator
Copy link
Contributor Author

Travis CI is green and Jenkins CI failures are unrelated. Merging.

@ycombinator ycombinator merged commit 99fd13a into elastic:master Mar 17, 2020
@ycombinator ycombinator deleted the mb-es-index-bench branch March 17, 2020 15:54
@ycombinator ycombinator removed the needs_backport PR is waiting to be backported to other branches. label Mar 17, 2020
ycombinator added a commit that referenced this pull request Mar 18, 2020
* Benchmark API response parsing code

* Fixing contents

* Removing unnecessary line
ycombinator added a commit that referenced this pull request Mar 19, 2020
* Benchmark API response parsing code

* Fixing contents

* Removing unnecessary line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Stack Monitoring Metricbeat Metricbeat module Team:Services (Deprecated) Label for the former Integrations-Services team v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants