Analyzer¶
Overview¶
The Analysis component produces some metrics based on the results and the .parquet
files produced by previous components. This component is produced in Python and
provides the functionality of a library called either from a command-line tool
or by creating a script to call the library functions.
Run Analyzer¶
The command line tool in tests/infra/piccolo/analyze_packages.py provides a default analysis that returns some throughput and latency metrics. For more targeted analysis you can create your own scripts, such as tests/infra/piccolo/throughput_analysis.py.
Command-Line Tool¶
For a full description of all options, run:
$ python3 analyze_packages.py --help
Some example invocations from the tests/infra/piccolo/ directory:
# Analyze using default parquet file paths
$ python3 analyze_packages.py
# Analyze using custom parquet file paths
$ python3 analyze_packages.py \
--input_path requests.parquet \
--send_file_path send.parquet \
--response_file_path responses.parquet
Running this file will produce some tables on the terminals with the metrics such as analysis-table and some images with graphs exported to the same directory.
Total Requests |
Total Time (s) |
Pass (%) |
Fail (%) |
Throughput (req/s) |
92000 |
49.466 |
100.0 |
0.0 |
1859.9 |
Scripting Analysis¶
To use the library to create your own analysis, you need first to read the
parquet files as dataframes using get_df_from_parquet_file() providing
the path to the file as an argument.
To use the analysis functions for your dataframes, you first need to
create a new Analyze object. It is suggested to first call the
iter_for_success_and_latency() function which based on the
dataframes given as arguments, will populate the latency lists
and the percentage of the successful requests for your dataframes. Based
on these results you can calculate the total time of the experiment
with total_time_in_sec() to get throughput, or you could
customize your own metrics table with customize_table()
providing the lists for the field names and the values. For
more information about the provided functions, you can see the
library code on the tests/infra/piccolo/analyzer.py.