Skip to content

Commit 8a6f5ab

Browse files
committed
change gatling adapters to use DI instead of directly calling
measurement controllers
1 parent 1a671b9 commit 8a6f5ab

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/main/scala/com/workday/warp/adapters/gatling/WarpFunSpec.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package com.workday.warp.adapters.gatling
22

33
import com.workday.warp.adapters.gatling.traits.{HasDefaultTestName, HasWarpHooks}
4-
import com.workday.warp.collectors.{AbstractMeasurementCollectionController, DefaultMeasurementCollectionController}
4+
import com.workday.warp.collectors.AbstractMeasurementCollectionController
55
import com.workday.warp.common.CoreConstants.{UNDEFINED_TEST_ID => DEFAULT_TEST_ID}
6+
import com.workday.warp.inject.WarpGuicer
67
import io.gatling.http.funspec.GatlingHttpFunSpec
78

89
/**
@@ -14,7 +15,7 @@ abstract class WarpFunSpec(val testId: String) extends GatlingHttpFunSpec with H
1415

1516
def this() = this(DEFAULT_TEST_ID)
1617

17-
val controller: AbstractMeasurementCollectionController = new DefaultMeasurementCollectionController(this.canonicalName)
18+
val controller: AbstractMeasurementCollectionController = WarpGuicer.getController(this.canonicalName, tags = List.empty)
1819

1920
before {
2021
beforeStart()

src/main/scala/com/workday/warp/adapters/gatling/WarpSimulation.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package com.workday.warp.adapters.gatling
22

33
import com.workday.warp.adapters.gatling.traits.{HasDefaultTestName, HasWarpHooks}
4-
import com.workday.warp.collectors.{AbstractMeasurementCollectionController, DefaultMeasurementCollectionController}
4+
import com.workday.warp.collectors.AbstractMeasurementCollectionController
55
import com.workday.warp.common.CoreConstants.{UNDEFINED_TEST_ID => DEFAULT_TEST_ID}
6+
import com.workday.warp.inject.WarpGuicer
67
import io.gatling.core.Predef.Simulation
78

89
/**
@@ -14,7 +15,7 @@ abstract class WarpSimulation(val testId: String) extends Simulation with HasDef
1415

1516
def this() = this(DEFAULT_TEST_ID)
1617

17-
val controller: AbstractMeasurementCollectionController = new DefaultMeasurementCollectionController(this.canonicalName)
18+
val controller: AbstractMeasurementCollectionController = WarpGuicer.getController(this.testId, tags = List.empty)
1819

1920
before {
2021
beforeStart()

0 commit comments

Comments
 (0)