Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JmapGetMailboxesHugeNumberScenario #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import scala.util.Success
class UserCreator(val baseJamesWebAdministrationUrl: URL) {
private val jamesWebAdministration = new JamesWebAdministration(baseJamesWebAdministrationUrl)

def createUsersWithInboxAndOutbox(userCount: Int): Seq[Future[User]] =
def createUsersWithSystemMailboxes(userCount: Int): Seq[Future[User]] =
createUsers(userCount)
.map(userFuture => userFuture.andThen {
case Success(user) => registerSystemMailboxes(user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ object JmapMailboxes {

def getSystemMailboxes = getMailboxes

def getMailboxesWithRetryAuthentication(expectedNumberOfMailboxes: Int) =
execWithRetryAuthentication(getMailboxes, getMailboxesChecks(expectedNumberOfMailboxes))

def getSystemMailboxesWithRetryAuthentication = execWithRetryAuthentication(getSystemMailboxes, getSystemMailboxesChecks)

def getSystemMailboxesWithChecks = getSystemMailboxes.check(getSystemMailboxesChecks: _*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import scala.concurrent.duration._
class JmapAllScenario extends Simulation {
private val loopVariableName = "any"

val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)
val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)

val scn = scenario("JmapAllScenarios")
.exec(CommonSteps.provisionSystemMailboxes(users))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.apache.james.gatling.jmap.scenari.common.Configuration._
class JmapAuthenticationScenario extends Simulation {

val scn = scenario("JmapAuthentication")
.exec(CommonSteps.authentication(new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)))
.exec(CommonSteps.authentication(new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)))

setUp(scn.inject(atOnceUsers(UserCount))).protocols(HttpSettings.httpProtocol)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import org.apache.james.gatling.jmap.Name
*/
class JmapBigSetScenario extends Simulation {

val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)
val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)

val scn = scenario("JMAP scenario on multiple mailboxes containing multiple messages")
.exec(CommonSteps.provisionUsersWithMailboxesAndMessages(users, NumberOfMailboxes, NumberOfMessages))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.apache.james.gatling.jmap.scenari

import io.gatling.core.Predef._
import org.apache.james.gatling.control.UserCreator
import org.apache.james.gatling.jmap.JmapMailboxes
import org.apache.james.gatling.jmap.scenari.common.Configuration._
import org.apache.james.gatling.jmap.scenari.common.{CommonSteps, HttpSettings}

import scala.concurrent.duration._

class JmapGetMailboxesHugeNumberScenario extends Simulation {
val userNumber = 2
val mailboxesNumber = 2000
val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(userNumber)

val scn = scenario("JmapGetMailboxesHugeNumber")
.exec(CommonSteps.provisionUsersWithMailboxesAndMessages(users, mailboxesNumber, 1))
.during(ScenarioDuration) {
JmapMailboxes.getMailboxesWithRetryAuthentication(mailboxesNumber + 3)
.pause(1 second , 2 seconds)
}

setUp(scn.inject(atOnceUsers(userNumber))).protocols(HttpSettings.httpProtocol)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import scala.concurrent.duration._
class JmapGetMailboxesScenario extends Simulation {

val scn = scenario("JmapGetMailboxes")
.exec(CommonSteps.authentication(new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)))
.exec(CommonSteps.authentication(new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)))
.during(ScenarioDuration) {
JmapMailboxes.getSystemMailboxesWithRetryAuthentication
.pause(1 second , 2 seconds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.apache.james.gatling.utils.RetryAuthentication._

class JmapGetMessageListScenario extends Simulation {

val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)
val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)

val scn = scenario("JmapGetMessagesLists")
.exec(CommonSteps.provisionUsersWithMessages(users))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.apache.james.gatling.utils.RetryAuthentication._

class JmapGetMessagesScenario extends Simulation {

val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)
val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)

val scn = scenario("JmapGetMessages")
.exec(CommonSteps.provisionUsersWithMessageList(users))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import scala.concurrent.duration._

class JmapMessageUpdateScenario extends Simulation {

val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)
val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)

val scn = scenario("JmapUpdateMessages")
.exec(CommonSteps.provisionUsersWithMessageList(users))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import scala.concurrent.duration._

class JmapQueueBrowseScenario extends Simulation {

val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)
val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)

val webAdmin = new JamesWebAdministrationQuery(BaseJamesWebAdministrationUrl)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import scala.concurrent.duration._

class JmapSendMessagesScenario extends Simulation {

val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)
val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)

val scn = scenario("JmapSendMessages")
.exec(CommonSteps.provisionSystemMailboxes(users))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NoAuthenticationNoEncryptionBigBodyScenario extends Simulation {
def generateMessage() : String =
myRandom.grouped(200).flatMap(_.append(Stream('\r', '\n'))).take(1024 * 1024).mkString

private val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)
private val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)

private val scn = scenario("SMTP_No_Authentication_No_Encryption_Big_Body")
.feed(UserFeeder.createCompletedUserFeederWithInboxAndOutbox(users))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import scala.concurrent.duration._

class NoAuthenticationNoEncryptionScenario extends Simulation {

val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount)
val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount)

val scn = scenario("SMTP_No_Authentication_No_Encryption")
.feed(UserFeeder.createCompletedUserFeederWithInboxAndOutbox(users))
Expand Down