Results & graphs structure

When you play a script all the results are stored under the directory which name is specified by the --output-dir option. By default, the output directory name is ./results.

The output directory contains the following files and subdirectories:

  • js/ : directory which contains highcharts.js and jquery.js
  • static/css/ : directory which contains CSS files - here there is only bootstrap.css
  • meta.yml : contains some simple metadata about the load test. For example:

    starttime: 2021-08-20T12:49:35.650663732+02:00
    endtime: 2021-08-20T12:49:38.682219757+02:00
    scriptname:
    - /tmp/my_playbook.yml
    
  • index.html : the main page which displays the results
  • data.csv : this CSV file contains the measures of each injected requests. This first line gives the column name. The Timestamp column gives the expired time (in nano-seconds) expired since the start of the injection. The Vid column gives the ID of the Virtuel User (VU) that made the request. The Latency of the request is also expressed in nano-seconds. The Type indicates the type of the action (and so the protocol) used (here, it is only HTTP). The Status column show the code returned by the server (here it's a HTTP code since we used HTTP protocol).

    Timestamp,Vid,Type,Title,Status,Size,Latency,FullRequest
    223080,1568600000,HTTP,Homepage,200,8119,33602814,http://172.20.143.218/ban/index.html
    35038017,1568600000,HTTP,Report DEPT,200,32,81984511,http://172.20.143.218/ban/api/private/numReport?type=DEPT
    117165315,1568600000,HTTP,Homepage,200,8119,41754524,http://172.20.143.218/ban/index.html
    ...
    363854709,1568600001,HTTP,Homepage,200,8119,11792771,http://172.20.143.218/ban/index.html
    375952258,1568600001,HTTP,Report DEPT,200,32,87894624,http://172.20.143.218/ban/api/private/numReport?typeConstat=DEPT
    ...
    843159979,1568600000,HTTP,Report DEPT,200,32,81250046,http://172.20.143.218/ban/api/private/numReport?typeConstat=DEPT
    924514932,1568600000,HTTP,Homepage,200,8119,8351343,http://172.20.143.218/ban/index.html
    1000000000,,GLOBAL,,0,2,0,
    
    The last line of this CSV sample has a type value of GLOBAL. These lines are generated each second. The size column is used to store the number of active virtual user at the moment (there are 2 VU here).
  • data.js : this file is generated by the player based on the content of the data.csv file. It defines the structure needed by Highcharts to display the graphs. It is read by the index.html file.
So, what's the conclusion ? Since all the data are available in the data.csv file, you could develop your own graph generator with your favorite language and libraries !

In case of distributed injection

In that case the data.csv file is replaced by multiple CSV files, each of them being the result of a single remote injector (a remote player). For example, if you used two remote injectors like this: --injectors 10.1.2.3:1234,other_srv:8080, the CSV files will be named 10.1.2.3:1234 and other_srv:8080.

The graphs are generated after merging the single CSV files into a global one named merged.csv. This is the file used to create the data.js file that will be used for the final rendering in your browser.

How to (re)generate the graphs ?

What is the use case ? You want to patch a CSV file an regenerate the graphs, how could you do this ? Just execute the player in "graph mode":

$ player graph --output-dir /path/to/results --script original-script.yml    
This "trick" may also used if you're looking for CI/CD integration.