adding new simulation
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/1b408c19 Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1b408c19 Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1b408c19 Branch: refs/heads/two-dot-o Commit: 1b408c19209e24741a0a5daeb3849a6e8723e0a2 Parents: cb43d81 Author: Shawn Feldman <[email protected]> Authored: Wed Nov 5 17:24:02 2014 -0700 Committer: Shawn Feldman <[email protected]> Committed: Wed Nov 5 17:24:02 2014 -0700 ---------------------------------------------------------------------- stack/loadtests/pom.xml | 2 +- .../usergrid/simulations/AppSimulation.scala | 48 ++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1b408c19/stack/loadtests/pom.xml ---------------------------------------------------------------------- diff --git a/stack/loadtests/pom.xml b/stack/loadtests/pom.xml index 1e5972b..363cfbc 100644 --- a/stack/loadtests/pom.xml +++ b/stack/loadtests/pom.xml @@ -148,7 +148,7 @@ <artifactId>gatling-maven-plugin</artifactId> <configuration> <simulationsFolder>src/main/scala</simulationsFolder> - <simulationClass>org.apache.usergrid.simulations.PushNotificationTargetUserSimulation</simulationClass> + <simulationClass>org.apache.usergrid.simulations.AppSimulation</simulationClass> <propagateSystemProperties>true</propagateSystemProperties> </configuration> http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1b408c19/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AppSimulation.scala ---------------------------------------------------------------------- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AppSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AppSimulation.scala new file mode 100644 index 0000000..6567c91 --- /dev/null +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AppSimulation.scala @@ -0,0 +1,48 @@ +/* + * + * * Licensed to the Apache Software Foundation (ASF) under one or more + * * contributor license agreements. The ASF licenses this file to You + * * under the Apache License, Version 2.0 (the "License"); you may not + * * use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. For additional information regarding + * * copyright in this work, please see the NOTICE file in the top level + * * directory of this distribution. + * + */ + +package org.apache.usergrid.simulations + +import io.gatling.core.Predef._ +import io.gatling.core.scenario.Simulation +import org.apache.usergrid.helpers.Setup +import org.apache.usergrid.scenarios.NotificationScenarios +import org.apache.usergrid.settings.Settings +import scala.concurrent.duration._ + +/** + * Classy class class. + */ +class AppSimulation extends Simulation{ + before{ + Setup.setupOrg() + Setup.setupApplication() + Setup.setupNotifier() + Setup.setupUsers() + } + setUp( + NotificationScenarios.createScenario + .inject(constantUsersPerSec(Settings.constantUsers) during (Settings.duration)) // wait for 15 seconds so create org can finish, need to figure out coordination + .throttle(reachRps(Settings.throttle) in ( Settings.rampTime.seconds)) + .protocols( Settings.httpConf.acceptHeader("application/json")) + ) + + +}
