usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [01/21] incubator-usergrid git commit: USERGRID-871: refactor Gatling load testing code
Date Mon, 03 Aug 2015 20:30:45 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-dev 151527f63 -> c99fe385f


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
deleted file mode 100644
index 6a55ace..0000000
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- */
-package org.apache.usergrid.simulations
-
-import com.ning.http.client.AsyncHttpClient
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import org.apache.usergrid.scenarios._
-import org.apache.usergrid.settings.Settings
-import scala.concurrent.duration._
-import org.apache.usergrid.helpers.Setup
-
-class PushNotificationTargetUserSimulation extends Simulation {
-
-
-  before{
-    Setup.setupOrg()
-    Setup.setupApplication()
-    Setup.setupNotifier()
-    Setup.setupUsers()
-  }
-  setUp(
-    NotificationScenarios.createScenario
-      .inject(
-        rampUsers(Settings.maxPossibleUsers) over Settings.rampTime,
-        constantUsersPerSec(Settings.maxPossibleUsers) during Settings.duration)
-      .protocols( Settings.httpConf.acceptHeader("application/json"))
-  )
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutCustomEntitySimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutCustomEntitySimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutCustomEntitySimulation.scala
deleted file mode 100644
index 2b129fc..0000000
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutCustomEntitySimulation.scala
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  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.
- */
-
-package org.apache.usergrid.simulations
-
-import io.gatling.core.Predef._
-import io.gatling.core.scenario.Simulation
-import org.apache.usergrid.datagenerators.FeederGenerator
-import org.apache.usergrid.scenarios.EntityScenarios
-import org.apache.usergrid.settings.Settings
-
-/**
- * PostCustomEntitySimulation - creates lots of custom entities
- *
- * Run this way:
- * mvn gatling:execute -DrampTime=10 -DmaxPossibleUsers=10 -Dduration=120 -Dorg=yourorgname
-Dapp=sandbox -Dbaseurl=https://api.usergrid.com -DadminUser=yourusername -DadminPassword='yourpassword'
-Dgatling.simulationClass=org.apache.usergrid.simulations.PostCustomEntitySimulation -DcollectionType=yourcollection
- *
- *
- */
-class PutCustomEntitySimulation extends Simulation {
-
-  if(!Settings.skipSetup) {
-    println("Begin setup")
-    println("These aren't the droids you are looking for...")
-    //exec(TokenScenarios.getManagementToken)
-    println("End Setup")
-  }else{
-    println("Skipping Setup")
-  }
-
-  val numEntities:Int = Settings.numEntities
-  val collectionType = Settings.collectionType
-  println("collection type = " + collectionType)
-  val rampTime:Int = Settings.rampTime
-  val throttle:Int = Settings.throttle
-  val feeder = FeederGenerator.generateCustomEntityPutInfinite(0)
-  val httpConf = Settings.httpConf
-
-  val scnToRun = scenario("PUT custom entities")
-    .feed(feeder)
-    .exec(EntityScenarios.putEntity)
-
-  /*
-  val scnToRun = scenario("POST custom entities")
-    .feed(feeder)
-    .doIfOrElse(session => session("token").as[String].nonEmpty(session)) {
-      exec(EntityScenarios.postEntityWithToken)
-    } {
-      exec(EntityScenarios.postEntity)
-    }
-*/
-
-
-  setUp(scnToRun.inject(
-    rampUsers(Settings.maxPossibleUsers) over Settings.rampTime,
-    constantUsersPerSec(Settings.maxPossibleUsers) during Settings.duration
-  ).protocols(httpConf)).maxDuration(Settings.duration)
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutUsersSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutUsersSimulation.scala
deleted file mode 100644
index f89952c..0000000
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutUsersSimulation.scala
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- *  * 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.UserScenarios
-import org.apache.usergrid.settings.Settings
-
-/**
- * PUTS application users continually to an application.  Expects the following parameters
- *
- * -DmaxPossibleUsers : The maximum number of users to be making requests as fast as possible.
 Think of this as conccurrent users in the system
- * -DrampTime: The amount of time (in seconds) to allow for maxPossibleUsers to be reached.
 This will add new users linearlly
- * -Dduration: The amount of time (in seconds) to continue to perform requests up with the
maxPossibleUsers
- */
-class PutUsersSimulation extends Simulation {
-
-  println("Begin setup")
-  Setup.setupOrg()
-  Setup.setupApplication()
-  println("End Setup")
-
-
-  setUp(
-    UserScenarios.putUsersInfinitely
-      .inject(
-        /**
-         * injection steps take from this forum post
-         * https://groups.google.com/forum/#!topic/gatling/JfYHaWCbA-w
-         */
-        rampUsers(Settings.maxPossibleUsers) over Settings.rampTime,
-        constantUsersPerSec(Settings.maxPossibleUsers) during Settings.duration
-
-      )).protocols(Settings.httpConf.acceptHeader("application/json"))
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/SetupSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/SetupSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/SetupSimulation.scala
deleted file mode 100644
index 567a510..0000000
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/SetupSimulation.scala
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- *  * 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 org.apache.usergrid.helpers.Setup
-import org.apache.usergrid.scenarios.{UserScenarios}
-import org.apache.usergrid.settings.Settings
-import scala.concurrent.duration._
-
-/**
- * Classy class class.
- */
-class SetupSimulation extends Simulation{
-
-  println("Begin setup")
-  Setup.setupOrg()
-  Setup.setupApplication()
-  Setup.setupNotifier()
-  println("End Setup")
-
-  setUp(
-    UserScenarios.createUsersWithDevicesScenario
-      .inject(splitUsers(Settings.maxPossibleUsers) into( rampUsers(10) over (10 seconds))
separatedBy (10 seconds))
-      .protocols(Settings.httpConf.acceptHeader("application/json"))
-  )
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/AppSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/AppSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/AppSimulation.scala
new file mode 100644
index 0000000..7f1af08
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/AppSimulation.scala
@@ -0,0 +1,44 @@
+/*
+ *
+ *  * 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.deprecated
+
+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 {
+  println("Begin setup")
+  Setup.setupNotifier()
+  println("End Setup")
+
+  setUp(
+    NotificationScenarios.createScenario
+      .inject(constantUsersPerSec(Settings.constantUsersPerSec) during (Settings.constantUsersDuration))
+      .protocols(Settings.httpConf.acceptHeader("application/json"))
+  ).throttle(reachRps(Settings.throttle) in (Settings.rampTime seconds), holdFor(Settings.holdDuration))
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/ConnectionsSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/ConnectionsSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/ConnectionsSimulation.scala
new file mode 100644
index 0000000..8e3cd57
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/ConnectionsSimulation.scala
@@ -0,0 +1,54 @@
+/*
+ *
+ *  * 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.deprecated
+
+import io.gatling.core.Predef._
+import io.gatling.core.scenario.Simulation
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.ConnectionScenarios
+import org.apache.usergrid.settings.Settings
+
+import scala.concurrent.duration._
+
+/**
+ * Classy class class.
+ */
+class ConnectionsSimulation extends Simulation{
+
+  if(!Settings.skipSetup) {
+    println("Begin setup")
+    Setup.setupOrg()
+    Setup.setupApplication()
+    Setup.setupNotifier()
+    Setup.setupUsers()
+    println("End Setup")
+  }else{
+    println("Skipping Setup")
+  }
+
+  setUp(
+    ConnectionScenarios.createScenario
+      .inject(constantUsersPerSec(Settings.constantUsersPerSec) during Settings.constantUsersDuration)
// 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"))
+  )
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/DeleteUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/DeleteUsersSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/DeleteUsersSimulation.scala
new file mode 100644
index 0000000..444f67a
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/DeleteUsersSimulation.scala
@@ -0,0 +1,56 @@
+/*
+ *
+ *  * 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.deprecated
+
+import io.gatling.core.Predef._
+import io.gatling.core.scenario.Simulation
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * Deletes application users continually to an application.  Expects the following parameters
+ *
+ * -DmaxPossibleUsers : The maximum number of users to be making requests as fast as possible.
 Think of this as conccurrent users in the system
+ * -DrampTime: The amount of time (in seconds) to allow for maxPossibleUsers to be reached.
 This will add new users linearlly
+ * -Dduration: The amount of time (in seconds) to continue to perform requests up with the
maxPossibleUsers
+ */
+class DeleteUsersSimulation extends Simulation {
+
+  println("Begin setup")
+  Setup.setupOrg()
+  Setup.setupApplication()
+  println("End Setup")
+
+
+  setUp(
+    UserScenarios.deleteUsersInfinitely
+      .inject(
+        /**
+         * injection steps take from this forum post
+         * https://groups.google.com/forum/#!topic/gatling/JfYHaWCbA-w
+         */
+        rampUsers(Settings.rampUsers) over Settings.rampTime,
+        constantUsersPerSec(Settings.constantUsersPerSec) during Settings.constantUsersDuration
+
+      )).protocols(Settings.httpConf.acceptHeader("application/json"))
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetEntitySimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetEntitySimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetEntitySimulation.scala
new file mode 100644
index 0000000..4f160c9
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetEntitySimulation.scala
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ */
+ package org.apache.usergrid.simulations.deprecated
+
+import io.gatling.core.Predef._
+import org.apache.usergrid.datagenerators.FeederGenerator
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+import scala.concurrent.duration._
+
+class GetEntitySimulation extends Simulation {
+
+  // Target settings
+  val httpConf = Settings.httpConf
+
+  // Simulation settings
+  val numUsers:Int = Settings.rampUsers
+  val numEntities:Int = Settings.numEntities
+  val rampTime:Int = Settings.rampTime
+  val throttle:Int = Settings.throttle
+
+  val feeder = FeederGenerator.generateEntityNameFeeder("user", numEntities)
+
+  val scnToRun = scenario("GET entity")
+    .exec(UserScenarios.getRandomUser)
+
+  setUp(scnToRun.inject(atOnceUsers(numUsers)).throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf)).maxDuration(Settings.holdDuration)
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetUserPagesSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetUserPagesSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetUserPagesSimulation.scala
new file mode 100755
index 0000000..c4fadc0
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetUserPagesSimulation.scala
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ */
+package org.apache.usergrid.simulations.deprecated
+
+import io.gatling.core.Predef._
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * Posts application users continually to an application.  Expects the following parameters
+ *
+ * -DmaxPossibleUsers : The maximum number of users to be making requests as fast as possible.
 Think of this as conccurrent users in the system
+ * -DrampTime: The amount of time (in seconds) to allow for maxPossibleUsers to be reached.
 This will add new users linearlly
+ * -Dduration: The amount of time (in seconds) to continue to perform requests up with the
maxPossibleUsers
+ */
+class GetUserPagesSimulation extends Simulation {
+
+  println("Begin setup")
+  Setup.setupOrg()
+  Setup.setupApplication()
+  println("End Setup")
+
+
+  setUp(
+    UserScenarios.getUserPagesToEnd
+      .inject(
+        /**
+         * injection steps take from this forum post
+         * https://groups.google.com/forum/#!topic/gatling/JfYHaWCbA-w
+         */
+        rampUsers(Settings.rampUsers) over Settings.rampTime,
+        constantUsersPerSec(Settings.constantUsersPerSec) during Settings.constantUsersDuration
+
+      )).protocols(Settings.httpConf.acceptHeader("application/json"))
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetUsersSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetUsersSimulation.scala
new file mode 100755
index 0000000..5077fe9
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/GetUsersSimulation.scala
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ */
+package org.apache.usergrid.simulations.deprecated
+
+import io.gatling.core.Predef._
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * Posts application users continually to an application.  Expects the following parameters
+ *
+ * -DmaxPossibleUsers : The maximum number of users to be making requests as fast as possible.
 Think of this as conccurrent users in the system
+ * -DrampTime: The amount of time (in seconds) to allow for maxPossibleUsers to be reached.
 This will add new users linearlly
+ * -Dduration: The amount of time (in seconds) to continue to perform requests up with the
maxPossibleUsers
+ */
+class GetUsersSimulation extends Simulation {
+
+  println("Begin setup")
+  Setup.setupOrg()
+  Setup.setupApplication()
+  println("End Setup")
+
+
+  setUp(
+    UserScenarios.getUsersByUsername
+      .inject(
+        /**
+         * injection steps take from this forum post
+         * https://groups.google.com/forum/#!topic/gatling/JfYHaWCbA-w
+         */
+        rampUsers(Settings.rampUsers) over Settings.rampTime,
+        constantUsersPerSec(Settings.constantUsersPerSec) during Settings.constantUsersDuration
+
+      )).protocols(Settings.httpConf.acceptHeader("application/json"))
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PostCustomEntitySimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PostCustomEntitySimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PostCustomEntitySimulation.scala
new file mode 100644
index 0000000..9369489
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PostCustomEntitySimulation.scala
@@ -0,0 +1,76 @@
+/*
+ *
+ *  * 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.deprecated
+
+import io.gatling.core.Predef._
+import io.gatling.core.scenario.Simulation
+import org.apache.usergrid.datagenerators.FeederGenerator
+import org.apache.usergrid.scenarios.EntityScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * PostCustomEntitySimulation - creates lots of custom entities
+ *
+ * Run this way:
+ * mvn gatling:execute -DrampTime=10 -DmaxPossibleUsers=10 -Dduration=120 -Dorg=yourorgname
-Dapp=sandbox -Dbaseurl=https://api.usergrid.com -DadminUser=yourusername -DadminPassword='yourpassword'
-Dgatling.simulationClass=org.apache.usergrid.simulations.deprecated.PostCustomEntitySimulation
-DcollectionType=yourcollection
+ *
+ *
+ */
+class PostCustomEntitySimulation extends Simulation {
+
+  if(!Settings.skipSetup) {
+    println("Begin setup")
+    println("These aren't the droids you are looking for...")
+    //exec(TokenScenarios.getManagementToken)
+    println("End Setup")
+  }else{
+    println("Skipping Setup")
+  }
+
+  val numEntities:Int = Settings.numEntities
+  val collectionType = Settings.collectionType
+  println("collection type = " + collectionType)
+  val rampTime:Int = Settings.rampTime
+  val throttle:Int = Settings.throttle
+  val feeder = FeederGenerator.generateCustomEntityInfinite(0)
+  val httpConf = Settings.httpConf
+
+  val scnToRun = scenario("POST custom entities")
+    .feed(feeder)
+    .exec(EntityScenarios.postEntity)
+
+  /*
+  val scnToRun = scenario("POST custom entities")
+    .feed(feeder)
+    .doIfOrElse(session => session("token").as[String].nonEmpty(session)) {
+      exec(EntityScenarios.postEntityWithToken)
+    } {
+      exec(EntityScenarios.postEntity)
+    }
+*/
+
+
+  setUp(scnToRun.inject(
+    rampUsers(Settings.rampUsers) over Settings.rampTime,
+    constantUsersPerSec(Settings.constantUsersPerSec) during Settings.constantUsersDuration
+  ).protocols(httpConf)).maxDuration(Settings.holdDuration)
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PostUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PostUsersSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PostUsersSimulation.scala
new file mode 100755
index 0000000..c46a92b
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PostUsersSimulation.scala
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ */
+package org.apache.usergrid.simulations.deprecated
+
+import io.gatling.core.Predef._
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * Posts application users continually to an application.  Expects the following parameters
+ *
+ * -DmaxPossibleUsers : The maximum number of users to be making requests as fast as possible.
 Think of this as conccurrent users in the system
+ * -DrampTime: The amount of time (in seconds) to allow for maxPossibleUsers to be reached.
 This will add new users linearlly
+ * -Dduration: The amount of time (in seconds) to continue to perform requests up with the
maxPossibleUsers
+ */
+class PostUsersSimulation extends Simulation {
+
+  println("Begin setup")
+  Setup.setupOrg()
+  Setup.setupApplication()
+  println("End Setup")
+
+
+  setUp(
+    UserScenarios.postUsersInfinitely
+      .inject(
+        /**
+         * injection steps take from this forum post
+         * https://groups.google.com/forum/#!topic/gatling/JfYHaWCbA-w
+         */
+        rampUsers(Settings.rampUsers) over Settings.rampTime,
+        constantUsersPerSec(Settings.constantUsersPerSec) during Settings.constantUsersDuration
+
+      )).protocols(Settings.httpConf.acceptHeader("application/json"))
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PushNotificationTargetUserSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PushNotificationTargetUserSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PushNotificationTargetUserSimulation.scala
new file mode 100644
index 0000000..cc39a6f
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PushNotificationTargetUserSimulation.scala
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ */
+package org.apache.usergrid.simulations.deprecated
+
+import io.gatling.core.Predef._
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios._
+import org.apache.usergrid.settings.Settings
+
+class PushNotificationTargetUserSimulation extends Simulation {
+
+
+  before{
+    if (!Settings.skipSetup) {
+      Setup.setupOrg()
+      Setup.setupApplication()
+      Setup.setupNotifier()
+      Setup.setupUsers()
+    } else {
+      println("Skipping setup")
+    }
+  }
+  setUp(
+    NotificationScenarios.createScenario
+      .inject(
+        rampUsers(Settings.rampUsers) over Settings.rampTime,
+        constantUsersPerSec(Settings.constantUsersPerSec) during Settings.constantUsersDuration)
+      .protocols( Settings.httpConf.acceptHeader("application/json"))
+  )
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutCustomEntitySimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutCustomEntitySimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutCustomEntitySimulation.scala
new file mode 100644
index 0000000..bffed0f
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutCustomEntitySimulation.scala
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  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.
+ */
+
+package org.apache.usergrid.simulations.deprecated
+
+import io.gatling.core.Predef._
+import io.gatling.core.scenario.Simulation
+import org.apache.usergrid.datagenerators.FeederGenerator
+import org.apache.usergrid.scenarios.EntityScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * PostCustomEntitySimulation - creates lots of custom entities
+ *
+ * Run this way:
+ * mvn gatling:execute -DrampTime=10 -DmaxPossibleUsers=10 -Dduration=120 -Dorg=yourorgname
-Dapp=sandbox -Dbaseurl=https://api.usergrid.com -DadminUser=yourusername -DadminPassword='yourpassword'
-Dgatling.simulationClass=org.apache.usergrid.simulations.deprecated.PostCustomEntitySimulation
-DcollectionType=yourcollection
+ *
+ *
+ */
+class PutCustomEntitySimulation extends Simulation {
+
+  if(!Settings.skipSetup) {
+    println("Begin setup")
+    println("These aren't the droids you are looking for...")
+    //exec(TokenScenarios.getManagementToken)
+    println("End Setup")
+  }else{
+    println("Skipping Setup")
+  }
+
+  val numEntities:Int = Settings.numEntities
+  val collectionType = Settings.collectionType
+  println("collection type = " + collectionType)
+  val rampTime:Int = Settings.rampTime
+  val throttle:Int = Settings.throttle
+  val feeder = FeederGenerator.generateCustomEntityPutInfinite(0)
+  val httpConf = Settings.httpConf
+
+  val scnToRun = scenario("PUT custom entities")
+    .feed(feeder)
+    .exec(EntityScenarios.putEntity)
+
+  /*
+  val scnToRun = scenario("POST custom entities")
+    .feed(feeder)
+    .doIfOrElse(session => session("token").as[String].nonEmpty(session)) {
+      exec(EntityScenarios.postEntityWithToken)
+    } {
+      exec(EntityScenarios.postEntity)
+    }
+*/
+
+
+  setUp(scnToRun.inject(
+    rampUsers(Settings.rampUsers) over Settings.rampTime,
+    constantUsersPerSec(Settings.constantUsersPerSec) during Settings.constantUsersDuration
+  ).protocols(httpConf)).maxDuration(Settings.holdDuration)
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutUsersSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutUsersSimulation.scala
new file mode 100644
index 0000000..ca65ab9
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutUsersSimulation.scala
@@ -0,0 +1,56 @@
+/*
+ *
+ *  * 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.deprecated
+
+import io.gatling.core.Predef._
+import io.gatling.core.scenario.Simulation
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * PUTS application users continually to an application.  Expects the following parameters
+ *
+ * -DmaxPossibleUsers : The maximum number of users to be making requests as fast as possible.
 Think of this as conccurrent users in the system
+ * -DrampTime: The amount of time (in seconds) to allow for maxPossibleUsers to be reached.
 This will add new users linearlly
+ * -Dduration: The amount of time (in seconds) to continue to perform requests up with the
maxPossibleUsers
+ */
+class PutUsersSimulation extends Simulation {
+
+  println("Begin setup")
+  Setup.setupOrg()
+  Setup.setupApplication()
+  println("End Setup")
+
+
+  setUp(
+    UserScenarios.putUsersInfinitely
+      .inject(
+        /**
+         * injection steps take from this forum post
+         * https://groups.google.com/forum/#!topic/gatling/JfYHaWCbA-w
+         */
+        rampUsers(Settings.rampUsers) over Settings.rampTime,
+        constantUsersPerSec(Settings.constantUsersPerSec) during Settings.constantUsersDuration
+
+      )).protocols(Settings.httpConf.acceptHeader("application/json"))
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/SetupSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/SetupSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/SetupSimulation.scala
new file mode 100644
index 0000000..484fb32
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/SetupSimulation.scala
@@ -0,0 +1,46 @@
+/*
+ *
+ *  * 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.deprecated
+
+import io.gatling.core.Predef._
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+import scala.concurrent.duration._
+
+/**
+ * Classy class class.
+ */
+class SetupSimulation extends Simulation{
+
+  println("Begin setup")
+  Setup.setupOrg()
+  Setup.setupApplication()
+  Setup.setupNotifier()
+  println("End Setup")
+
+  setUp(
+    UserScenarios.createUsersWithDevicesScenario
+      .inject(splitUsers(Settings.rampUsers) into( rampUsers(10) over (10 seconds)) separatedBy
(10 seconds))
+      .protocols(Settings.httpConf.acceptHeader("application/json"))
+  )
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c499e421/stack/loadtests/src/test/scala/Engine.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/test/scala/Engine.scala b/stack/loadtests/src/test/scala/Engine.scala
index 0914589..353b80c 100644
--- a/stack/loadtests/src/test/scala/Engine.scala
+++ b/stack/loadtests/src/test/scala/Engine.scala
@@ -25,7 +25,7 @@ object Engine extends App {
 	props.resultsDirectory(IDEPathHelper.resultsDirectory.toString)
 	props.requestBodiesDirectory(IDEPathHelper.requestBodiesDirectory.toString)
 	props.binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString)
-  val simName = if(System.getProperty("gatling.simulationClass")!=null) System.getProperty("gatling.simulationClass")
else "org.apache.usergrid.simulations.AppSimulation";
+  val simName = if(System.getProperty("gatling.simulationClass")!=null) System.getProperty("gatling.simulationClass")
else "org.apache.usergrid.simulations.deprecated.AppSimulation";
   props.simulationClass(simName)
 
 	Gatling.fromMap(props.build)


Mime
View raw message