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

Fix statistics visualizations when cluster mode is disabled #6352

Merged

Conversation

lucianogorza
Copy link
Contributor

@lucianogorza lucianogorza commented Jan 22, 2024

Description

This PR solves the followins issue in Server Management -> Statistics:

  • Fix initial error when cluster mode is disabled.
  • Replace the definitions of visualizations Events processed and Events Dropped according to the cluster mode, and this way only add the aggregation by the field node.name when cluster mode is enabled.
  • Apply visualizations filter when node is selected.

Issues Resolved

#6343

Evidence

Cluster mode disabled

Cluster mode disabled

Cluster mode enabled

Cluster mode enabled

Cluster mode enabled and filtered by node

Filtered by node

Test

  1. Disabled cluster mode from the server configuration: https://documentation.wazuh.com/current/user-manual/configuring-cluster/index.html
  2. Go to Server Management -> Statistics.
  3. Check the visualizations from both tabs.
  4. Enabling cluster mode and repeat steps 2 and 3.
  5. Filter by node and check visualizations.

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

@lucianogorza lucianogorza self-assigned this Jan 22, 2024
@lucianogorza lucianogorza linked an issue Jan 22, 2024 that may be closed by this pull request
@lucianogorza lucianogorza marked this pull request as ready for review January 22, 2024 15:21
@lucianogorza lucianogorza requested a review from a team as a code owner January 22, 2024 15:21
@yenienserrano yenienserrano self-requested a review January 22, 2024 16:26
yenienserrano
yenienserrano previously approved these changes Jan 22, 2024
Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

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

CR: ✅
Test: ✅

manager
image
image

Cluster
image
image

@Tostti
Copy link
Member

Tostti commented Jan 23, 2024

Test

Manager
image
image

Cluster
image
image

Tostti
Tostti previously approved these changes Jan 23, 2024
Copy link
Member

@Tostti Tostti left a comment

Choose a reason for hiding this comment

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

Test ✅
CR ✅

LGTM

@lucianogorza lucianogorza dismissed stale reviews from Tostti and yenienserrano via 3e31472 January 24, 2024 17:00
Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 21.18% ( 186 / 878 )
Branches 17.99% ( 79 / 439 )
Functions 14% ( 36 / 257 )
Lines 21.4% ( 183 / 855 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.78% ( 172 / 224 )
Branches 57.42% ( 58 / 101 )
Functions 61.7% ( 29 / 47 )
Lines 76.78% ( 172 / 224 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 12.22% ( 4207 / 34427 )
Branches 8.28% ( 1918 / 23140 )
Functions 11.72% ( 959 / 8177 )
Lines 12.39% ( 4092 / 33020 )

Copy link
Member

@asteriscos asteriscos left a comment

Choose a reason for hiding this comment

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

CR: ✔️
Test: ✔️

Cluster mode disabled

Peek 2024-01-24 19-18

Cluster mode enabled (with and without filter by node)

Peek 2024-01-24 19-23

@asteriscos asteriscos merged commit bcb7853 into 4.8.0 Jan 24, 2024
4 checks passed
@asteriscos asteriscos deleted the fix/6343-statistics-error-when-cluster-mode-is-disabled branch January 24, 2024 18:25
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.

Statistics error when cluster mode is disabled
4 participants