wazuh / wazuh-qa

Wazuh - Quality Assurance
GNU General Public License v2.0
65 stars 32 forks source link

data-visualizer script graph labels overlapping #4899

Closed Deblintrake09 closed 8 months ago

Deblintrake09 commented 8 months ago
Target version Related issue Related PR/dev branch
- - 4.8.0

Description

During research for https://github.com/wazuh/wazuh/issues/20781 it was detected that the script outputs graphs with overlapping labels. This was replicated on Ubuntu 22.04 and Windows 11 instances.

Benchmark-worker_10_CPU

Module Windows Ubuntu
python 3.12.1 3.10.12
matplotlib 3.8.2 3.8.2

Research is needed on cause and apply fixes as needed.

MARCOSD4 commented 8 months ago

Update

I have read and reviewed the issue and all the other issues it depends on, related to the workload, to better understand the problem. Also, I have reviewed the data-visualizer script.

MARCOSD4 commented 8 months ago

Update

I have reviewed how plots are created and performed various tests in my local environment using previously created artifacts but have not been able to replicate the problem.

I have launched this build to test with new artifacts: https://ci.wazuh.info/job/CLUSTER-Workload_benchmarks_metrics/397/

MARCOSD4 commented 8 months ago

Update

I have launched several builds to test the generated artifacts and performed several tests but have not been able to replicate the problem because the time range of the tests is too small. I have launched another build to get data with a larger time range and it should be tested when finished: https://ci.wazuh.info/job/CLUSTER-Workload_benchmarks_metrics/403/.

MARCOSD4 commented 8 months ago

Update

In the initial configuration of the visualization.py script, it was set by default that the range of values of the x-axis labels had an interval of 1 minute. This works correctly when the time range of the tests is small, but if we increase it, to approximately close to 6 hours, the labels overlap and we get graphs like the one shown in this issue.

After trying different alternatives, it has been decided to leave a fixed number of labels (30), whose intervals will be automatically adjusted according to the time of the question test, thus avoiding the labels overlap whatever the duration of the tests. This way we will always have 30 labels, which are enough for the graph to be representative, and they will never overlap with each other.

Different tests have been carried out with 18 minutes, 2 hours, and 6 hours tests and the results are as follows:

6 hours ![test_CPU](https://github.com/wazuh/wazuh-qa/assets/101177239/9c92c45e-cd8e-4426-9b3d-6e8556b7428c)
2 hours ![test_CPU](https://github.com/wazuh/wazuh-qa/assets/101177239/16eebe06-89df-45b7-bcd3-9fbc91905c17)
18 minutes ![test_CPU](https://github.com/wazuh/wazuh-qa/assets/101177239/4cdfdb37-c7e9-447d-a161-83737f9122ae)

Finally, a build has been launched to test that everything works correctly: https://ci.wazuh.info/job/CLUSTER-Workload_benchmarks_metrics/415/

Artifacts: Artifacts.tgz

![CPU](https://github.com/wazuh/wazuh-qa/assets/101177239/8a6a4392-c12e-4802-a743-5cb840ceebb6)
rafabailon commented 8 months ago

LGTM

davidjiglesias commented 8 months ago

LGTM