From 989d8b98fb2079e4a7fec203725c60794053a174 Mon Sep 17 00:00:00 2001 From: Raphael Ouazana Date: Mon, 7 Dec 2020 11:16:42 +0100 Subject: [PATCH] Uniformize env and configuration with openpaas-gatling --- README.adoc | 8 ++++++++ .../gatling/simulation/Configuration.scala | 18 +++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.adoc b/README.adoc index 38cfab3d..ce4c6aa8 100644 --- a/README.adoc +++ b/README.adoc @@ -20,6 +20,14 @@ In some cases you could want to specify target hostname per protocol, the follow * `IMAP_SERVER_HOSTNAME` which is set to `TARGET_HOSTNAME` by default * `WEBADMIN_SERVER_HOSTNAME` which is set to `TARGET_HOSTNAME` by default +You can also customize the sizing of the scenarios: + * `INJECT_DURATION` is the ramp up time, set to `10` seconds by default + * `SCENARIO_DURATION` is the effective scenario duration, set to `10` seconds by default + * `USER_COUNT` is the number of users, set to `100` by default + * `RANDOMLY_SENT_MAILS` is the numbers of emails sent by user during the provisioning, `10` by default + * `NUMBER_OF_MAILBOXES` is the numbers of mailboxes created during the provisioning, `10` by default + * `NUMBER_OF_MESSAGES` is the numbers of messages created per mailbox during the provisioning, `20` by default + You can run all the simulations via sbt : .bash diff --git a/src/test/scala-2.12/org/apache/james/gatling/simulation/Configuration.scala b/src/test/scala-2.12/org/apache/james/gatling/simulation/Configuration.scala index 259d1f36..980c6643 100644 --- a/src/test/scala-2.12/org/apache/james/gatling/simulation/Configuration.scala +++ b/src/test/scala-2.12/org/apache/james/gatling/simulation/Configuration.scala @@ -20,16 +20,12 @@ object Configuration { val WEBADMIN_PROTOCOL = Properties.envOrElse("WEBADMIN_PROTOCOL", "http") val BaseJamesWebAdministrationUrl = new URL(s"$WEBADMIN_PROTOCOL://$WebadminServerHostName:$WEBADMIN_PORT") - val DURATION_PROPERTY = Properties.envOrNone("DURATION") match { - case Some(duration) => Some(duration.toInt minutes) - case _ => None - } - - val ScenarioDuration = DURATION_PROPERTY.getOrElse(1 hour) - val InjectionDuration = DURATION_PROPERTY.getOrElse(1 hour) - val UserCount = 100 - val RandomlySentMails = 10 - val NumberOfMailboxes = 10 - val NumberOfMessages = 20 + val InjectDuration = Properties.envOrElse("INJECT_DURATION", "10").toInt seconds + val ScenarioDuration = Properties.envOrElse("SCENARIO_DURATION", "10").toInt seconds + + val UserCount = Properties.envOrElse("USER_COUNT", "100").toInt + val RandomlySentMails = Properties.envOrElse("RANDOMLY_SENT_MAILS", "10").toInt + val NumberOfMailboxes = Properties.envOrElse("NUMBER_OF_MAILBOXES", "10").toInt + val NumberOfMessages = Properties.envOrElse("NUMBER_OF_MESSAGES", "20").toInt }