usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [05/15] incubator-usergrid git commit: new simulations for put and delete
Date Wed, 10 Dec 2014 00:54:21 GMT
new simulations for put and delete


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/949daf8d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/949daf8d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/949daf8d

Branch: refs/heads/two-dot-o
Commit: 949daf8dc67a995f7da42d2069a8ff1de793a6ec
Parents: 5542814
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Thu Dec 4 09:30:01 2014 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Thu Dec 4 09:30:01 2014 -0700

----------------------------------------------------------------------
 .../simulations/DeleteUsersSimulation.scala     | 56 ++++++++++++++++++++
 .../simulations/PutUsersSimulation.scala        | 56 ++++++++++++++++++++
 2 files changed, 112 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/949daf8d/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/DeleteUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/DeleteUsersSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/DeleteUsersSimulation.scala
new file mode 100644
index 0000000..bcfbe2d
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/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
+
+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.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/949daf8d/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
new file mode 100644
index 0000000..f89952c
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/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
+
+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"))
+
+}


Mime
View raw message