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

[APM] Adding comparison to throughput chart #90128

Merged

Conversation

cauemarcondes
Copy link
Contributor

@cauemarcondes cauemarcondes commented Feb 3, 2021

closes #90570

Screenshot 2021-02-05 at 12 03 21

time.comparison.mov

@cauemarcondes cauemarcondes force-pushed the apm-time-comparison-throughput-chart branch from 577d70a to 77ff058 Compare February 4, 2021 10:47
@cauemarcondes cauemarcondes changed the title adding comparison to throughput chart [APM] Adding comparison to throughput chart Feb 5, 2021
@cauemarcondes cauemarcondes added release_note:skip Skip the PR/issue when compiling release notes v7.12.0 apm:comparison labels Feb 5, 2021
@cauemarcondes cauemarcondes force-pushed the apm-time-comparison-throughput-chart branch from 9376c67 to 78bee41 Compare February 5, 2021 11:06
@cauemarcondes cauemarcondes marked this pull request as ready for review February 5, 2021 11:06
@cauemarcondes cauemarcondes requested a review from a team as a code owner February 5, 2021 11:06
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Feb 5, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@cauemarcondes
Copy link
Contributor Author

@elasticmachine merge upstream

@@ -53,19 +52,19 @@ interface SetupRequestParams {
/**
* Timestamp in ms since epoch
*/
start?: string;
start?: number;
Copy link
Member

Choose a reason for hiding this comment

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

Why was this changed? It's not a biggie but does make the url a bit harder to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing changes in the URL @sqren, I created a new runtime to convert from string (ISO) to number (timestamp). That's why this is now a number.

).toEqual([]);
});

it('returns empty array when current period timeseries is empty', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding this! IMHO this is a bug. At least, I'm not sure why this function would not return data for the previous period if there is data. Instead of merging buckets, have you considered offsetting the data for the previous period by the time difference between end and comparisonEnd (or start and comparisonStart, not sure what the implications are)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dgieselaar I changed the merge function to calculate the x-axis from the previous timeseries based on the time difference (currentPeriodStart and previousPeriodStart)

https://github.com/elastic/kibana/pull/90128/files#diff-0b2c86f706e4bcb3ab0cfaaf6cc7a6cee303d02b59c9b11a6af847eb5916aedbR11

@dgieselaar
Copy link
Member

@elasticmachine merge upstream

@dgieselaar dgieselaar self-assigned this Feb 12, 2021
@dgieselaar
Copy link
Member

I've fixed the issue with the runtime type, converted comparisonType to use an enum and change the labels from yesterday/a week ago to day before/week before. Additionally I fixed a bug where the throughput value for the charts was not correct because it was divided by the entire time range instead of the bucket size (not related to this PR). I'll merge this when CI is green.

@dgieselaar dgieselaar added auto-backport Deprecated - use backport:version if exact versions are needed v8.0.0 labels Feb 12, 2021
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1730 1731 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 5.2MB 5.2MB +3.0KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dgieselaar dgieselaar merged commit 874fadf into elastic:master Feb 12, 2021
@kibanamachine
Copy link
Contributor

Backport result

{"level":"info","message":"POST https://api.github.com/graphql (status: 200)"}
{"level":"info","message":"POST https://api.github.com/graphql (status: 200)"}
{"meta":{"labels":["Team:apm","apm:comparison","auto-backport","release_note:skip","v7.12.0","v8.0.0"],"branchLabelMapping":{"^v8.0.0$":"master","^v7.12.0$":"7.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"},"existingTargetPullRequests":[]},"level":"info","message":"Inputs when calculating target branches:"}
{"meta":["7.x"],"level":"info","message":"Target branches inferred from labels:"}
{"meta":{"killed":false,"code":2,"signal":null,"cmd":"git remote rm kibanamachine","stdout":"","stderr":"error: No such remote: 'kibanamachine'\n"},"level":"info","message":"exec error 'git remote rm kibanamachine':"}
{"meta":{"killed":false,"code":2,"signal":null,"cmd":"git remote rm elastic","stdout":"","stderr":"error: No such remote: 'elastic'\n"},"level":"info","message":"exec error 'git remote rm elastic':"}
{"level":"info","message":"Backporting [{\"sourceBranch\":\"master\",\"targetBranchesFromLabels\":[\"7.x\"],\"sha\":\"874fadf388eed6fc43dde79e74698158b5245398\",\"formattedMessage\":\"[APM] Adding comparison to throughput chart (#90128)\",\"originalMessage\":\"[APM] Adding comparison to throughput chart (#90128)\\n\\nCo-authored-by: Kibana Machine <[email protected]>\\r\\nCo-authored-by: Dario Gieselaar <[email protected]>\",\"pullNumber\":90128,\"existingTargetPullRequests\":[]}] to 7.x"}

Backporting to 7.x:
{"level":"info","message":"Backporting via filesystem"}
{"meta":{"killed":false,"code":1,"signal":null,"cmd":"git cherry-pick 874fadf388eed6fc43dde79e74698158b5245398","stdout":"Auto-merging x-pack/plugins/apm/server/routes/services.ts\nCONFLICT (content): Merge conflict in x-pack/plugins/apm/server/routes/services.ts\nAuto-merging x-pack/plugins/apm/server/lib/services/get_throughput.ts\nCONFLICT (content): Merge conflict in x-pack/plugins/apm/server/lib/services/get_throughput.ts\nAuto-merging x-pack/plugins/apm/server/lib/helpers/setup_request.ts\nCONFLICT (content): Merge conflict in x-pack/plugins/apm/server/lib/helpers/setup_request.ts\nAuto-merging x-pack/plugins/apm/public/context/url_params_context/types.ts\nAuto-merging x-pack/plugins/apm/public/context/url_params_context/resolve_url_params.ts\nRemoving x-pack/plugins/apm/common/runtime_types/date_as_string_rt/index.test.ts\n","stderr":"error: could not apply 874fadf388e... [APM] Adding comparison to throughput chart (#90128)\nhint: after resolving the conflicts, mark the corrected paths\nhint: with 'git add <paths>' or 'git rm <paths>'\nhint: and commit the result with 'git commit'\n"},"level":"info","message":"exec error 'git cherry-pick 874fadf388eed6fc43dde79e74698158b5245398':"}
{"meta":{"killed":false,"code":2,"signal":null,"cmd":"git --no-pager diff --check","stdout":"x-pack/plugins/apm/server/lib/helpers/setup_request.ts:112: leftover conflict marker\nx-pack/plugins/apm/server/lib/helpers/setup_request.ts:118: leftover conflict marker\nx-pack/plugins/apm/server/lib/helpers/setup_request.ts:125: leftover conflict marker\nx-pack/plugins/apm/server/lib/services/get_throughput.ts:19: leftover conflict marker\nx-pack/plugins/apm/server/lib/services/get_throughput.ts:22: leftover conflict marker\nx-pack/plugins/apm/server/lib/services/get_throughput.ts:25: leftover conflict marker\nx-pack/plugins/apm/server/lib/services/get_throughput.ts:90: leftover conflict marker\nx-pack/plugins/apm/server/lib/services/get_throughput.ts:95: leftover conflict marker\nx-pack/plugins/apm/server/lib/services/get_throughput.ts:109: leftover conflict marker\nx-pack/plugins/apm/server/routes/services.ts:23: leftover conflict marker\nx-pack/plugins/apm/server/routes/services.ts:24: leftover conflict marker\nx-pack/plugins/apm/server/routes/services.ts:32: leftover conflict marker\nx-pack/plugins/apm/server/routes/services.ts:248: leftover conflict marker\nx-pack/plugins/apm/server/routes/services.ts:261: leftover conflict marker\nx-pack/plugins/apm/server/routes/services.ts:277: leftover conflict marker\n","stderr":""},"level":"info","message":"exec error 'git --no-pager diff --check':"}
Commit could not be cherrypicked due to conflicts

spalger added a commit to spalger/kibana that referenced this pull request Feb 13, 2021
spalger added a commit to spalger/kibana that referenced this pull request Feb 13, 2021
dgieselaar added a commit to dgieselaar/kibana that referenced this pull request Feb 14, 2021
Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Dario Gieselaar <[email protected]>
dgieselaar added a commit that referenced this pull request Feb 15, 2021
Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Dario Gieselaar <[email protected]>

Co-authored-by: Cauê Marcondes <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:comparison auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:APM All issues that need APM UI Team support v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Add comparison data to Throughput chart
5 participants