PerformanceTestRunner

uk.gov.hmrc.performance.simulation.PerformanceTestRunner

Trait extending io.gatling.core.scenario.Simulation. Use within a performance test to set up Journeys and invoke runSimulation(), a method to configure the Simulation setup.

Attributes

Graph
Supertypes
trait JourneySetup
class Simulation
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

class SetUp()

Attributes

Inherited from:
Simulation
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def runSimulation(): Unit

Configures io.gatling.core.scenario.Simulation.setUp. This method is invoked from within a performance test.

Configures io.gatling.core.scenario.Simulation.setUp. This method is invoked from within a performance test.

For smoke tests i.e when uk.gov.hmrc.performance.conf.PerftestConfiguration.runSingleUserJourney`` istrue`, the setUp is configured to run only for 1 user.

For a full test, the setUp is configured with:

  • Journeys and the load to run
  • Duration of the run
  • Protocol configuration and
  • Assertions

Attributes

Inherited methods

def after(step: => Unit): Unit

Attributes

Inherited from:
Simulation
def before(step: => Unit): Unit

Attributes

Inherited from:
Simulation
def checkJourneyName(id: String): Any

Attributes

Inherited from:
JourneyConfiguration
def definitions(labels: Set[String]): Seq[JourneyDefinition]

Maps the journeys defined in journeys.conf to a Seq of uk.gov.hmrc.performance.conf.JourneyDefinition and returns the journeys to be executed based on the provided labels. The labels field is defined in application.conf.

Maps the journeys defined in journeys.conf to a Seq of uk.gov.hmrc.performance.conf.JourneyDefinition and returns the journeys to be executed based on the provided labels. The labels field is defined in application.conf.

Value parameters

labels

An optional parameter with a Set of labels for which the journeys should be executed.

Attributes

Returns

Seq of JourneyDefinition to be executed for the provided labels.

Inherited from:
JourneyConfiguration
def generateDescription(journeyDescription: String, runIf: Set[String], skipIf: Set[String]): String

Generates a new description for a journey based on the description, run-if, and skip-if fields in journeys.conf

Generates a new description for a journey based on the description, run-if, and skip-if fields in journeys.conf

Example:

For the below example journey in journey.conf:

hello-world-4 = {
 description = "Hello world journey 4"
 load = 0.1
 feeder = data/helloworld.csv
 parts = [
   home
 ]
 run-if = ["label-B"]
 skip-if = ["label-A", "label-C"]
}

the generated description would be:

Hello world journey 4 - runIf [label-B] and skipIf [label-A,label-C]

Value parameters

journeyDescription

Value from the description field of a journey in journeys.conf

runIf

Labels included in run-if field of a journey in journeys.conf

skipIf

Labels included in skip-if field of a journey in journeys.conf

Attributes

Returns

A new description based on the description and the labels

Inherited from:
JourneyConfiguration
def hasProperty(property: String): Boolean

Attributes

Inherited from:
Configuration
protected def journeys: Seq[Journey]

Builds uk.gov.hmrc.performance.simulation.Journey for each journey defined in journeys.conf

Builds uk.gov.hmrc.performance.simulation.Journey for each journey defined in journeys.conf

Attributes

Returns

a Seq of uk.gov.hmrc.performance.simulation.Journey for all the journeys defined in journeys.conf

Inherited from:
JourneySetup
def keys(property: String): List[String]

Attributes

Inherited from:
Configuration
def readProperty(property: String, default: String): String

Attributes

Inherited from:
Configuration
def readProperty(property: String): String

Attributes

Inherited from:
Configuration
def readPropertyBooleanOption(property: String): Option[Boolean]

Attributes

Inherited from:
Configuration
def readPropertyList(property: String): List[String]

Attributes

Inherited from:
Configuration
def readPropertyOption(property: String): Option[String]

Attributes

Inherited from:
Configuration
def readPropertySet(property: String): Set[String]

Attributes

Inherited from:
Configuration
def readPropertySetOrEmpty(property: String): Set[String]

Attributes

Inherited from:
Configuration
def setUp(populationBuilders: List[PopulationBuilder]): SetUp

Attributes

Inherited from:
Simulation
def setUp(populationBuilders: PopulationBuilder*): SetUp

Attributes

Inherited from:
Simulation
def setup(id: String, description: String): JourneyPart

Creates JourneyPart which allows to chain HttpRequestBuilder and ActionBuilder.

Creates JourneyPart which allows to chain HttpRequestBuilder and ActionBuilder.

Value parameters

description

description of the setup. This value is used in Gatling's scenario description which is surfaced in gatling report.

id

Unique identifier for the setup. This should match an entry in the parts provided in journeys.conf

Attributes

Returns

JourneyPart

Inherited from:
JourneySetup
protected def withInjectedLoad(journeys: Seq[Journey]): Seq[PopulationBuilder]

Calculates the load for the provided journeys and constructs the injection steps using Gatling's open injection model: https://gatling.io/docs/current/general/simulation_setup/#open-model.

Calculates the load for the provided journeys and constructs the injection steps using Gatling's open injection model: https://gatling.io/docs/current/general/simulation_setup/#open-model.

Value parameters

journeys

Seq of journeys as defined in journeys.conf

Attributes

Returns

Sequence of PopulationBuilder with calculated injection step injected into io.gatling.core.structure.ScenarioBuilder

Inherited from:
JourneySetup

Inherited fields

val allJourneys: List[String]

Attributes

Inherited from:
JourneyConfiguration
lazy val applicationConfig: Config

Attributes

Inherited from:
Configuration
lazy val constantRateTime: FiniteDuration

Attributes

Inherited from:
PerftestConfiguration
val httpProtocol: HttpProtocolBuilder

Provides a HttpProtocolBuilder with preset configuration. This configures the HTTP protocol used in Gatling simulation.

Provides a HttpProtocolBuilder with preset configuration. This configures the HTTP protocol used in Gatling simulation.

https://gatling.io/docs/3.4/http/http_protocol/

Configurations to note:

True-Client-IP: Set to java.util.Random() value injected in the Gatling session during JourneySetup.journeys. This value can be used to trace requests injected through the performance-test-runner library.

disableFollowRedirect: Disables Gatling from following redirect automatically.This means the users of the library should make explicit redirect requests. https://gatling.io/docs/3.4/http/http_protocol/#response-handling-parameters

Users of the library can override this default configuration by overriding val httpProtocol when extending PerformanceTestRunner trait.

Attributes

Inherited from:
HttpConfiguration
val journeysAvailable: List[String]

Attributes

Inherited from:
JourneyConfiguration
lazy val labels: Set[String]

Attributes

Inherited from:
PerftestConfiguration
lazy val loadFactor: Double

Attributes

Inherited from:
PerftestConfiguration
lazy val loadPercentage: Int

Attributes

Inherited from:
PerftestConfiguration
val noLoad: Double

Attributes

Inherited from:
PerftestConfiguration

Attributes

Inherited from:
PerftestConfiguration
lazy val rampDownTime: FiniteDuration

Attributes

Inherited from:
PerftestConfiguration
lazy val rampUpTime: FiniteDuration

Attributes

Inherited from:
PerftestConfiguration

Attributes

Inherited from:
PerftestConfiguration
lazy val runLocal: Boolean

Attributes

Inherited from:
Configuration
lazy val runSingleUserJourney: Boolean

Attributes

Inherited from:
PerftestConfiguration