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

[App Search] Added a query performance rating to the Result Settings page #96230

Merged
merged 4 commits into from
Apr 7, 2021

Conversation

JasonStoltz
Copy link
Member

@JasonStoltz JasonStoltz commented Apr 5, 2021

Summary

This PR adds a "Query performance" badge to the Result Settings page.

The "Query performance" shows the current "rating" inside of a colored badge.

The "rating" shown is based on a numeric value that is calculated by summing numeric values based on the various "raw" and "snippet" settings currently selected.

The "score" is calculated as a "selector" in ResultSettingsLogic.

Based on the score, we show:

When the score is less than 6:
optimal
When the score is less than 11:
good
When the score is less than 21:
standard
When the score is anything 21 or over:
delayed

latest

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@JasonStoltz JasonStoltz added release_note:skip Skip the PR/issue when compiling release notes v7.13.0 auto-backport Deprecated - use backport:version if exact versions are needed labels Apr 5, 2021
@JasonStoltz JasonStoltz requested a review from a team April 5, 2021 17:23
Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

couple quick initial comments, need to take a break for the afternoon but will try to return

};

const getPerformanceRating = (score: number) => {
switch (true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

whoa TIL switch (true) 🤯

const { queryPerformanceScore } = useValues(ResultSettingsLogic);
const performanceRating = getPerformanceRating(queryPerformanceScore);
return (
<EuiBadge role="region" aria-live="polite" color={badgeColors[performanceRating]}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Sweeeeet!

@cee-chen
Copy link
Contributor

cee-chen commented Apr 6, 2021

@JasonStoltz BTW, it looks like this branch also needs to be merged/rebased against master to fix a merge conflict.

@JasonStoltz JasonStoltz requested a review from cee-chen April 6, 2021 18:58
@JasonStoltz
Copy link
Member Author

Updated screenshot after merging with master
other

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 1318 1320 +2

Async chunks

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

id before after diff
enterpriseSearch 1.9MB 1.9MB +3.0KB

History

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

Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

Changes look fantastic, thanks Jason. Screenshot is awesome as well - it's all coming together!

@kibanamachine
Copy link
Contributor

💚 Backport successful

7.x / #96449

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes v7.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants