Skip to content

An extension for gatling-app to run a gatling scenario as a task and create custom launcher/integration for other system

License

Notifications You must be signed in to change notification settings

mperever/gatling-app-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gatling Task Extension

Build Status

What is it?

Task extension for Gatling to create custom launcher/integration for other system. Gatling pull request The purpose is to create task to run Gatling and get run result object after execution instead of execution status code. Furthermore that extension provides facilities to get requests statistics from simulation log file.

Creating a Gatling Task

Creating a task from Gatling configuration parameters:

    val gatlingOverrides: ConfigOverrides = ...
    val task: GatlingTask = new GatlingTask(gatlingOverrides)

Creating a task from simulation class:

    val task: GatlingTask = new GatlingTask(classOf[MySimulation])

Creating a task using task builder:

    val someSimulationConfig: Config = ConfigFactory.parseString("{\"baseUrl\":\"localhost\",\"usersCount\":\"10\"}")
    val task: GatlingTask = new GatlingTaskBuilder(classOf[MySimulation])
        .resultsDirectory("custom_result_directory")
        .simulationConfig(someSimulationConfig, "simulationConfig.json")
      .build()

Run a Gatling Task

GatlingTask class implements Callable interface.

    ...
    val result: GatlingRunResult = task.call()

Getting requests statistics from simulation log file

By default simulation log file is generated automatically after each Gatling run.

    ...
    val result: GatlingRunResult = task.call()

    val logReader: RunResultFileReader = new RunResultFileReader(result.runResult, task.gatlingOverrides)
    val startTime: Long = logReader.runStart()
    val endTime: Long = logReader.runEnd()
    val requestsStats: List[RequestStats] = logReader.computeRequestsStats()
	val assertionsResults: List[AssertionResult] = logReader.assertionResults()

About

An extension for gatling-app to run a gatling scenario as a task and create custom launcher/integration for other system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages