wazuh-dashboard-plugins icon indicating copy to clipboard operation
wazuh-dashboard-plugins copied to clipboard

Agents section performance improvements

Open asteriscos opened this issue 1 year ago • 1 comments

Description

This PR optimizes the number of requests Agents Overview makes and it also avoids a few serialization o requests to allow asynchronous components start up.

Results

As a result of these changes the section has improved significantly the init loading time.

Before the changes: image

After the changes: image

Closes #3623

Loading experience

This PR includes a change to make each card and KPI have independent loading indicator to make information available as soon as possible, instead of waiting every dashboard request response.

Peek 2022-08-01 19-17

There's a known issue with the Evolution loading indicator: there's a shared loading state which makes the Agents Evolution loading icon flicker.

asteriscos avatar Jul 29 '22 10:07 asteriscos

Jest Test Coverage % values
Statements 6.69% ( 2431 / 36352 )
Branches 2.68% ( 754 / 28133 )
Functions 4.48% ( 398 / 8882 )
Lines 6.77% ( 2352 / 34767 )

github-actions[bot] avatar Aug 01 '22 18:08 github-actions[bot]

TR: :heavy_check_mark:

Screencast from 07-09-22 10:50:14.webm

Comment: We detected a wrong label on synced agent percentage. Screenshot from 2022-09-07 10-51-50 C.C @asteriscos

Mayons95 avatar Sep 07 '22 13:09 Mayons95

TR: heavy_check_mark

Screencast.from.07-09-22.10.50.14.webm Comment: We detected a wrong label on synced agent percentage. Screenshot from 2022-09-07 10-51-50 C.C @asteriscos

Good catch! I added the new synced agents initial value as well in this commit. Screenshot from 2022-09-07 16-54-29

asteriscos avatar Sep 07 '22 15:09 asteriscos

Commit Test OK! I attached the video here Screencast from 07-09-22 12:07:48.webm C.C @asteriscos @AlexRuiz7

Mayons95 avatar Sep 07 '22 15:09 Mayons95

The backport to 4.4-7.16 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.4-7.16 4.4-7.16
# Navigate to the new working tree
cd .worktrees/backport-4.4-7.16
# Create a new branch
git switch --create backport-4363-to-4.4-7.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4f710c1c1aefa1395a24c82e8a5d1ff673a47ee6
# Push it to GitHub
git push --set-upstream origin backport-4363-to-4.4-7.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.4-7.16

Then, create a pull request where the base branch is 4.4-7.16 and the compare/head branch is backport-4363-to-4.4-7.16.

github-actions[bot] avatar Sep 08 '22 12:09 github-actions[bot]