You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The developed tool deps/wazuh_testing/wazuh_testing/tools/performance/statistic.py to retrieve statistics from the Wazuh API has certain improvements that may be needed to avoid misfunctions and errors in the fetched data.
API Token management
The API authentication process is an API process child in charge of managing the authentication requests made to the API that are queued before attending them and returning a response. If any of the requests are delayed, the processing time is carried over to the following requests, making the API susceptible to errors. This happened in a worker of a loaded environment (Compare wazuh-db stats in loaded env wazuh#21937 (comment)) in which the API received three consecutive calls:
2024/02/23 18:38:58 INFO: wazuh 127.0.0.1 "GET /security/user/authenticate" with parameters {} and body {} done in 200.024s: 500
2024/02/23 18:38:58 ERROR: JSON couldn't be loaded
2024/02/23 18:38:58 INFO: wazuh 127.0.0.1 "GET /security/user/authenticate" with parameters {} and body {} done in 209.895s: 500
2024/02/23 18:38:58 ERROR: JSON couldn't be loaded
2024/02/23 18:38:58 INFO: wazuh 127.0.0.1 "GET /security/user/authenticate" with parameters {} and body {} done in 205.954s: 500
The process could be enhanced, keeping in mind the time it takes for the JWT token to expire and requesting it only if needed.
Retrieved statistics management and data visualization
The tool contains a method to Write the data collected from the .state into a CSV file.. It explicitly defines the fields to fetch from the obtained data that should be written in the CSV file and is prone to errors in case a modification from the Core or Framework side is to be done. This must be analyzed so that it is maintainable over time and robust to changes in the origin of the data.
The data visualization script suffers a similar caveat, the plots are generated using hardcoded columns and fails if any of their names changes or if the column is no longer present. We should find a way of generating graphics dynamically to prevent the pipeline from failing everytime there is a minimal modification to the statistics files.
Sample artifacts that can be of use to test modifications (these already contain the resulting CSV files in <node>/data/stats/<target>):
Description
The developed tool
deps/wazuh_testing/wazuh_testing/tools/performance/statistic.py
to retrieve statistics from the Wazuh API has certain improvements that may be needed to avoid misfunctions and errors in the fetched data.The API authentication process is an API process child in charge of managing the authentication requests made to the API that are queued before attending them and returning a response. If any of the requests are delayed, the processing time is carried over to the following requests, making the API susceptible to errors. This happened in a worker of a loaded environment (Compare wazuh-db stats in loaded env wazuh#21937 (comment)) in which the API received three consecutive calls:
The process could be enhanced, keeping in mind the time it takes for the JWT token to expire and requesting it only if needed.
wazuh-qa/deps/wazuh_testing/wazuh_testing/tools/performance/statistic.py
Lines 159 to 178 in 6e19ed1
Retrieved statistics management and data visualization
The tool contains a method to
Write the data collected from the .state into a CSV file.
. It explicitly defines the fields to fetch from the obtained data that should be written in the CSV file and is prone to errors in case a modification from the Core or Framework side is to be done. This must be analyzed so that it is maintainable over time and robust to changes in the origin of the data.The data visualization script suffers a similar caveat, the plots are generated using hardcoded columns and fails if any of their names changes or if the column is no longer present. We should find a way of generating graphics dynamically to prevent the pipeline from failing everytime there is a minimal modification to the statistics files.
Sample artifacts that can be of use to test modifications (these already contain the resulting CSV files in
<node>/data/stats/<target>
):artifacts4.7.3-I.zip
artifacts4.7.3-II.zip
artifacts4.7.3-III.zip
The text was updated successfully, but these errors were encountered: