Rate This Document
Findability
Accuracy
Completeness
Readability

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

Table 1 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:

1
--parse spark /home/test

The format of each application log file in the directory must meet the following requirements:

  • mysql: errorlog, generallog, and slowlog reports of MySQL 5.7.27 to 8.0.5
  • flink: jobmanager and taskmanager system 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 logs of Spark 3.1.1 to 3.2.1
  • kafka: system logs of Kafka 2.8.2-1 to 2.13-4
  • openGauss: system logs of openGauss 5.0.0 LTS to 7.0.0.RC
  • general: logs generated by performance test tools such as Sysbench, and other logs for common applications A general log must be a CSV file. For details, see the /template/mysql_template.csv file in the tool installation directory.
    • The first line is the title in the format of TIME, KPI(SUM/AVG), LEVEL, INFORMATION, and TEXT.
      • TIME: timestamp in yyyy-mm-dd hh:mm:ss.xxx format. The maximum time precision is second while the minimum time precision is not limited. Each timestamp must be unique.
      • KPI: numeric data. Replace KPI with the actual data name. Use SUM or AVG to specify the data processing mode. SUM calculates the sum of data in a column and AVG calculates the average value of data in a column.
      • LEVEL: log level.
      • INFORMATION: character string included in the log level. LEVEL and INFORMATION must be used together to specify the log level and information.
      • TEXT: plain text information. Replace TEXT with the actual data name, for example, a SQL query statement.
    • The data from the second line is the actual data.

-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.

  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR

Example

  1. 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).
    
  2. 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