-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[APM] Add API tests for storage explorer #141391
Conversation
Pinging @elastic/apm-ui (Team:APM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. just some suggestions
const transactionStats = body.processorEventStats.find( | ||
({ processorEvent }) => processorEvent === ProcessorEvent.transaction | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could use keyBy to create an object per processorEvent. With that, you won't need to use find for each type.
const transactionStats = body.processorEventStats.find( | |
({ processorEvent }) => processorEvent === ProcessorEvent.transaction | |
); | |
const statsGroupedByEvent = keyBy(body.processorEventStats, 'processorEvent') | |
const transactionStats = statsGroupedByEvent[ProcessorEvent.transaction] | |
const spanStats = statsGroupedByEvent[ProcessorEvent.span] | |
.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, added it in b8679d2
const goServiceStats = body.serviceStatistics.find( | ||
({ serviceName }) => serviceName === 'opbeans-go' | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
|
||
expect(status).to.be(200); | ||
expect(body.numberOfServices).to.be(2); | ||
expect(Math.round(body.tracesPerMinute)).to.be(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could use https://github.com/cauemarcondes/kibana/blob/apm-labs-telemetry/x-pack/test/apm_api_integration/utils.ts#L12:L12. but it's up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in b8679d2
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
* Add API tests for storage explorer (cherry picked from commit 4137fb3)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
* Add API tests for storage explorer (cherry picked from commit 4137fb3) Co-authored-by: Giorgos Bamparopoulos <[email protected]>
Add API tests for storage explorer.
Related to #140199