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

Decoder integrate #4261

Merged
merged 17 commits into from
Oct 6, 2020
Merged

Decoder integrate #4261

merged 17 commits into from
Oct 6, 2020

Conversation

simitt
Copy link
Contributor

@simitt simitt commented Oct 2, 2020

Motivation/summary

This PR integrates the previous work for creating the modeldecoders for backend and rum v2 events.
It does not integrate the new decoders for rumv3.

I created the PR as draft PR as it is based off of #4259, therefore the reviewer can ignore the first three commits and focus on the commits starting with (9106eff).
Apart from the unmerged base this PR is ready for review.

Checklist

- [ ] I have signed the Contributor License Agreement.
- [ ] I have updated CHANGELOG.asciidoc

I have considered changes for:
- [ ] documentation
- [ ] logging (add log lines, choose appropriate log selector, etc.)
- [ ] metrics and monitoring (create issue for Kibana team to add metrics to visualizations, e.g. [Kibana#44001](elastic/kibana#44001))

How to test these changes

run make test to ensure all tests are still working

Benchmark results

comparing results from elastic/master with this branch for processor.stream.BenchmarkBackendProcessor:

Speed Screenshot 2020-10-02 at 19 56 07 Screenshot 2020-10-02 at 19 56 20
Memory Screenshot 2020-10-02 at 19 56 32 Screenshot 2020-10-02 at 19 56 39

Hey-APM benchmarks

see #4261 (comment)

Related issues

related to #3551

@simitt simitt requested a review from a team October 2, 2020 17:58
@apmmachine
Copy link
Contributor

apmmachine commented Oct 2, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #4261 updated]

  • Start Time: 2020-10-06T14:55:07.350+0000

  • Duration: 45 min 17 sec

Test stats 🧪

Test Results
Failed 0
Passed 4257
Skipped 145
Total 4402

Steps errors 2

Expand to view the steps failures

  • Name: Compress

    • Description: tar --exclude=coverage-files.tgz -czf coverage-files.tgz coverage

    • Duration: 0 min 0 sec

    • Start Time: 2020-10-06T15:11:00.263+0000

    • log

  • Name: Compress

    • Description: tar --exclude=system-tests-linux-files.tgz -czf system-tests-linux-files.tgz system-tests

    • Duration: 0 min 0 sec

    • Start Time: 2020-10-06T15:22:32.450+0000

    • log

@simitt
Copy link
Contributor Author

simitt commented Oct 3, 2020

jenkins run hey-apm tests please

@simitt simitt mentioned this pull request Oct 3, 2020
14 tasks
@simitt
Copy link
Contributor Author

simitt commented Oct 3, 2020

I didn't manage to trigger Jenkins to run hey-apm tests, so here are some preliminary local tests. Results show less improvement than microbenchmark (which is expected as different events are sent by hey-apm).
The dashboard shows 4 runs, the first and last run show results for branch decoder-integrate, the two middle ones for current master (results are not stacked).
Screenshot 2020-10-03 at 07 20 17

@simitt simitt force-pushed the decoder-integrate branch from 4e94a87 to fb94786 Compare October 5, 2020 12:52
* change stream processor logic

* adapt package tests

* adapt decoder to be able to read ahaed for idenitying event type
@simitt simitt force-pushed the decoder-integrate branch from fb94786 to 6a6e2d1 Compare October 5, 2020 14:18
@simitt simitt marked this pull request as ready for review October 5, 2020 14:18
@simitt
Copy link
Contributor Author

simitt commented Oct 5, 2020

Jenkins, run the tests again please

* sourcemaps: Add RUM information to config for accurate sourcemapping

* uppercase method names

* fix experimental
Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

There's a bunch of things to look into here, but nothing critical as far as I can see. They can mostly be handled in follow-ups. Otherwise LGTM - I'm excited to get this in!

A couple of things I'd like you to look at before merging is the change in error code for beater/api/profile/handler_test.go, and the change in number of accepted items in the ReadError test. I think the latter is probably due to the "ReadAhead" call, but not 100% sure.

beater/api/profile/handler_test.go Outdated Show resolved Hide resolved
beater/request/context.go Outdated Show resolved Hide resolved
processor/stream/old.txt Outdated Show resolved Hide resolved
processor/stream/processor.go Outdated Show resolved Hide resolved
processor/stream/processor.go Outdated Show resolved Hide resolved
@simitt
Copy link
Contributor Author

simitt commented Oct 6, 2020

@axw once again, thanks for the review.

A couple of things I'd like you to look at before merging is the change in error code for beater/api/profile/handler_test.go, and the change in number of accepted items in the ReadError test. I think the latter is probably due to the "ReadAhead" call, but not 100% sure.

I addressed both of them, let me know what you think.

Still need to figure out the failing go systemtests though.

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

Yeah, that's going to be tricky, we would need to either run the validation directly on the decoding (which I avoided to make it easier to switch between different decoders - e.g. simdjson in the future); or we would need to also introduce a state that checks whether or not a struct was set, similar to what I do with IsSet() in the nullable package. I started out with something like that, but it also gets confusing easily, e.g. for semantic difference of nil, not set, zero etc. and how this should be reflected on the input models.

Right, fair enough. I was thinking we could update a bitset during decoding, and check that in validation. Likely a fair bit of work for marginal gain, so not high priority at all.

processor/stream/processor.go Outdated Show resolved Hide resolved
processor/stream/processor.go Outdated Show resolved Hide resolved
response.LimitedAdd(&Error{
Type: InvalidInputErrType,
Message: err.Error(),
Message: errors.Wrap(ErrUnrecognizedObject, eventType).Error(),
Copy link
Member

Choose a reason for hiding this comment

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

No big deal, but it would be less of an awkward error message if ErrUnrecognizedObject were a type, with the event type as a field: "did not recognize object type: invalid-json" vs. "invalid-json: did not recognize object type"

@simitt
Copy link
Contributor Author

simitt commented Oct 6, 2020

Jenkins, run hey-apm tests please

@simitt
Copy link
Contributor Author

simitt commented Oct 6, 2020

jenkins run the hey-apm tests please

@simitt simitt merged commit 2c36ad7 into elastic:master Oct 6, 2020
simitt added a commit to simitt/apm-server that referenced this pull request Oct 6, 2020
…lastic#4261)

* change stream processor logic

* adapt package tests

* adapt decoder to be able to read ahaed for identifying event type

* add RUM information in stream processor for accurate sourcemapping

* Allow empty lines for backwards compatibility

* Add changelog for error messages on Intake API
simitt added a commit that referenced this pull request Oct 6, 2020
…4261) (#4270)

* change stream processor logic

* adapt package tests

* adapt decoder to be able to read ahaed for identifying event type

* add RUM information in stream processor for accurate sourcemapping

* Allow empty lines for backwards compatibility

* Add changelog for error messages on Intake API
@simitt
Copy link
Contributor Author

simitt commented Oct 7, 2020

jenkins run the hey-apm tests please

@simitt
Copy link
Contributor Author

simitt commented Oct 12, 2020

finally got some results on allocations:

  c2c37f3   87aaafb    
  events/sec allocations events/sec allocations reduced allocations (%)
           
transactions only very high load 403.34 16.08 410.13 14.56 -10.95181203
transactions only 385.59 2.41 397.01 2.24 -9.72753699
small transactions 361.5 4.57 394.89 4.36 -12.66215842
large transactions 358.8 6.73 395.61 6.52 -12.13463753
very large errors only 347.24 14.08 350.82 12.7 -10.7215854
small errors only 342.65 9.04 346.88 8.57 -6.35515674
transactions, spans and errors high load 317.78 18.8 337.91 17.07 -14.61114536

@jalvz jalvz self-assigned this Oct 14, 2020
@simitt simitt deleted the decoder-integrate branch October 19, 2020 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants