Data Parsing
Function
Parse the serving profile data.
Precautions
- During profiling, the flushed files are locked. Parsing can be started only after the profiling is complete, or the error message "db is lock" will be displayed.
- Do not enable dynamic profiling again before data parsing is complete, as this may deteriorate profiling performance.
- The following versions are required for data parsing:
- Python 3.10 or later
- pandas 2.2 or later
- NumPy 1.24.3 or later
- psutil 5.9.5 or later
- Matplotlib 3.7.5 or later
- SciPy 1.7.2 or later
Command Format
python3 -m ms_service_profiler.parse --input-path <input-path> [options]
For details about the options, see Options.
Options
Option |
Description |
Required (Yes/No) |
|---|---|---|
--input-path |
Path to profile data. All databases named msproftx.db, ascend_service_profiler_*.db, and ms_service_*.db in the path will be read. |
Yes |
--output-path |
Output path for parsed files. It defaults to the output directory in the current path. |
No |
--log-level |
Log level. The options are as follows:
|
No |
--format |
Format of the exported profile data file. The options are as follows:
If this parameter is not specified, all result files are exported by default. You can specify one or more formats. For example, --format db or --format db csv. NOTE:
If acl_task_time is set to 2 during profiling, the parsing result files can be exported only in .json or .db format. |
No |
Example
Run the following command to perform basic parsing on profile data:
python3 -m ms_service_profiler.parse --input-path ${PATH}/prof_dir/
In addition to basic parsing, performance data can be parsed from multiple dimensions (request, batch, and overall service), and data of different batches can be parsed into fine-grained performance data.
Output Description
After the parsing command is executed, the files are generated in the path specified by --output-path. For details about the files, see Parsing Results.