Measuring Gatling Simulations

“warp-core-gatling” is published as a separate jar and includes a base class “WarpSimulation” that add warp measurements to existing simulations as before/after gatling hooks. This module also includes a (now deprecated) vintage JUnit4 runner that allows for easily executing gatling simulations along with the rest of your JUnit test suite. In the future, we plan to develop a tighter integration between gatling and JUnit5

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import com.workday.warp.adapters.gatling.{GatlingJUnitRunner, WarpSimulation}

@RunWith(classOf[GatlingJUnitRunner])
class BasicSimulation extends WarpSimulation {
  val httpConf: HttpProtocolBuilder = http
    .baseUrl("http://google.com")

  val scn: ScenarioBuilder = scenario("Positive Scenario")
    .exec(
      http("request_1").get("/")
    )

  setUp(scn.inject(atOnceUsers(1)).protocols(httpConf))
}