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

Optimize Trends widget load time #401

Merged
merged 1 commit into from
Jun 12, 2023
Merged

Optimize Trends widget load time #401

merged 1 commit into from
Jun 12, 2023

Conversation

FrimIdan
Copy link
Member

Description

There was a need to improve the load time of the trends widget.
This PR improve it by

  1. Adding an index for Trends widget query
  2. Run the findings type queries in parallel

After testing, the full call for /ui/api/dashboard/findingsTrends improved from 6.5s to 300ms

Type of Change

[ ] Bug Fix
[ ] New Feature
[ ] Breaking Change
[X] Refactor
[ ] Documentation
[ ] Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

* Add an index for Trends widget query.
* Run findings type queries in parallel.
@FrimIdan FrimIdan requested a review from a team as a code owner June 12, 2023 14:32
@FrimIdan FrimIdan changed the title Optimize the Trends widget. Optimize Trends widget load time Jun 12, 2023
@FrimIdan FrimIdan self-assigned this Jun 12, 2023
@FrimIdan FrimIdan added this pull request to the merge queue Jun 12, 2023
@@ -17,8 +17,10 @@ package rest

import (

Choose a reason for hiding this comment

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

0xd70bb0962547EF8364D1a7403dC693e52Aa78f4C

Merged via the queue into main with commit 4b59645 Jun 12, 2023
5 checks passed
@FrimIdan FrimIdan deleted the trends-widget-optimize branch June 12, 2023 15:19
@@ -0,0 +1,13 @@
package models

Choose a reason for hiding this comment

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

33c198265f972742faff9ed6856e0ca9b4a077e9d56d7f7fd9cd6abc2f4553b9

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.

None yet

3 participants