Chain Builder Class in Gatling

what is the use of ChainBuilder Class in gatling, can someone help me to understand this code, i am new for gatling

class TenantSimulation extends BasicSimulation {

  // Call When Multiple Chains need to connect
  def getChainBuilder: ChainBuilder = {



  private def getTenantInfo(): ChainBuilder = {

      .get(BASE_PATH + "/ABC" + "/XYZ")


  private def getTenantsConfig(): ChainBuilder = {

      .get(BASE_PATH + "/ABC/PQR")


  private def getTenants(): ChainBuilder = {



The Gatling DSL is a series of commands that are all . . . Chained . . . together as a series of calls, each call being made on the return value of the last one. You may have heard of Method Chaining. If not, I suggest you google it.

A ChainBuilder is the basic class out of which the DSL is built. If you have a ChainBuilder object, you can chain additional calls to it like you do normal Gatling DSL, same as you would if you had a .exec( something ) command in your test.

Thanks john for the quick reply, explanation is really helpful for the basic understanding for me.