Skip to content

Commit

Permalink
feat: update gatling 3.11.4 (#5)
Browse files Browse the repository at this point in the history
* feat: update gatling 3.11.4

* feat: update gatling 3.11.4
  • Loading branch information
jigarkhwar authored Jun 26, 2024
1 parent d886f6f commit 38cfc29
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 18 deletions.
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sbt.*

object Dependencies {

val gatlingVersion = "3.10.5"
val gatlingVersion = "3.11.4"

lazy val gatlingCore: Seq[ModuleID] = Seq(
"io.gatling" % "gatling-core",
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# suppress inspection "UnusedProperty"
sbt.version=1.9.9
sbt.version=1.10.0
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import io.gatling.core.session.{Expression, Session}
import io.gatling.core.structure.ScenarioContext
import io.gatling.core.util.NameGen
import actions.{BatchAction, BatchInsertAction, BatchUpdateAction}
import io.gatling.core.stats.StatsEngine
import org.galaxio.gatling.jdbc.db._

final case class DBBatchAction(
Expand Down Expand Up @@ -80,7 +81,7 @@ final case class DBBatchAction(
))
.onFailure(m =>
batchName(session).map { rn =>
ctx.coreComponents.statsEngine.logCrash(session.scenario, session.groups, rn, m)
ctx.coreComponents.statsEngine.logRequestCrash(session.scenario, session.groups, rn, m)
executeNext(
session,
ctx.coreComponents.clock.nowMillis,
Expand All @@ -94,4 +95,6 @@ final case class DBBatchAction(
},
)
}

override def statsEngine: StatsEngine = ctx.coreComponents.statsEngine
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import io.gatling.commons.stats.{KO, OK}
import io.gatling.commons.validation._
import io.gatling.core.action.{Action, ChainableAction}
import io.gatling.core.session.{Expression, Session}
import io.gatling.core.stats.StatsEngine
import io.gatling.core.structure.ScenarioContext
import io.gatling.core.util.NameGen
import org.galaxio.gatling.jdbc.db.SQL
Expand Down Expand Up @@ -48,7 +49,7 @@ case class DBCallAction(
))
.onFailure(m =>
requestName(session).map { rn =>
ctx.coreComponents.statsEngine.logCrash(session.scenario, session.groups, rn, m)
ctx.coreComponents.statsEngine.logRequestCrash(session.scenario, session.groups, rn, m)
executeNext(
session,
ctx.coreComponents.clock.nowMillis,
Expand All @@ -62,4 +63,5 @@ case class DBCallAction(
},
)

override def statsEngine: StatsEngine = ctx.coreComponents.statsEngine
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import io.gatling.commons.stats.{KO, OK}
import io.gatling.commons.validation._
import io.gatling.core.action.{Action, ChainableAction}
import io.gatling.core.session.{Expression, Session}
import io.gatling.core.stats.StatsEngine
import io.gatling.core.structure.ScenarioContext
import io.gatling.core.util.NameGen
import org.galaxio.gatling.jdbc.db.SQL
Expand Down Expand Up @@ -39,7 +40,7 @@ case class DBInsertAction(
))
.onFailure(m =>
requestName(session).map { rn =>
ctx.coreComponents.statsEngine.logCrash(session.scenario, session.groups, rn, m)
ctx.coreComponents.statsEngine.logRequestCrash(session.scenario, session.groups, rn, m)
executeNext(
session,
ctx.coreComponents.clock.nowMillis,
Expand All @@ -53,4 +54,5 @@ case class DBInsertAction(
},
)

override def statsEngine: StatsEngine = ctx.coreComponents.statsEngine
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.gatling.commons.validation.{Failure => GFailure, _}
import io.gatling.core.action.{Action, ChainableAction}
import io.gatling.core.check.Check
import io.gatling.core.session.{Expression, Session}
import io.gatling.core.stats.StatsEngine
import io.gatling.core.structure.ScenarioContext
import io.gatling.core.util.NameGen
import org.galaxio.gatling.jdbc.db.SQL
Expand Down Expand Up @@ -72,7 +73,7 @@ case class DBQueryAction(
))
.onFailure(m =>
requestName(session).map { rn =>
ctx.coreComponents.statsEngine.logCrash(session.scenario, session.groups, rn, m)
ctx.coreComponents.statsEngine.logRequestCrash(session.scenario, session.groups, rn, m)
executeNext(
session,
ctx.coreComponents.clock.nowMillis,
Expand All @@ -85,4 +86,6 @@ case class DBQueryAction(
)
},
)

override def statsEngine: StatsEngine = ctx.coreComponents.statsEngine
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import io.gatling.commons.stats.{KO, OK}
import io.gatling.commons.validation._
import io.gatling.core.action.{Action, ChainableAction}
import io.gatling.core.session.{Expression, Session}
import io.gatling.core.stats.StatsEngine
import io.gatling.core.structure.ScenarioContext
import io.gatling.core.util.NameGen
import org.galaxio.gatling.jdbc.db.SQL
Expand Down Expand Up @@ -36,7 +37,7 @@ case class DBRawQueryAction(requestName: Expression[String], query: Expression[S
))
.onFailure(m =>
requestName(session).map { rn =>
ctx.coreComponents.statsEngine.logCrash(session.scenario, session.groups, rn, m)
ctx.coreComponents.statsEngine.logRequestCrash(session.scenario, session.groups, rn, m)
executeNext(
session,
ctx.coreComponents.clock.nowMillis,
Expand All @@ -49,4 +50,6 @@ case class DBRawQueryAction(requestName: Expression[String], query: Expression[S
)
},
)

override def statsEngine: StatsEngine = ctx.coreComponents.statsEngine
}
19 changes: 13 additions & 6 deletions src/test/java/org/galaxio/performance/GatlingRunner.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.galaxio.performance

import io.gatling.app.Gatling
import io.gatling.core.config.GatlingPropertiesBuilder
import org.galaxio.performance.jdbc.test.JdbcDebugTest;
import io.gatling.shared.cli.GatlingCliOptions
import org.galaxio.performance.jdbc.test.JdbcDebugTest

object GatlingRunner {

Expand All @@ -11,10 +11,17 @@ object GatlingRunner {
// this is where you specify the class you want to run
val simulationClass = classOf[JdbcDebugTest].getName

val props = new GatlingPropertiesBuilder
props.simulationClass(simulationClass)

Gatling.fromMap(props.build)
Gatling.main(
args ++
Array(
GatlingCliOptions.Simulation.shortOption,
simulationClass,
GatlingCliOptions.ResultsFolder.shortOption,
"results",
GatlingCliOptions.Launcher.shortOption,
"sbt",
),
)
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.galaxio.performance.jdbc.test

import io.gatling.app.Gatling
import io.gatling.core.config.GatlingPropertiesBuilder
import io.gatling.shared.cli.GatlingCliOptions

object GatlingRunner {

Expand All @@ -10,10 +10,17 @@ object GatlingRunner {
// this is where you specify the class you want to run
val simulationClass = classOf[DebugTest].getName

val props = new GatlingPropertiesBuilder
props.simulationClass(simulationClass)

Gatling.fromMap(props.build)
Gatling.main(
args ++
Array(
GatlingCliOptions.Simulation.shortOption,
simulationClass,
GatlingCliOptions.ResultsFolder.shortOption,
"results",
GatlingCliOptions.Launcher.shortOption,
"sbt",
),
)
}

}

0 comments on commit 38cfc29

Please sign in to comment.