You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2014/11/07 23:29:51 UTC

[1/4] incubator-usergrid git commit: adding connection scenario

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o efc0ec37a -> 7c14d8368


adding connection scenario


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

Branch: refs/heads/two-dot-o
Commit: 1f912ef726c41a633c39b908cc07b7fccda608ad
Parents: 19179bc
Author: Shawn Feldman <sf...@apache.org>
Authored: Fri Nov 7 09:33:31 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Fri Nov 7 09:33:31 2014 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/scenarios/ConnectionScenarios.scala  | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f912ef7/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ConnectionScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ConnectionScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ConnectionScenarios.scala
index e56124d..923a9bd 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ConnectionScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ConnectionScenarios.scala
@@ -37,6 +37,14 @@ import io.gatling.http.Predef._
       .headers(Headers.jsonAuthorized)
       .check(status.is(200))
   )
+
+   val postConnection = exec(
+     http("Connect user with device")
+       .post("/${collectionName}/${entityId}/${connectionType}/${entityId}")
+       .headers(Headers.jsonAuthorized)
+       .check(status.is(200))
+   )
+
    val entityNameFeeder = FeederGenerator.generateEntityNameFeeder("device", Settings.numEntities)
    val createScenario = scenario("Create Connections")
      .feed(Settings.userFeeder)


[4/4] incubator-usergrid git commit: loadtests: changing setup model

Posted by sf...@apache.org.
loadtests: changing setup model


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

Branch: refs/heads/two-dot-o
Commit: 7c14d8368652a546dee178e7a9a8fb73fcb1a3a4
Parents: ce011f1
Author: Shawn Feldman <sf...@apache.org>
Authored: Fri Nov 7 15:29:32 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Fri Nov 7 15:29:32 2014 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/helpers/Setup.scala     | 27 ++++++++++++--------
 .../scenarios/ConnectionScenarios.scala         |  2 +-
 .../scenarios/NotificationScenarios.scala       |  4 +--
 .../org/apache/usergrid/settings/Settings.scala | 21 ++++++---------
 4 files changed, 28 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7c14d836/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
index 0762feb..2dd0ed7 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
@@ -106,23 +106,30 @@ object Setup {
 
   def setupUsers() = {
     if (!Settings.skipSetup) {
-      val userFeeder = Settings.userFeeder
+      val userFeeder = Settings.getUserFeeder()
       val numUsers = userFeeder.length
       println(s"setupUsers: Sending requests for $numUsers users")
 
       val list: ArrayBuffer[ListenableFuture[Response]] = new ArrayBuffer[ListenableFuture[Response]]
+      var successCount: Int = 0;
+      def purgeList = {
+        list.foreach(f => {
+          val response = f.get()
+          if (response.getStatusCode != 200) {
+            printResponse("Post User", response.getStatusCode, response.getResponseBody())
+          } else {
+            successCount += 1
+          }
+        })
+        list.clear()
+      }
       userFeeder.foreach(user => {
         list += setupUser(user);
-      });
-      var successCount: Int = 0;
-      list.foreach(f => {
-        val response = f.get()
-        if (response.getStatusCode != 200) {
-          printResponse("Post User", response.getStatusCode, response.getResponseBody())
-        } else {
-          successCount += 1
+        if(list.length == Integer.getInteger("purgeUsers",100)){
+          purgeList
         }
-      })
+      });
+
       println(s"setupUsers: Received $successCount successful responses out of $numUsers requests.")
     } else {
       println("Skipping Adding Users due to skipSetup=true")

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7c14d836/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ConnectionScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ConnectionScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ConnectionScenarios.scala
index 923a9bd..aa724d6 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ConnectionScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ConnectionScenarios.scala
@@ -47,7 +47,7 @@ import io.gatling.http.Predef._
 
    val entityNameFeeder = FeederGenerator.generateEntityNameFeeder("device", Settings.numEntities)
    val createScenario = scenario("Create Connections")
-     .feed(Settings.userFeeder)
+     .feed(Settings.getUserFeeder)
      .exec(TokenScenarios.getUserToken)
      .exec( UserScenarios.getUserByUsername)
      .repeat(2){

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7c14d836/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
index a96cb61..ed1610f 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
@@ -67,10 +67,10 @@ object NotificationScenarios {
     .check(status.is(200))
   )
 
-  val numEntities:Int = Settings.numUsers * 3 * Settings.duration
+  val numEntities:Int = Settings.numUsers * 2
 
   val createScenario = scenario("Create Push Notification")
-    .feed(Settings.userFeeder)
+    .feed(Settings.getUserFeeder)
     .exec(TokenScenarios.getUserToken)
     .exec( UserScenarios.getUserByUsername)
     .repeat(2){

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7c14d836/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala
index b595c9d..aec7cfc 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala
@@ -33,26 +33,19 @@ object Settings {
   val httpConf = http.baseURL(baseAppUrl)
 
   val skipSetup:Boolean = System.getProperty("skipSetup") == "true"
+  val duration:Int = Integer.getInteger("duration", 300).toInt // in seconds
 
   // Simulation settings
-  var numUsers:Int = Integer.getInteger("numUsers", 10).toInt
+  val constantUsers:Int = Integer.getInteger("rampUsers", 10).toInt
+
+  var numUsers:Int = constantUsers * duration
 
   val numEntities:Int = Integer.getInteger("numEntities", 5000).toInt
   val numDevices:Int = Integer.getInteger("numDevices", 2000).toInt
 
   val rampTime:Int = Integer.getInteger("rampTime", 0).toInt // in seconds
-  val duration:Int = Integer.getInteger("duration", 300).toInt // in seconds
   val throttle:Int = Integer.getInteger("throttle", 50).toInt // in seconds
 
-  if(numUsers<duration){
-    println(s"Changing numUsers $numUsers to duration length $duration")
-    numUsers = duration
-  }
-  if(numUsers % duration != 0){
-    val message = s"please use numUsers ($numUsers) that is evenly divisible by duration($duration)"
-    println(message)
-    throw new Exception(message)
-  }
   // Geolocation settings
   val centerLatitude:Double = 37.442348 // latitude of center point
   val centerLongitude:Double = -122.138268 // longitude of center point
@@ -63,10 +56,12 @@ object Settings {
   val pushNotifier = if (System.getProperty("pushNotifier") != null)  System.getProperty("pushNotifier") else "loadNotifier"
   val pushProvider =  if (System.getProperty("pushProvider") != null)  System.getProperty("pushProvider")  else "noop"
 
-  val constantUsers:Int = Settings.numUsers/Settings.duration
   println(s"Will inject $constantUsers users per sec")
 
-  val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(numUsers, userLocationRadius, centerLatitude, centerLongitude)
+  def getUserFeeder():Array[Map[String, String]]= {
+    val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(numUsers, userLocationRadius, centerLatitude, centerLongitude)
+    return userFeeder
+  }
 
 
 }


[3/4] incubator-usergrid git commit: move skip setup to setup methods

Posted by sf...@apache.org.
move skip setup to setup methods


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

Branch: refs/heads/two-dot-o
Commit: ce011f18d707def785d4daa1a6296ad8cf0eeb91
Parents: b78ce8b
Author: Shawn Feldman <sf...@apache.org>
Authored: Fri Nov 7 09:40:42 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Fri Nov 7 09:40:42 2014 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/helpers/Setup.scala     | 41 +++++++++++---------
 .../usergrid/simulations/AppSimulation.scala    | 16 +++-----
 2 files changed, 28 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ce011f18/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
index 3a3a9c5..0762feb 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
@@ -105,25 +105,28 @@ object Setup {
   }
 
   def setupUsers() = {
-    val userFeeder = Settings.userFeeder
-    val numUsers = userFeeder.length
-    println(s"setupUsers: Sending requests for $numUsers users")
-
-    val list:ArrayBuffer[ListenableFuture[Response]] = new ArrayBuffer[ListenableFuture[Response]]
-    userFeeder.foreach(user => {
-      list += setupUser(user);
-    });
-    var successCount:Int = 0;
-    list.foreach(f => {
-      val response = f.get()
-      if(response.getStatusCode != 200) {
-        printResponse("Post User", response.getStatusCode, response.getResponseBody())
-      }else{
-        successCount+=1
-      }
-    })
-    println(s"setupUsers: Received $successCount successful responses out of $numUsers requests.")
-
+    if (!Settings.skipSetup) {
+      val userFeeder = Settings.userFeeder
+      val numUsers = userFeeder.length
+      println(s"setupUsers: Sending requests for $numUsers users")
+
+      val list: ArrayBuffer[ListenableFuture[Response]] = new ArrayBuffer[ListenableFuture[Response]]
+      userFeeder.foreach(user => {
+        list += setupUser(user);
+      });
+      var successCount: Int = 0;
+      list.foreach(f => {
+        val response = f.get()
+        if (response.getStatusCode != 200) {
+          printResponse("Post User", response.getStatusCode, response.getResponseBody())
+        } else {
+          successCount += 1
+        }
+      })
+      println(s"setupUsers: Received $successCount successful responses out of $numUsers requests.")
+    } else {
+      println("Skipping Adding Users due to skipSetup=true")
+    }
   }
 
   def setupUser(user:Map[String,String]):ListenableFuture[Response] = {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ce011f18/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
index fb2f8cf..48fff1c 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AppSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AppSimulation.scala
@@ -32,17 +32,13 @@ import scala.concurrent.duration._
  * Classy class class.
  */
 class AppSimulation extends Simulation {
+  println("Begin setup")
+  Setup.setupOrg()
+  Setup.setupApplication()
+  Setup.setupNotifier()
+  Setup.setupUsers()
+  println("End Setup")
 
-  if(!Settings.skipSetup) {
-    println("Begin setup")
-    Setup.setupOrg()
-    Setup.setupApplication()
-    Setup.setupNotifier()
-    Setup.setupUsers()
-    println("End Setup")
-  }else{
-    println("Skipping Setup")
-  }
   setUp(
     NotificationScenarios.createScenario
       .inject(constantUsersPerSec(Settings.constantUsers) during (Settings.duration)) // wait for 15 seconds so create org can finish, need to figure out coordination


[2/4] incubator-usergrid git commit: Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o

Posted by sf...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o


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

Branch: refs/heads/two-dot-o
Commit: b78ce8bbb0b6cc58a529efdf3ea636bab9d0c48f
Parents: 1f912ef efc0ec3
Author: Shawn Feldman <sf...@apache.org>
Authored: Fri Nov 7 09:33:45 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Fri Nov 7 09:33:45 2014 -0700

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        |  5 +-
 .../corepersistence/CpRelationManager.java      | 52 ++++++++------------
 2 files changed, 24 insertions(+), 33 deletions(-)
----------------------------------------------------------------------