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

Improve loading speed #7099

Closed
wants to merge 39 commits into from

Conversation

guidomodarelli
Copy link
Contributor

@guidomodarelli guidomodarelli commented Oct 15, 2024

Description

The primary objective is to enhance the application's initial load time.

I have made modifications to the backend endpoints following a comprehensive analysis of network performance during the application's initial load. These endpoints were identified as the primary contributors to latency. However, the impact of these changes may be negligible, as they primarily represent micro-optimizations rather than substantial improvements.

Issues Resolved

Closes #7084

Evidence

/check-stored-api

BEFORE

Average of 620 ms

image

AFTER

Average of 578 ms

image

/check-api

BEFORE

Average of 739,5 ms

image

AFTER
Average of 674 ms

image

Test

  1. Open DevTools, navigate to the Application tab, and click on "Clear site data".

    image

  2. Right-click the reload page button, then select "Empty Cache and Hard Reload."

    image

  3. Repeat these steps:

    Peek.2024-10-15.13-59.mp4

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@guidomodarelli guidomodarelli self-assigned this Oct 15, 2024
@guidomodarelli guidomodarelli linked an issue Oct 15, 2024 that may be closed by this pull request
…ant variable assignment.- Remove commented out code for checking API parameters.- Simplify logic for handling missing API data
CHANGELOG.md Outdated Show resolved Hide resolved
export interface WazuhPluginSetup {}

export interface WazuhPluginStart {}

export type PluginSetup = {
securityDashboards?: {}; // TODO: Add OpenSearch Dashboards Security interface
wazuhCore: {};
wazuhCore: WazuhCore;
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: this should use the type of wazuhCore plugin instead of defining a type in the wazuh plugin

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 45.5% ( 400 / 879 )
Branches 41.09% ( 157 / 382 )
Functions 43.87% ( 136 / 310 )
Lines 45.69% ( 398 / 871 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 14.74% ( 4385 / 29730 )
Branches 9.74% ( 1873 / 19217 )
Functions 14.48% ( 1039 / 7173 )
Lines 14.95% ( 4277 / 28601 )

@asteriscos
Copy link
Member

The proposed changes don't provide a significant improvement in the loading performance. We will analyze a deep refactor in a different issue.

@asteriscos asteriscos closed this Nov 5, 2024
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.

Improve loading speed
3 participants