Skip to content

Import HAR and Script Files

Import HTTP Archives

The HTTP archives format is an open format for exporting and exchanging data collected by HTTP monitoring tools.

This format is based on a JSON structure, usually stored in .har files.

The following procedure explains how to import an HTTP archive in Kraken:

  1. In the simulations tree, open the contextual menu,
  2. Click on Upload HAR, a file upload dialog appears,
  3. Select an .har file, the download automatically starts,
  4. When the download is done, the Import HAR dialog opens,
  5. Select a Simulation package, following the Java package naming convention,
  6. Select a Simulation name, following Java class names conventions,
  7. Click on Import, the simulation .scala file is automatically generated and debug results are generated.

Tip

Right-click on an already uploaded HAR file and click on the Import HAR menu item to re-import it.

Record a HAR file

HAR Recording is well explained in OctoPerf's documentation:

Behind the hood

Importing a HAR file is in fact divided in several operations:

  • Uploading the HAR file,
  • Running a script shell that executes several Docker containers thanks to docker-compose:
    • One that runs Gatling's HAR recorder,
    • One that runs Kraken HAR Importer (converts a HAR file into debug chunks).

In case you need to fine tune how the HAR import is configured, you may want to update the corresponding docker-compose.yml and recorder.sh files in the Administration App.

Import Scala Scripts

In case you already have Gatling scripts that you want to execute, follow this procedure to import them:

  1. Create folders according to the simulation package (for example create the folders com and inside it test for the package com.test),
  2. Upload the Gatling .scala simulation files.

Tip

You can import several simulations at once, provided they belong to the same package.

Tip

If you have many simulations to import, especially if they are in different packages, it may be quicker to directly copy the files in the data/gatling/user-files/simulations folder.

Upload Resource Files

Some test simulation may require external files, for example CSV dataset or body contents.

Follow the documentation about files uploading and downloading to upload these in the resource files tree.