Analysis Command report
Command Function
The tool analyzes the JSON files generated during data collection and generates terminal and Excel reports. A terminal report displays summary data, and an Excel report displays summary data and a time series chart.
Syntax
1 | ./ksys report [-h] -i INPUT [-o OUTPUT] [--parse TYPE LOG_DIRECTORY] [-c] [-l {0,1,2,3}] |
Parameter Description
Parameter |
Option |
Description |
||
|---|---|---|---|---|
-h/--help |
- |
Obtains help information. This parameter is optional. |
||
-i/--input |
- |
JSON file directory. The JSON file must be obtained by running the collect command. This parameter is mandatory. |
||
-o/--output |
- |
Excel file directory. This parameter is optional. If you do not set this parameter, an Excel file in the Y_M_D_H_M_S_report format is generated in the current directory. |
||
--parse |
- |
Application type and log file directory. This parameter is optional. Use a space to separate the application type and log file directory. For example:
The format of each application log file in the directory must meet the following requirements:
|
||
-c/--cpu |
- |
Saves the time series data of each CPU to the Excel result file. This parameter is optional. |
||
-l/--log-level |
0/1/2/3 |
Log level, which defaults to 1. This parameter is optional.
|
Example
- Display the information about report:
1./ksys report -h
Command output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
USAGE ksys report [-h] -i INPUT [-o OUTPUT] [--parse TYPE LOG_DIRECTORY] [-c] [-l {0,1,2,3}] DESCRIPTION Create a report command line task. options: -h, --help show this help message and exit -i INPUT, --input INPUT Input the full path of the JSON file. This file must be collected by running the collect command. -o OUTPUT, --output OUTPUT Output the full path. --parse TYPE LOG_DIRECTORY Input the report type and directory. The following report types are supported: mysql: errorlog, generallog, and slowlog reports of MySQL 5.7.27 to 8.0.5. flink: jobmanager and taskmanager system-level logs of Flink 1.20.1 to 2.0.0. redis: Redis-server logs of Redis 5.0.12 to 6.0.20. spark: system-level logs of Spark 3.1.1 to 3.2.1. kafka: system-level logs of Kafka 2.8.2-1 to 2.13-4. openGauss: system-level logs of openGauss 5.0.0LTS to 7.0.0.RC. general: reports can be generated by performance test tools such as Sysbench. Other reports can also be generated but they must meet specific formats. For details, see README. -c, --cpu Save the time sequence data of each CPU to the Excel file. If the input JSON file is collected using the -p option, this option is invalid. -l {0,1,2,3}, --log-level {0,1,2,3} Set the log level (0=DEBUG, 1=INFO, 2=WARNING, 3=ERROR), which defaults to 1(INFO).
- If the collected service has logs, you can associate the service logs during analysis.
./ksys report -i /home/test/2025_08_14_15_11_20_report.json --parse spark /home/test/
The service log alignment analysis task aligns the service data time line with the system data time line. After analysis, summary data is returned, which is essentially the same as the information provided when system metrics are collected. The difference is that if the time lines overlap and service data exists, the service data is saved in a JSON file and the time series service data is saved on the first tab page of the Excel file.
2025_08_14_15_11_20_report.json is the JSON file generated by running the ksys collect command.
Command output:
1 2 3
Save statistics and time series data to an Excel file. Please wait. Data saved successfully at /home/test/2025_08_14_16_04_57_service.json The report has been saved to /home/test/2025_08_14_16_04_57_report.xlsx