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

perf(ExploreProfiles): Improve performance of the "Labels" exploration type + small fixes #14

Merged
merged 5 commits into from
Jul 2, 2024

Conversation

grafakus
Copy link
Contributor

@grafakus grafakus commented Jul 1, 2024

✨ Description

Related issue(s): follow-up of #5

We improve our SceneByVariableRepeaterGrid component:

  • Better performance when querying timeseries with groupBy present
  • Errors are now caught when the user filters results with invalid regexes

And a DRY refactor by introducing the new SceneLabelValuesDistributionTable (used in SceneGroupByLabels and SceneExploreFavorites),

📖 Summary of the changes

See diff tab for specific comments.

🧪 How to test?

  • The build should pass
  • The Labels exploration type should render faster all the timeseries when "All" is selected (e.g. try with cortex-dev-01/ingester cpu profile)
  • When filtering and providing invalid regexes, the console should not display any errors

@grafakus grafakus changed the title Feat/improve profiles explorer perf perf(ExploreProfiles): Improve performance of the "Labels" exploration type + small improvements Jul 1, 2024
@grafakus grafakus requested a review from bryanhuhta July 1, 2024 15:50
Copy link
Contributor

github-actions bot commented Jul 1, 2024

Unit test coverage

Lines Statements Branches Functions
Coverage: 11%
11.38% (459/4031) 9.09% (134/1474) 8.66% (102/1177)

@grafakus grafakus changed the title perf(ExploreProfiles): Improve performance of the "Labels" exploration type + small improvements perf(ExploreProfiles): Improve performance of the "Labels" exploration type + small fixes Jul 1, 2024
queryType: 'metrics',
profileTypeId: profileMetricId ? profileMetricId : '$profileMetricId',
labelSelector: `{${selector},$filters}`,
groupBy: [groupBy.label],
Copy link
Contributor Author

@grafakus grafakus Jul 1, 2024

Choose a reason for hiding this comment

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

We now always pass groupBy and slice the series when they come back.
It's way faster than to emit n queries from the UI.

This not only improves performance, but allow us to remove the custom code for handling favorites in SceneByVariableRepeaterGrid

@grafakus grafakus requested a review from aleks-p July 1, 2024 16:04
@grafakus grafakus merged commit 7d8b653 into main Jul 2, 2024
5 checks passed
@grafakus grafakus deleted the feat/improve-profiles-explorer-perf branch July 2, 2024 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants