usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [11/17] incubator-usergrid git commit: Upgrades gatling version
Date Wed, 03 Dec 2014 18:00:45 GMT
Upgrades gatling version

Fixes jsonPath assertions to first check for entities[0]

Renamed create to be clearer when reading code


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

Branch: refs/heads/index-alias
Commit: 12a522ad1093a6d3f4efff7a49bdca6190be49ca
Parents: a18e5de
Author: Todd Nine <tnine@apigee.com>
Authored: Mon Dec 1 16:34:30 2014 -0700
Committer: Todd Nine <tnine@apigee.com>
Committed: Mon Dec 1 16:34:30 2014 -0700

----------------------------------------------------------------------
 stack/loadtests/README.md                        | 19 +++++++++++++++++++
 stack/loadtests/pom.xml                          |  4 ++--
 .../usergrid/scenarios/DeviceScenarios.scala     |  2 +-
 .../usergrid/scenarios/UserScenarios.scala       |  6 +++---
 .../simulations/PostUsersSimulation.scala        |  2 +-
 .../usergrid/simulations/SetupSimulation.scala   |  4 ++--
 stack/loadtests/src/test/scala/Engine.scala      |  4 ++--
 7 files changed, 30 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12a522ad/stack/loadtests/README.md
----------------------------------------------------------------------
diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md
index 87f4a67..14514c6 100644
--- a/stack/loadtests/README.md
+++ b/stack/loadtests/README.md
@@ -26,3 +26,22 @@ Gatling will run through mvn
 	Also see http://gatling.io/docs/2.0.2/general/simulation_setup.html
 	
 	Additional docs can be found here http://gatling.io/docs/2.0.2/
+
+##Running a Push Notification Simulation
+
+1. Set up all users in the system with 2 devices each.
+
+	>mvn compile gatling:execute -Dgatling.simulationClass=org.apache.usergrid.simulations.SetupSimulation
-DadminUser=usergrid -DadminPassword=test -Dorg=usergrid  -Dapp=load -Dthrottle=100 -Dbaseurl=http://loadtest.usergrid.com
-DmaxPossibleUsers=1000
+
+
+	Note the following.
+
+
+	**throttle:**  The max number of users + devices per second to create
+
+	**maxPossibleUsers:**  The maximum number of users the simulation will create before exiting
+
+
+1. No
+
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12a522ad/stack/loadtests/pom.xml
----------------------------------------------------------------------
diff --git a/stack/loadtests/pom.xml b/stack/loadtests/pom.xml
index b08e58b..0389eda 100644
--- a/stack/loadtests/pom.xml
+++ b/stack/loadtests/pom.xml
@@ -52,9 +52,9 @@
 		<scala.version>2.10.4</scala.version>
 		<encoding>UTF-8</encoding>
 
-		<gatling.version>2.0.1</gatling.version>
+		<gatling.version>2.0.3</gatling.version>
     <gatling.plugin.version>2.0.0</gatling.plugin.version>
-		<gatling-highcharts.version>2.0.1</gatling-highcharts.version>
+		<gatling-highcharts.version>2.0.3</gatling-highcharts.version>
 
 		<scala-maven-plugin.version>3.1.6</scala-maven-plugin.version>
 	</properties>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12a522ad/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/DeviceScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/DeviceScenarios.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/DeviceScenarios.scala
index 9385123..4abd8cb 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/DeviceScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/DeviceScenarios.scala
@@ -50,7 +50,7 @@ object DeviceScenarios {
     .body(StringBody("""{"deviceModel":"Fake Device",
     "deviceOSVerion":"Negative Version",
     """" + notifier + """.notifier.id":"${entityName}"}"""))
-    .check(status.is(200), jsonPath("$..entities[0].uuid").exists , jsonPath("$..entities[0].uuid").saveAs("deviceId")))
+    .check(status.is(200),  jsonPath("$..entities[0]").exists , jsonPath("$..entities[0].uuid").exists
, jsonPath("$..entities[0].uuid").saveAs("deviceId")))
 
 
   val postDeviceWithNotifier400ok = exec(http("Create device with notifier")

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12a522ad/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
index 6fc5655..63466be 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
@@ -35,10 +35,10 @@ import io.gatling.core.Predef._
      http("GET user")
        .get("/users/${username}")
        .headers(Headers.jsonAuthorized)
-       .check(status.saveAs("userStatus"), jsonPath("$..entities[0].uuid").exists, jsonPath("$..entities[0].uuid").saveAs("userId"))
+       .check(status.saveAs("userStatus"), jsonPath("$..entities[0]").exists, jsonPath("$..entities[0].uuid").exists,
jsonPath("$..entities[0].uuid").saveAs("userId"))
    )
 
-  val postUser =
+  val postUserIfNotExists =
     exec(getUserByUsername)
       .doIf ("${userStatus}", "404") {
      exec(
@@ -78,7 +78,7 @@ import io.gatling.core.Predef._
    val createUsersWithDevicesScenario =  scenario("Create Users")
      .feed(Settings.getInfiniteUserFeeder())
      .exec(TokenScenarios.getManagementToken)
-     .exec(UserScenarios.postUser)
+     .exec(UserScenarios.postUserIfNotExists)
      .exec(TokenScenarios.getUserToken)
      .exec(UserScenarios.getUserByUsername)
      .repeat(2){

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12a522ad/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostUsersSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostUsersSimulation.scala
index cbac041..1c998cc 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostUsersSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostUsersSimulation.scala
@@ -43,7 +43,7 @@ class PostUsersSimulation extends Simulation {
 
   val scnToRun = scenario("POST geolocated users")
     .feed(feeder)
-    .exec(UserScenarios.postUser)
+    .exec(UserScenarios.postUserIfNotExists)
 
   setUp(scnToRun.inject(atOnceUsers(numUsers)).throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf))
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12a522ad/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
index ab68d98..567a510 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/SetupSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/SetupSimulation.scala
@@ -39,7 +39,7 @@ class SetupSimulation extends Simulation{
 
   setUp(
     UserScenarios.createUsersWithDevicesScenario
-      .inject(constantUsersPerSec(Settings.maxPossibleUsers) during (Settings.duration))
+      .inject(splitUsers(Settings.maxPossibleUsers) into( rampUsers(10) over (10 seconds))
separatedBy (10 seconds))
       .protocols(Settings.httpConf.acceptHeader("application/json"))
-  ).throttle(reachRps(Settings.throttle) in (Settings.rampTime seconds), holdFor(Settings.duration))
+  )
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12a522ad/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 48c93f8..0914589 100644
--- a/stack/loadtests/src/test/scala/Engine.scala
+++ b/stack/loadtests/src/test/scala/Engine.scala
@@ -25,8 +25,8 @@ object Engine extends App {
 	props.resultsDirectory(IDEPathHelper.resultsDirectory.toString)
 	props.requestBodiesDirectory(IDEPathHelper.requestBodiesDirectory.toString)
 	props.binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString)
-  val simName = if(System.getProperty("simulationClass")!=null) System.getProperty("simulationClass")
else "AppSimulation";
-  props.simulationClass("org.apache.usergrid.simulations."+simName)
+  val simName = if(System.getProperty("gatling.simulationClass")!=null) System.getProperty("gatling.simulationClass")
else "org.apache.usergrid.simulations.AppSimulation";
+  props.simulationClass(simName)
 
 	Gatling.fromMap(props.build)
 }


Mime
View raw message