From 8a6f5abfc14f3a6d2d7d04f09c93a1784f865f49 Mon Sep 17 00:00:00 2001 From: Richie Wang Date: Wed, 5 Sep 2018 16:00:28 -0700 Subject: [PATCH] change gatling adapters to use DI instead of directly calling measurement controllers --- .../com/workday/warp/adapters/gatling/WarpFunSpec.scala | 5 +++-- .../com/workday/warp/adapters/gatling/WarpSimulation.scala | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/scala/com/workday/warp/adapters/gatling/WarpFunSpec.scala b/src/main/scala/com/workday/warp/adapters/gatling/WarpFunSpec.scala index 69ce4b43..2e2cb9d3 100644 --- a/src/main/scala/com/workday/warp/adapters/gatling/WarpFunSpec.scala +++ b/src/main/scala/com/workday/warp/adapters/gatling/WarpFunSpec.scala @@ -1,8 +1,9 @@ package com.workday.warp.adapters.gatling import com.workday.warp.adapters.gatling.traits.{HasDefaultTestName, HasWarpHooks} -import com.workday.warp.collectors.{AbstractMeasurementCollectionController, DefaultMeasurementCollectionController} +import com.workday.warp.collectors.AbstractMeasurementCollectionController import com.workday.warp.common.CoreConstants.{UNDEFINED_TEST_ID => DEFAULT_TEST_ID} +import com.workday.warp.inject.WarpGuicer import io.gatling.http.funspec.GatlingHttpFunSpec /** @@ -14,7 +15,7 @@ abstract class WarpFunSpec(val testId: String) extends GatlingHttpFunSpec with H def this() = this(DEFAULT_TEST_ID) - val controller: AbstractMeasurementCollectionController = new DefaultMeasurementCollectionController(this.canonicalName) + val controller: AbstractMeasurementCollectionController = WarpGuicer.getController(this.canonicalName, tags = List.empty) before { beforeStart() diff --git a/src/main/scala/com/workday/warp/adapters/gatling/WarpSimulation.scala b/src/main/scala/com/workday/warp/adapters/gatling/WarpSimulation.scala index 0516c3e8..fae9630c 100644 --- a/src/main/scala/com/workday/warp/adapters/gatling/WarpSimulation.scala +++ b/src/main/scala/com/workday/warp/adapters/gatling/WarpSimulation.scala @@ -1,8 +1,9 @@ package com.workday.warp.adapters.gatling import com.workday.warp.adapters.gatling.traits.{HasDefaultTestName, HasWarpHooks} -import com.workday.warp.collectors.{AbstractMeasurementCollectionController, DefaultMeasurementCollectionController} +import com.workday.warp.collectors.AbstractMeasurementCollectionController import com.workday.warp.common.CoreConstants.{UNDEFINED_TEST_ID => DEFAULT_TEST_ID} +import com.workday.warp.inject.WarpGuicer import io.gatling.core.Predef.Simulation /** @@ -14,7 +15,7 @@ abstract class WarpSimulation(val testId: String) extends Simulation with HasDef def this() = this(DEFAULT_TEST_ID) - val controller: AbstractMeasurementCollectionController = new DefaultMeasurementCollectionController(this.canonicalName) + val controller: AbstractMeasurementCollectionController = WarpGuicer.getController(this.testId, tags = List.empty) before { beforeStart()