You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2014/11/11 00:21:26 UTC
[01/42] incubator-usergrid git commit: moving user creation to setup
Repository: incubator-usergrid
Updated Branches:
refs/heads/es-type-updates 33f74f555 -> c31e1b336
moving user creation to setup
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/60055e47
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/60055e47
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/60055e47
Branch: refs/heads/es-type-updates
Commit: 60055e47ee1d02dfdc8667fb7ccdb39424229909
Parents: e351179
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Nov 5 14:30:45 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Nov 5 14:30:45 2014 -0700
----------------------------------------------------------------------
.../datagenerators/EntityDataGenerator.scala | 5 +-
.../org/apache/usergrid/helpers/Setup.scala | 132 +++++++++++++++++++
.../scenarios/NotificationScenarios.scala | 8 +-
.../usergrid/scenarios/UserScenarios.scala | 18 ++-
.../simulations/GeoProfileSimulation.scala | 33 +++++
.../PushNotificationTargetUserSimulation.scala | 22 ++--
6 files changed, 200 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/60055e47/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
index b0a4771..6917930 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
@@ -43,7 +43,7 @@ object EntityDataGenerator {
def generateUser(userId: Int): Map[String,String] = {
- return Map("username" -> "user".concat(userId.toString).concat(UUID.randomUUID().toString),
+ return Map("username" -> "user".concat(userId.toString),
"profileId" -> Utils.generateRandomInt(10000, 1000000).toString,
"displayName" -> Utils.generateRandomInt(10000, 1000000).toString,
"showAge" -> Utils.generateRandomInt(0, 1).toString,
@@ -54,7 +54,8 @@ object EntityDataGenerator {
"age" -> Utils.generateRandomInt(18, 65).toString,
"height" -> Utils.generateRandomInt(48, 84).toString,
"weight" -> Utils.generateRandomInt(120, 350).toString,
- "seen" -> Utils.generateRandomInt(50, 100000).toString
+ "seen" -> Utils.generateRandomInt(50, 100000).toString,
+ "password" -> "password"
)
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/60055e47/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
new file mode 100644
index 0000000..8072be8
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
@@ -0,0 +1,132 @@
+/*
+ *
+ * * 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.helpers
+
+import com.fasterxml.jackson.databind.ObjectMapper
+import com.ning.http.client.AsyncHttpClient
+import io.gatling.core.Predef._
+import io.gatling.http.Predef._
+import io.gatling.http.request.StringBody
+import io.gatling.jsonpath.JsonPath
+import org.apache.usergrid.datagenerators.FeederGenerator
+import org.apache.usergrid.settings.{Settings, Headers}
+
+/**
+ * Classy class class.
+ */
+object Setup {
+ var token:String = null
+ def setupOrg(): Integer = {
+ val client = new AsyncHttpClient()
+
+ val createOrgPost = client
+ .preparePost(Settings.baseUrl + "/management/organizations")
+ .setBody("{\"organization\":\"" + Settings.org + "\",\"username\":\"" + Settings.admin + "\",\"name\":\"" + Settings.admin + "\",\"email\":\"" + Settings.admin + "@apigee.com\",\"password\":\"" + Settings.password + "\"}")
+ .setHeader("Cache-Control", "no-cache")
+ .setHeader("Content-Type", "application/json; charset=UTF-8")
+
+ val orgResponse = createOrgPost.execute().get();
+
+ return orgResponse.getStatusCode
+ }
+ def setupApplication():Integer = {
+ val client = new AsyncHttpClient()
+
+ val authToken = getManagementToken()
+ val createAppPost = client
+ .preparePost(Settings.baseUrl + "/management/organizations/"+Settings.org+"/applications")
+ .setBody("{\"name\":\"" + Settings.app + "\"}")
+ .setHeader("Cache-Control", "no-cache")
+ .setHeader("Content-Type", "application/json; charset=UTF-8")
+ .setHeader("Authorization","Bearer "+authToken)
+
+
+ val appResponse = createAppPost.execute().get();
+
+
+ return appResponse.getStatusCode
+ }
+
+ def setupNotifier():Integer = {
+ val client = new AsyncHttpClient()
+
+ val authToken = getManagementToken()
+ val createNotifier = client
+ .preparePost(Settings.baseAppUrl + "/notifiers")
+ .setBody("{\"name\":\"" + Settings.pushNotifier + "\",\"provider\":\"" + Settings.pushProvider + "\"}")
+ .setHeader("Cache-Control", "no-cache")
+ .setHeader("Content-Type", "application/json; charset=UTF-8")
+ .setHeader("Authorization","Bearer "+authToken)
+
+ val notifierResponse = createNotifier.execute().get();
+
+ return notifierResponse.getStatusCode
+ }
+
+ def getManagementToken():String = {
+// if(token==null) {
+
+ val client = new AsyncHttpClient()
+ val getToken = client
+ .preparePost(Settings.baseUrl + "/management/token")
+ .setBody("{\"username\":\"" + Settings.admin + "\",\"password\":\"" + Settings.password + "\",\"grant_type\":\"password\"}")
+ .setHeader("Cache-Control", "no-cache")
+ .setHeader("Content-Type", "application/json; charset=UTF-8")
+ val body = getToken.execute().get().getResponseBody()
+ val omapper = new ObjectMapper();
+ val tree = omapper.readTree(body)
+ val node = tree.get("access_token");
+ token = node.toString
+// }
+ return token
+ }
+
+ def setupUsers() = {
+ val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers * Settings.duration, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
+ userFeeder.foreach(user => {
+ setupUser(user);
+ });
+
+ }
+
+ def setupUser(user:Map[String,String]):Integer = {
+
+ val client = new AsyncHttpClient()
+
+ val authToken = getManagementToken()
+ val createUser = client
+ .preparePost(Settings.baseAppUrl + "/users")
+ .setBody("{\"location\":{\"latitude\":\"" + user.get("latitude") + "\",\"longitude\":\"" + user.get("longitude") + "\"},\"username\":\"" + user.get("username") + "\"," +
+ "\"displayName\":\""+user.get("displayName")+"\",\"age\":\""+user.get("age")+"\",\"seen\":\""+user.get("seen")+"\",\"weight\":\""+user.get("weight")+"\"," +
+ "\"height\":\""+user.get("height")+"\",\"aboutMe\":\""+user.get("aboutMe")+"\",\"profileId\":\""+user.get("profileId")+"\",\"headline\":\""+user.get("headline")+"\"," +
+ "\"showAge\":\""+user.get("showAge")+"\",\"relationshipStatus\":\""+user.get("relationshipStatus")+"\",\"ethnicity\":\""+user.get("ethnicity")+"\",\"password\":\""+user.get("password")+"\"}"
+ )
+ .setHeader("Cache-Control", "no-cache")
+ .setHeader("Content-Type", "application/json; charset=UTF-8")
+ .setHeader("Authorization","Bearer "+authToken)
+
+ val createUserResponse = createUser.execute().get();
+
+ return createUserResponse.getStatusCode
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/60055e47/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 8556845..40f5085 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
@@ -72,14 +72,8 @@ object NotificationScenarios {
val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers * Settings.duration, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
val createScenario = scenario("Create Push Notification")
- .asLongAs(session=>session.get("applicationStatus")!="200" && session.get("notifierStatus")!="200"){
- exec(TokenScenarios.getManagementToken)
- .exec(ApplicationScenarios.checkApplication)
- .exec(NotifierScenarios.checkNotifier)
- .exec(session=>{session.remove("authToken")})
- }
.feed(userFeeder)
- .exec( UserScenarios.postUser)
+ .exec( UserScenarios.getUserByUsername)
.exec(TokenScenarios.getUserToken)
.repeat(2){
feed(FeederGenerator.generateEntityNameFeeder("device", numEntities))
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/60055e47/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 ae756dc..7a557e5 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
@@ -19,6 +19,7 @@
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.http.request.StringBody
+ import org.apache.usergrid.datagenerators.FeederGenerator
import org.apache.usergrid.settings.{Headers, Settings, Utils}
object UserScenarios {
@@ -49,5 +50,20 @@ import io.gatling.core.Predef._
exec(getUserByUsername)
}
+ val putUser = exec(
+ http("POST geolocated Users")
+ .put("/users")
+ .body(new StringBody( """{"location":{"latitude":"${latitude}","longitude":"${longitude}"},"username":"${username}",
+ "displayName":"${displayName}","age":"${age}","seen":"${seen}","weight":"${weight}",
+ "height":"${height}","aboutMe":"${aboutMe}","profileId":"${profileId}","headline":"${headline}",
+ "showAge":"${showAge}","relationshipStatus":"${relationshipStatus}","ethnicity":"${ethnicity}","password":"password"}"""))
+ .check(status.is(200), status.saveAs("userStatus"), jsonPath("$..entities[0].uuid").saveAs("userId"))
+ )
+ .doIf("${userStatus}", "400") {
+ exec(getUserByUsername)
+ }
+ val numEntities:Int = Settings.numEntities
+
+ val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers * Settings.duration, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
-}
+ }
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/60055e47/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GeoProfileSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GeoProfileSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GeoProfileSimulation.scala
new file mode 100644
index 0000000..b8b8839
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GeoProfileSimulation.scala
@@ -0,0 +1,33 @@
+/*
+ *
+ * * 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.http.Predef._
+import org.apache.usergrid.scenarios.{OrganizationScenarios, UserScenarios}
+import org.apache.usergrid.settings.Settings
+
+/**
+ * Classy class class.
+ */
+class GeoProfileSimulation extends Simulation {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/60055e47/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
index 67447e0..4c1de29 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
@@ -16,22 +16,28 @@
*/
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 {
- val scnToRun = NotificationScenarios.createScenario
- .inject(constantUsersPerSec(Settings.numUsers) 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"))
- val createOrg = OrganizationScenarios.createOrgScenario
- .inject(atOnceUsers(1))
- .protocols(http.baseURL(Settings.baseUrl))
- setUp(createOrg,scnToRun)
+ before{
+ Setup.setupOrg()
+ Setup.setupApplication()
+ Setup.setupNotifier()
+ Setup.setupUsers()
+ }
+ setUp(
+ NotificationScenarios.createScenario
+ .inject(constantUsersPerSec(Settings.numUsers) 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"))
+ )
}
[08/42] incubator-usergrid git commit: better logging
Posted by to...@apache.org.
better logging
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b6a7fc0b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b6a7fc0b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b6a7fc0b
Branch: refs/heads/es-type-updates
Commit: b6a7fc0b403b995c0f3e428c61de241fe076d89c
Parents: 7f7c936
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 08:43:13 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 08:43:13 2014 -0700
----------------------------------------------------------------------
.../main/scala/org/apache/usergrid/helpers/Setup.scala | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a7fc0b/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 3782726..96ce1c9 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
@@ -107,16 +107,22 @@ object Setup {
def setupUsers() = {
val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers , Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
val numUsers = userFeeder.length
- println(s"Sending requests for $numUsers users")
+ 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()
- printResponse("Post user",response.getStatusCode,response.getResponseBody())
+ 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.")
}
[10/42] incubator-usergrid git commit: logging
Posted by to...@apache.org.
logging
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2a0ed717
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2a0ed717
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2a0ed717
Branch: refs/heads/es-type-updates
Commit: 2a0ed717af2f1159f1b88775bea6d22abbedf08c
Parents: 2da184c
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 08:50:12 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 08:50:12 2014 -0700
----------------------------------------------------------------------
.../src/main/scala/org/apache/usergrid/settings/Settings.scala | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2a0ed717/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 401507f..76ca213 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
@@ -60,5 +60,6 @@ object Settings {
val pushProvider = System.getProperty("pushProvider")
val constantUsers:Int = Settings.numUsers/Settings.duration
+ println(s"Will inject $constantUsers users per sec")
}
[11/42] incubator-usergrid git commit: documenting simulations
Posted by to...@apache.org.
documenting simulations
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/11168eaf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/11168eaf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/11168eaf
Branch: refs/heads/es-type-updates
Commit: 11168eafa82a2f41fd17f73d8456a669a16c5285
Parents: 2a0ed71
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 09:18:20 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 09:18:20 2014 -0700
----------------------------------------------------------------------
stack/loadtests/README.md | 28 ++++++++++++++++++++
.../org/apache/usergrid/settings/Settings.scala | 8 +++---
2 files changed, 33 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/11168eaf/stack/loadtests/README.md
----------------------------------------------------------------------
diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md
index 8b13789..18348c3 100644
--- a/stack/loadtests/README.md
+++ b/stack/loadtests/README.md
@@ -1 +1,29 @@
+#Running
+Gatling will run through mvn
+
+execute mvn clean install
+
+execute mvn gatling:execute with these options
+
+*Required
+> -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd}
+
+*Addional optional settings
+
+>-DpushNotifier={notifierName} -DpushProvider=noop
+
+So running will look something like this
+>mvn gatling:execute -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd}
+
+The simulation to run is configured in the pom.xml
+
+ <plugin>
+ <groupId>io.gatling</groupId>
+ <artifactId>gatling-maven-plugin</artifactId>
+ <configuration>
+ <simulationsFolder>src/main/scala</simulationsFolder>
+ <simulationClass>org.apache.usergrid.simulations.AppSimulation</simulationClass>
+ <propagateSystemProperties>true</propagateSystemProperties>
+ </configuration>
+ </plugin>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/11168eaf/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 76ca213..03a4200 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
@@ -47,7 +47,9 @@ object Settings {
numUsers = duration
}
if(numUsers % duration != 0){
- throw new Exception(s"please use numUsers ($numUsers) that is evenly divisible by duration($duration)")
+ 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
@@ -56,8 +58,8 @@ object Settings {
val geosearchRadius:Int = 8000 // search area in meters
// Push Notification settings
- val pushNotifier = System.getProperty("pushNotifier")
- val pushProvider = System.getProperty("pushProvider")
+ 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")
[12/42] incubator-usergrid git commit: more documentation
Posted by to...@apache.org.
more documentation
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/66b14681
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/66b14681
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/66b14681
Branch: refs/heads/es-type-updates
Commit: 66b14681e20374af7d5d26655171807fc05bfb74
Parents: 11168ea
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 09:22:53 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 09:22:53 2014 -0700
----------------------------------------------------------------------
stack/loadtests/README.md | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/66b14681/stack/loadtests/README.md
----------------------------------------------------------------------
diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md
index 18348c3..8206a90 100644
--- a/stack/loadtests/README.md
+++ b/stack/loadtests/README.md
@@ -1,19 +1,25 @@
#Running
Gatling will run through mvn
-execute mvn clean install
+1. execute mvn clean install
-execute mvn gatling:execute with these options
+1. execute mvn gatling:execute with these options
-*Required
-> -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd}
+ *Required
+ > -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd}
-*Addional optional settings
+ *Addional optional settings
+
+ >-DpushNotifier={notifierName} -DpushProvider=noop
+
+ So running will look something like this
+ >mvn gatling:execute -Dthrottle=100 -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd}
+
+ Setting the rampTime => Injects a given number of users with a linear ramp over a given duration.
->-DpushNotifier={notifierName} -DpushProvider=noop
+ Also see http://gatling.io/docs/2.0.2/general/simulation_setup.html
-So running will look something like this
->mvn gatling:execute -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd}
+##Additional
The simulation to run is configured in the pom.xml
@@ -27,3 +33,5 @@ The simulation to run is configured in the pom.xml
</configuration>
</plugin>
+
+Additional docs can be found here http://gatling.io/docs/2.0.2/
\ No newline at end of file
[19/42] incubator-usergrid git commit: [APIBAAS-1362]External
elasticsearch setup
Posted by to...@apache.org.
[APIBAAS-1362]External elasticsearch setup
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/46d6c059
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/46d6c059
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/46d6c059
Branch: refs/heads/es-type-updates
Commit: 46d6c059f3e3b2a96624c32b3a7c02e4c7cdd217
Parents: c86d541
Author: ryan bridges <rb...@apigee.com>
Authored: Thu Nov 6 12:41:33 2014 -0500
Committer: ryan bridges <rb...@apigee.com>
Committed: Thu Nov 6 13:43:22 2014 -0500
----------------------------------------------------------------------
.../index/impl/ElasticSearchResource.java | 30 +++++++++++++++++---
1 file changed, 26 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/46d6c059/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchResource.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchResource.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchResource.java
index 42ab652..d4d2892 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchResource.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchResource.java
@@ -32,13 +32,13 @@ import org.safehaus.guicyfig.EnvironResource;
import org.safehaus.guicyfig.GuicyFigModule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.RandomStringUtils;
-
import org.apache.usergrid.persistence.core.util.AvailablePortFinder;
import org.apache.usergrid.persistence.index.IndexFig;
+import com.amazonaws.util.StringUtils;
import com.google.inject.Guice;
import com.google.inject.Injector;
@@ -50,17 +50,37 @@ public class ElasticSearchResource extends EnvironResource {
private static Node node;
private static int port;
+ private static String host;
+
+ private static boolean externalElasticSearch = false;
public ElasticSearchResource() {
super( Env.UNIT );
+ try {
+ Properties props = new Properties();
+ props.load( ClassLoader.getSystemResourceAsStream( "project.properties" ) );
+ host=(String)props.getProperty( "elasticsearch.host", "127.0.0.1" );
+ port=Integer.valueOf(props.getProperty( "elasticsearch.port", "9300" )).intValue();
+ String forkString = props.getProperty("elasticsearch.startup");
+ externalElasticSearch = "external".equals( forkString );
+
+ } catch (Exception ex) {
+ throw new RuntimeException("Error getting properties", ex);
+ }
}
@Override
protected void before() throws Throwable {
- startEs();
+ if(externalElasticSearch){
+ System.setProperty( IndexFig.ELASTICSEARCH_HOSTS, host );
+ System.setProperty( IndexFig.ELASTICSEARCH_PORT, port+"" );
+
+ }else{
+ startEs();
+ }
}
@@ -133,7 +153,9 @@ public class ElasticSearchResource extends EnvironResource {
public static void shutdown() {
- node.stop();
+ if(!externalElasticSearch){
+ node.stop();
+ }
}
[34/42] 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 to...@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/11eef841
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/11eef841
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/11eef841
Branch: refs/heads/es-type-updates
Commit: 11eef841244681d308ac49ca64e2084597026f88
Parents: 5ade7bb 7c14d83
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Nov 7 17:57:43 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Nov 7 17:57:43 2014 -0500
----------------------------------------------------------------------
.../org/apache/usergrid/helpers/Setup.scala | 46 ++++++++++++--------
.../scenarios/ConnectionScenarios.scala | 10 ++++-
.../scenarios/NotificationScenarios.scala | 4 +-
.../org/apache/usergrid/settings/Settings.scala | 21 ++++-----
.../usergrid/simulations/AppSimulation.scala | 16 +++----
5 files changed, 53 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
[09/42] incubator-usergrid git commit: make sure numUsers is
divisible by duration
Posted by to...@apache.org.
make sure numUsers is divisible by duration
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2da184ce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2da184ce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2da184ce
Branch: refs/heads/es-type-updates
Commit: 2da184ce0fbee79a2d7836c1be4329a374d70319
Parents: b6a7fc0
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 08:49:06 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 08:49:06 2014 -0700
----------------------------------------------------------------------
.../src/main/scala/org/apache/usergrid/settings/Settings.scala | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2da184ce/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 30cd4ab..401507f 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
@@ -46,6 +46,9 @@ object Settings {
println(s"Changing numUsers $numUsers to duration length $duration")
numUsers = duration
}
+ if(numUsers % duration != 0){
+ throw new Exception(s"please use numUsers ($numUsers) that is evenly divisible by duration($duration)")
+ }
// Geolocation settings
val centerLatitude:Double = 37.442348 // latitude of center point
val centerLongitude:Double = -122.138268 // longitude of center point
[07/42] incubator-usergrid git commit: remove sets of users
Posted by to...@apache.org.
remove sets of users
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/7f7c9368
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/7f7c9368
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/7f7c9368
Branch: refs/heads/es-type-updates
Commit: 7f7c93687e6f705eae9288b444711f9140a2955d
Parents: 00d8347
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 08:37:42 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 08:37:42 2014 -0700
----------------------------------------------------------------------
.../src/main/scala/org/apache/usergrid/helpers/Setup.scala | 6 ++++--
.../scala/org/apache/usergrid/simulations/AppSimulation.scala | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7f7c9368/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 bb1ae51..3782726 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,7 +105,10 @@ object Setup {
}
def setupUsers() = {
- val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers * Settings.duration, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
+ val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers , Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
+ val numUsers = userFeeder.length
+ println(s"Sending requests for $numUsers users")
+
val list:ArrayBuffer[ListenableFuture[Response]] = new ArrayBuffer[ListenableFuture[Response]]
userFeeder.foreach(user => {
list += setupUser(user);
@@ -138,7 +141,6 @@ object Setup {
"displayName":"$displayName","age":"$age","seen":"$seen","weight":"$weight",
"height":"$height","aboutMe":"$aboutMe","profileId":"$profileId","headline":"$headline",
"showAge":"$showAge","relationshipStatus":"$relationshipStatus","ethnicity":"$ethnicity","password":"$password"}"""
-
val authToken = getManagementToken()
val createUser = client
.preparePost(Settings.baseAppUrl + "/users")
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7f7c9368/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 6567c91..aa246a4 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,10 +32,12 @@ import scala.concurrent.duration._
*/
class AppSimulation extends Simulation{
before{
+ println("Begin setup")
Setup.setupOrg()
Setup.setupApplication()
Setup.setupNotifier()
Setup.setupUsers()
+ println("End Setup")
}
setUp(
NotificationScenarios.createScenario
[31/42] incubator-usergrid git commit: move skip setup to setup
methods
Posted by to...@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/es-type-updates
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
[37/42] incubator-usergrid git commit: Updated yourkit
Posted by to...@apache.org.
Updated yourkit
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/dd84f99e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/dd84f99e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/dd84f99e
Branch: refs/heads/es-type-updates
Commit: dd84f99ed8c316ea610d344da0bb90abf3d4a8ae
Parents: 33f74f5
Author: Todd Nine <tn...@apigee.com>
Authored: Mon Nov 10 14:27:06 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Mon Nov 10 14:27:06 2014 -0700
----------------------------------------------------------------------
.../awscluster/src/main/dist/init_instance/install_yourkit.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dd84f99e/stack/awscluster/src/main/dist/init_instance/install_yourkit.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/install_yourkit.sh b/stack/awscluster/src/main/dist/init_instance/install_yourkit.sh
index 2883dae..ec1ac10 100644
--- a/stack/awscluster/src/main/dist/init_instance/install_yourkit.sh
+++ b/stack/awscluster/src/main/dist/init_instance/install_yourkit.sh
@@ -25,15 +25,15 @@ if [[ $YOURKIT = "true" ]]; then
mkdir -p /mnt/yourkit
cd /mnt/yourkit
-s3cmd --config=/etc/s3cfg get s3://${RELEASE_BUCKET}/yjp-2014-build-14108.zip
-unzip /mnt/yourkit/yjp-2014-build-14108.zip
+s3cmd --config=/etc/s3cfg get s3://${RELEASE_BUCKET}/yjp-2014-build-14110.zip
+unzip /mnt/yourkit/yjp-2014-build-14110.zip
mkdir -p /mnt/yourkitreports
chown -R tomcat7.tomcat7 /mnt/yourkitreports
cat >> /etc/default/tomcat7 << EOF
-JAVA_OPTS="\${JAVA_OPTS} -agentpath:/mnt/yourkit/yjp-2014-build-14108/bin/linux-x86-64/libyjpagent.so=port=10001,logdir=/mnt/yourkitreports,dir=/mnt/yourkitreports,onexit=snapshot"
+JAVA_OPTS="\${JAVA_OPTS} -agentpath:/mnt/yourkit/yjp-2014-build-14110/bin/linux-x86-64/libyjpagent.so=port=10001,logdir=/mnt/yourkitreports,dir=/mnt/yourkitreports,onexit=snapshot"
EOF
fi
[30/42] 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 to...@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/es-type-updates
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(-)
----------------------------------------------------------------------
[32/42] incubator-usergrid git commit: loadtests: changing setup model
Posted by to...@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/es-type-updates
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
+ }
}
[05/42] incubator-usergrid git commit: Merge branch
'key-row-sharding' of
https://git-wip-us.apache.org/repos/asf/incubator-usergrid into
key-row-sharding
Posted by to...@apache.org.
Merge branch 'key-row-sharding' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into key-row-sharding
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/7d0cd3be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/7d0cd3be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/7d0cd3be
Branch: refs/heads/es-type-updates
Commit: 7d0cd3beb69f6f5027c2c62481ad8c33ac941805
Parents: 1b408c1 795874e
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 08:13:25 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 08:13:25 2014 -0700
----------------------------------------------------------------------
.../dist/init_instance/init_graphite_server.sh | 2 +
.../main/dist/init_instance/init_rest_server.sh | 2 +-
.../main/groovy/configure_elasticsearch.groovy | 2 +
.../src/main/groovy/configure_usergrid.groovy | 8 +-
stack/awscluster/ugcluster-cf.json | 3 +
.../corepersistence/CpEntityManager.java | 12 +-
.../corepersistence/CpEntityManagerFactory.java | 30 ++--
.../HybridEntityManagerFactory.java | 10 +-
.../usergrid/persistence/EntityManager.java | 6 +
.../persistence/EntityManagerFactory.java | 25 ++--
.../cassandra/EntityManagerFactoryImpl.java | 10 +-
.../cassandra/EntityManagerImpl.java | 6 +
.../collection/EntityCollectionManager.java | 6 +-
.../impl/EntityCollectionManagerImpl.java | 7 +-
.../collection/EntityCollectionManagerIT.java | 3 +-
.../usergrid/persistence/core/util/Health.java | 23 ++++
.../usergrid/persistence/index/EntityIndex.java | 13 +-
.../index/impl/EsEntityIndexImpl.java | 58 +++++---
.../index/impl/ElasticSearchResource.java | 2 +-
.../impl/EntityConnectionIndexImplTest.java | 14 --
.../persistence/index/impl/EntityIndexTest.java | 34 ++++-
.../rest/JacksonCustomMapperProvider.java | 7 +-
.../org/apache/usergrid/rest/RootResource.java | 42 +++++-
.../rest/filters/HealthCheckFilter.java | 67 ---------
.../applications/ApplicationResource.java | 136 +++++++++++++------
stack/rest/src/main/webapp/WEB-INF/web.xml | 10 --
26 files changed, 308 insertions(+), 230 deletions(-)
----------------------------------------------------------------------
[17/42] incubator-usergrid git commit: updating docs
Posted by to...@apache.org.
updating docs
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c86d5411
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c86d5411
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c86d5411
Branch: refs/heads/es-type-updates
Commit: c86d541181c3193f2edd95571b9eaf6b34e689d7
Parents: c390bc9
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 11:08:11 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 11:08:11 2014 -0700
----------------------------------------------------------------------
stack/loadtests/README.md | 25 +++++--------------------
stack/loadtests/pom.xml | 10 ----------
2 files changed, 5 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c86d5411/stack/loadtests/README.md
----------------------------------------------------------------------
diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md
index 420c110..b246d04 100644
--- a/stack/loadtests/README.md
+++ b/stack/loadtests/README.md
@@ -6,34 +6,19 @@ Gatling will run through mvn
1. execute mvn gatling:execute with these options
*Required
- > -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd}
+ > -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd} -Dgatling.simulationClass={simulationFQDN}
*Addional optional settings
- >-DpushNotifier={notifierName} -DpushProvider={noop_apns_or_gcm} -Dsc={simulationFQDN}
+ >-DpushNotifier={notifierName} -DpushProvider={noop_apns_or_gcm}
So running will look something like this
- >mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DnumUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dsc=org.apache.usergrid.simulations.AppSimulation
+ >mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DnumUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dgatling.simulationClass=org.apache.usergrid.simulations.AppSimulation
Setting the rampTime => Injects a given number of users with a linear ramp over a given duration.
Values for simulation are 'all','connections'
Also see http://gatling.io/docs/2.0.2/general/simulation_setup.html
-
-##Additional
-
-The simulation to run is configured in the pom.xml
-
- <plugin>
- <groupId>io.gatling</groupId>
- <artifactId>gatling-maven-plugin</artifactId>
- <configuration>
- <simulationsFolder>src/main/scala</simulationsFolder>
- <simulationClass>org.apache.usergrid.simulations.AppSimulation</simulationClass>
- <propagateSystemProperties>true</propagateSystemProperties>
- </configuration>
- </plugin>
-
-
-Additional docs can be found here http://gatling.io/docs/2.0.2/
\ No newline at end of file
+
+ Additional docs can be found here http://gatling.io/docs/2.0.2/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c86d5411/stack/loadtests/pom.xml
----------------------------------------------------------------------
diff --git a/stack/loadtests/pom.xml b/stack/loadtests/pom.xml
index 363cfbc..b08e58b 100644
--- a/stack/loadtests/pom.xml
+++ b/stack/loadtests/pom.xml
@@ -143,16 +143,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>io.gatling</groupId>
- <artifactId>gatling-maven-plugin</artifactId>
- <configuration>
- <simulationsFolder>src/main/scala</simulationsFolder>
- <simulationClass>org.apache.usergrid.simulations.AppSimulation</simulationClass>
- <propagateSystemProperties>true</propagateSystemProperties>
- </configuration>
-
- </plugin>
</plugins>
</build>
</project>
[24/42] incubator-usergrid git commit: Tweaks to CassandraResource
and ElasticSearchResource
Posted by to...@apache.org.
Tweaks to CassandraResource and ElasticSearchResource
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/bf2bd804
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/bf2bd804
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/bf2bd804
Branch: refs/heads/es-type-updates
Commit: bf2bd804c469984cecf5b351d51e15bd2b79b46e
Parents: 3275a70
Author: ryan bridges <rb...@apigee.com>
Authored: Thu Nov 6 17:13:03 2014 -0500
Committer: ryan bridges <rb...@apigee.com>
Committed: Thu Nov 6 17:13:03 2014 -0500
----------------------------------------------------------------------
.../usergrid/persistence/index/impl/ElasticSearchResource.java | 2 +-
.../java/org/apache/usergrid/cassandra/CassandraResource.java | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf2bd804/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchResource.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchResource.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchResource.java
index d4d2892..4145e32 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchResource.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchResource.java
@@ -63,7 +63,7 @@ public class ElasticSearchResource extends EnvironResource {
props.load( ClassLoader.getSystemResourceAsStream( "project.properties" ) );
host=(String)props.getProperty( "elasticsearch.host", "127.0.0.1" );
port=Integer.valueOf(props.getProperty( "elasticsearch.port", "9300" )).intValue();
- String forkString = props.getProperty("elasticsearch.startup");
+ String forkString = props.getProperty("elasticsearch.startup", "external");
externalElasticSearch = "external".equals( forkString );
} catch (Exception ex) {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf2bd804/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
----------------------------------------------------------------------
diff --git a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
index 0b4c083..5643710 100644
--- a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
+++ b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
@@ -317,7 +317,6 @@ public class CassandraResource extends ExternalResource {
LOG.info( "-------------------------------------------------------------------");
LOG.info( "Initializing Embedded Cassandra at {} ...", tempDir.toString() );
LOG.info( "-------------------------------------------------------------------");
-
// Create temp directory, setup to create new File configuration there
File newYamlFile = new File( tempDir, "cassandra.yaml" );
URL newYamlUrl = FileUtils.toURLs( new File[] { newYamlFile } )[0];
@@ -403,7 +402,6 @@ public class CassandraResource extends ExternalResource {
LOG.info( "-------------------------------------------------------------------");
LOG.info( "Initializing Forked Cassandra at {} ...", tempDir.toString() );
LOG.info( "-------------------------------------------------------------------");
-
// Create temp directory, setup to create new File configuration there
File newYamlFile = new File( tempDir, "cassandra.yaml" );
URL newYamlUrl = FileUtils.toURLs( new File[] { newYamlFile } )[0];
@@ -698,7 +696,7 @@ public class CassandraResource extends ExternalResource {
// int nativeTransportPort = CassandraResource.DEFAULT_NATIVE_TRANSPORT_PORT;
System.setProperty( "cassandra.url", host+":" + Integer.toString( rpcPort ) );
- System.setProperty( "cassandra.cluster", props.getProperty("cassandra.cluster","Test Cluster") );
+ System.setProperty( "cassandra.cluster", props.getProperty("cassandra.cluster","Usergrid") );
System.setProperty( "cassandra-foreground", "true" );
System.setProperty( "log4j.defaultInitOverride", "true" );
System.setProperty( "log4j.configuration", "log4j.properties" );
[26/42] incubator-usergrid git commit: Pass new entity from
batchCreate() to addToCollections().
Posted by to...@apache.org.
Pass new entity from batchCreate() to addToCollections().
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/02c9f421
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/02c9f421
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/02c9f421
Branch: refs/heads/es-type-updates
Commit: 02c9f42151ddf68d84974a1344f36e97dfcf5773
Parents: 5285f3d
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Nov 7 08:32:47 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Nov 7 08:32:47 2014 -0500
----------------------------------------------------------------------
.../corepersistence/CpEntityManager.java | 5 +-
.../corepersistence/CpRelationManager.java | 52 ++++++++------------
2 files changed, 24 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/02c9f421/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index daa046c..ae88641 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -2656,6 +2656,8 @@ public class CpEntityManager implements EntityManager {
logger.debug("Wrote {}:{} version {}", new Object[] {
cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion() });
+
+ entityCache.put( new EntityScope( collectionScope, cpEntity.getId() ), cpEntity);
}
catch ( WriteUniqueVerifyException wuve ) {
handleWriteUniqueVerifyException( entity, wuve );
@@ -2685,7 +2687,8 @@ public class CpEntityManager implements EntityManager {
if ( !is_application ) {
String collectionName = Schema.defaultCollectionName( eType );
- getRelationManager( getApplication() ).addToCollection( collectionName, entity );
+ CpRelationManager cpr = (CpRelationManager)getRelationManager( getApplication() );
+ cpr.addToCollection( collectionName, entity, cpEntity, false );
// Invoke counters
incrementEntityCollection( collectionName, timestamp );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/02c9f421/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index 1e8dcc3..a47ce8c 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@ -601,7 +601,25 @@ public class CpRelationManager implements RelationManager {
}
- public Entity addToCollection( String collName, EntityRef itemRef, boolean connectBack ) throws Exception {
+ public Entity addToCollection( String collName, EntityRef itemRef, boolean connectBack )
+ throws Exception {
+
+ CollectionScope memberScope = new CollectionScopeImpl(
+ applicationScope.getApplication(),
+ applicationScope.getApplication(),
+ CpNamingUtils.getCollectionScopeNameFromEntityType( itemRef.getType() ) );
+
+ Id entityId = new SimpleId( itemRef.getUuid(), itemRef.getType() );
+ org.apache.usergrid.persistence.model.entity.Entity memberEntity =
+ ((CpEntityManager)em).load( new CpEntityManager.EntityScope( memberScope, entityId));
+
+ return addToCollection(collName, itemRef, memberEntity, connectBack);
+ }
+
+
+ public Entity addToCollection( String collName, EntityRef itemRef,
+ org.apache.usergrid.persistence.model.entity.Entity memberEntity, boolean connectBack )
+ throws Exception {
// don't fetch entity if we've already got one
final Entity itemEntity;
@@ -621,36 +639,6 @@ public class CpRelationManager implements RelationManager {
return null;
}
- // load the new member entity to be added to the collection from its default scope
- CollectionScope memberScope = new CollectionScopeImpl(
- applicationScope.getApplication(),
- applicationScope.getApplication(),
- CpNamingUtils.getCollectionScopeNameFromEntityType( itemRef.getType() ) );
- EntityCollectionManager memberMgr = managerCache.getEntityCollectionManager( memberScope );
-
- //TODO, this double load should disappear once events are in
- Id entityId = new SimpleId( itemRef.getUuid(), itemRef.getType() );
- org.apache.usergrid.persistence.model.entity.Entity memberEntity =
- ((CpEntityManager)em).load( new CpEntityManager.EntityScope( memberScope, entityId));
-
- if ( memberEntity == null ) {
- throw new RuntimeException(
- "Unable to load entity uuid=" + itemRef.getUuid() + " type=" + itemRef.getType() );
- }
-
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Loaded member entity {}:{} from scope\n app {}\n "
- + "owner {}\n name {} data {}",
- new Object[] {
- itemRef.getType(),
- itemRef.getUuid(),
- memberScope.getApplication(),
- memberScope.getOwner(),
- memberScope.getName(),
- CpEntityMapUtils.toMap( memberEntity )
- } );
- }
-
String edgeType = CpNamingUtils.getEdgeTypeFromCollectionName( collName );
UUID timeStampUuid = memberEntity.getId().getUuid() != null
@@ -688,7 +676,7 @@ public class CpRelationManager implements RelationManager {
if ( connectBack && collection != null && collection.getLinkedCollection() != null ) {
getRelationManager( itemEntity ).addToCollection(
- collection.getLinkedCollection(), headEntity, false );
+ collection.getLinkedCollection(), headEntity, cpHeadEntity, false );
}
return itemEntity;
[21/42] incubator-usergrid git commit: Added delete method to users
scenario
Posted by to...@apache.org.
Added delete method to users 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/51b8c8ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/51b8c8ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/51b8c8ed
Branch: refs/heads/es-type-updates
Commit: 51b8c8ed36f65e615c4ecb85927bf51776c6bd71
Parents: 81f56f6
Author: Rod Simpson <ro...@apigee.com>
Authored: Thu Nov 6 14:49:40 2014 -0700
Committer: Rod Simpson <ro...@apigee.com>
Committed: Thu Nov 6 14:49:40 2014 -0700
----------------------------------------------------------------------
.../scala/org/apache/usergrid/scenarios/UserScenarios.scala | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/51b8c8ed/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 86d1f78..d4579f7 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
@@ -63,4 +63,10 @@ import io.gatling.core.Predef._
exec(getUserByUsername)
}
+ val deleteUserByUsername = exec(
+ http("DELETE user")
+ .delete("/users/${username}")
+ .headers(Headers.jsonAuthorized)
+ .check(status.is(200), jsonPath("$..entities[0].uuid").saveAs("userId"))
+ )
}
[33/42] incubator-usergrid git commit: Merge branch 'pr/95' into
two-dot-o. This closes #95
Posted by to...@apache.org.
Merge branch 'pr/95' into two-dot-o. This closes #95
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/5ade7bb2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/5ade7bb2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/5ade7bb2
Branch: refs/heads/es-type-updates
Commit: 5ade7bb2a507dfef0b0da95554f859e75e4be85d
Parents: b7f81ef bf2bd80
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Nov 7 17:56:25 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Nov 7 17:56:25 2014 -0500
----------------------------------------------------------------------
.../index/impl/ElasticSearchResource.java | 30 +++-
.../usergrid/cassandra/CassandraResource.java | 138 +++++++++++++++----
2 files changed, 135 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
[42/42] incubator-usergrid git commit: Turned down defaults on rest
threading
Posted by to...@apache.org.
Turned down defaults on rest threading
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c31e1b33
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c31e1b33
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c31e1b33
Branch: refs/heads/es-type-updates
Commit: c31e1b336648c73a374ba6fe875b5cd8c97455c9
Parents: 1ea42f8
Author: Todd Nine <tn...@apigee.com>
Authored: Mon Nov 10 16:21:08 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Mon Nov 10 16:21:08 2014 -0700
----------------------------------------------------------------------
.../src/main/dist/init_instance/init_rest_server.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c31e1b33/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh b/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
index 7b6571c..924fb49 100644
--- a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
+++ b/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
@@ -63,8 +63,8 @@ cd /usr/share/usergrid/init_instance
# set Tomcat memory and threads based on instance type
# use about 70% of RAM for heap
export NOFILE=150000
-export TOMCAT_CONNECTIONS=10000
-export ACCEPT_COUNT=1600
+#export TOMCAT_CONNECTIONS=10000
+export ACCEPT_COUNT=100
export NR_OPEN=1048576
export FILE_MAX=761773
@@ -102,7 +102,7 @@ case `(curl http://169.254.169.254/latest/meta-data/instance-type)` in
'c3.xlarge' )
# total of 7.5g
export TOMCAT_RAM=4096m
- export TOMCAT_THREADS=7000
+ export TOMCAT_THREADS=1000
;;
'c3.2xlarge' )
# total of 15g
@@ -117,7 +117,7 @@ esac
sed -i.bak "s/Xmx128m/Xmx${TOMCAT_RAM} -Xms${TOMCAT_RAM} -Dlog4j\.configuration=file:\/usr\/share\/usergrid\/lib\/log4j\.properties/g" /etc/default/tomcat7
-sed -i.bak "s/<Connector/<Connector maxThreads=\"${TOMCAT_THREADS}\" acceptCount=\"${ACCEPT_COUNT}\" maxConnections=\"${TOMCAT_CONNECTIONS}\"/g" /var/lib/tomcat7/conf/server.xml
+sed -i.bak "s/<Connector/<Connector maxThreads=\"${TOMCAT_THREADS}\" acceptCount=\"${ACCEPT_COUNT}\" maxConnections=\"${TOMCAT_THREADS}\"/g" /var/lib/tomcat7/conf/server.xml
#Append our java opts for secret key
[39/42] incubator-usergrid git commit: loadtests: seperating setup
from notifications
Posted by to...@apache.org.
loadtests: seperating setup from notifications
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c282d80a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c282d80a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c282d80a
Branch: refs/heads/es-type-updates
Commit: c282d80a3be87f240b56e680e7cb57224576acc9
Parents: a3b517b
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Nov 10 15:29:13 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Nov 10 15:29:13 2014 -0700
----------------------------------------------------------------------
stack/loadtests/README.md | 4 ++--
.../org/apache/usergrid/scenarios/NotificationScenarios.scala | 2 ++
.../src/main/scala/org/apache/usergrid/settings/Settings.scala | 6 ++----
3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c282d80a/stack/loadtests/README.md
----------------------------------------------------------------------
diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md
index f5f72ad..b207ab4 100644
--- a/stack/loadtests/README.md
+++ b/stack/loadtests/README.md
@@ -6,7 +6,7 @@ Gatling will run through mvn
1. execute mvn gatling:execute with these options
*Required
- > -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DrampUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd} -Dgatling.simulationClass={simulationFQDN}
+ > -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DmaxPossibleUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd} -Dgatling.simulationClass={simulationFQDN}
*Addional optional settings
@@ -15,7 +15,7 @@ Gatling will run through mvn
skipSetup will skip the setup steps
So running will look something like this
- >mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DrampUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dgatling.simulationClass=org.apache.usergrid.simulations.AppSimulation
+ >mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DmaxPossibleUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dgatling.simulationClass=org.apache.usergrid.simulations.AppSimulation
Setting the users and duration => Injects a given number of users with a linear ramp over a given duration. users must be greater than duration
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c282d80a/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 6ed5625..61b2605 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
@@ -71,6 +71,8 @@ object NotificationScenarios {
val userFeeder = Settings.getInfiniteUserFeeder()
val createScenario = scenario("Create Push Notification")
.feed(userFeeder)
+ .exec(TokenScenarios.getUserToken)
+ .exec(UserScenarios.getUserByUsername)
.exec( sendNotificationToUser)
/**
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c282d80a/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 4bcb6bb..0e9781c 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
@@ -35,13 +35,11 @@ object Settings {
val skipSetup:Boolean = System.getProperty("skipSetup") == "true"
val duration:Int = Integer.getInteger("duration", 300).toInt // in seconds
- // Simulation settings
- val constantUsers:Int = Integer.getInteger("rampUsers", 10).toInt
- val numUsers:Int = constantUsers * duration
// Simulation settings
val maxPossibleUsers:Int = Integer.getInteger("maxPossibleUsers", 10).toInt
+ val numUsers:Int = maxPossibleUsers
val numEntities:Int = Integer.getInteger("numEntities", 5000).toInt
val numDevices:Int = Integer.getInteger("numDevices", 4000).toInt
@@ -59,7 +57,7 @@ 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"
- println(s"Will inject $constantUsers users per sec")
+ println(s"Will inject $maxPossibleUsers users per sec")
def getUserFeeder():Array[Map[String, String]]= {
val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(numUsers, userLocationRadius, centerLatitude, centerLongitude)
[16/42] incubator-usergrid git commit: update docs,
remove switch statement
Posted by to...@apache.org.
update docs, remove switch statement
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c390bc9a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c390bc9a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c390bc9a
Branch: refs/heads/es-type-updates
Commit: c390bc9aa2fb64926494c39f23a567f05da76842
Parents: f79b5e9
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 10:53:26 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 10:53:26 2014 -0700
----------------------------------------------------------------------
stack/loadtests/README.md | 8 +++---
.../org/apache/usergrid/settings/Settings.scala | 2 --
.../usergrid/simulations/AppSimulation.scala | 28 +++++---------------
3 files changed, 11 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c390bc9a/stack/loadtests/README.md
----------------------------------------------------------------------
diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md
index 54f358b..420c110 100644
--- a/stack/loadtests/README.md
+++ b/stack/loadtests/README.md
@@ -1,19 +1,19 @@
#Running
Gatling will run through mvn
-1. execute mvn clean install
+1. navigate to loadtests under stack
1. execute mvn gatling:execute with these options
*Required
- > -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd}
+ > -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd}
*Addional optional settings
- >-DpushNotifier={notifierName} -DpushProvider={noop_apns_or_gcm} -Dsimulation={simulationNameOrAll}
+ >-DpushNotifier={notifierName} -DpushProvider={noop_apns_or_gcm} -Dsc={simulationFQDN}
So running will look something like this
- >mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DnumUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dsimulation=all
+ >mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DnumUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dsc=org.apache.usergrid.simulations.AppSimulation
Setting the rampTime => Injects a given number of users with a linear ramp over a given duration.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c390bc9a/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 3a0d23d..03a4200 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
@@ -64,6 +64,4 @@ object Settings {
val constantUsers:Int = Settings.numUsers/Settings.duration
println(s"Will inject $constantUsers users per sec")
- var simulation:String = if(System.getProperty("simulation") != null) System.getProperty("simulation") else "all"
-
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c390bc9a/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 9805eea..50a4728 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
@@ -31,10 +31,7 @@ import scala.concurrent.duration._
/**
* Classy class class.
*/
-class AppSimulation extends Simulation{
-
- val simulation = Settings.simulation
- println(s"Running simulation $simulation")
+class AppSimulation extends Simulation {
println("Begin setup")
Setup.setupOrg()
@@ -43,21 +40,10 @@ class AppSimulation extends Simulation{
Setup.setupUsers()
println("End Setup")
- def sim(choice:String) = (choice: @switch) match {
- case "connections" =>
- 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"))
- )
- case "all" =>
- 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"))
- )
- }
- sim(simulation)
+ 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"))
+ )
}
[20/42] incubator-usergrid git commit: updating docs,
adding skip setup
Posted by to...@apache.org.
updating docs, adding skip setup
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/81f56f6a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/81f56f6a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/81f56f6a
Branch: refs/heads/es-type-updates
Commit: 81f56f6a984ed1e0ec2e8aa8eef8ed4cf8fc90be
Parents: c86d541
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 14:20:58 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 14:20:58 2014 -0700
----------------------------------------------------------------------
stack/loadtests/README.md | 10 ++--
.../org/apache/usergrid/helpers/Setup.scala | 2 +-
.../scenarios/ConnectionScenarios.scala | 21 +++++++-
.../scenarios/NotificationScenarios.scala | 3 +-
.../org/apache/usergrid/settings/Settings.scala | 5 ++
.../usergrid/simulations/AppSimulation.scala | 17 ++++---
.../simulations/ConnectionsSimulation.scala | 53 ++++++++++++++++++++
.../simulations/GeoProfileSimulation.scala | 33 ------------
.../simulations/PostDevicesSimulation.scala | 45 -----------------
9 files changed, 96 insertions(+), 93 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/81f56f6a/stack/loadtests/README.md
----------------------------------------------------------------------
diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md
index b246d04..a17813e 100644
--- a/stack/loadtests/README.md
+++ b/stack/loadtests/README.md
@@ -10,13 +10,17 @@ Gatling will run through mvn
*Addional optional settings
- >-DpushNotifier={notifierName} -DpushProvider={noop_apns_or_gcm}
+ >-DpushNotifier={notifierName} -DpushProvider={noop_apns_or_gcm} -DskipSetup={boolean}
+
+ skipSetup will skip the setup steps
So running will look something like this
>mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DnumUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dgatling.simulationClass=org.apache.usergrid.simulations.AppSimulation
- Setting the rampTime => Injects a given number of users with a linear ramp over a given duration.
-
+ Setting the users and duration => Injects a given number of users with a linear ramp over a given duration. users must be greater than duration
+
+ Setting the throttle and ramptime => will attempt to hit a set reqs/sec over a given time period. If users and duration are not great enough then you will never hit your throttle
+
Values for simulation are 'all','connections'
Also see http://gatling.io/docs/2.0.2/general/simulation_setup.html
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/81f56f6a/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 96ce1c9..3a3a9c5 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,7 +105,7 @@ object Setup {
}
def setupUsers() = {
- val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers , Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
+ val userFeeder = Settings.userFeeder
val numUsers = userFeeder.length
println(s"setupUsers: Sending requests for $numUsers users")
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/81f56f6a/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 8037ade..e56124d 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
@@ -18,11 +18,12 @@
import io.gatling.core.Predef._
import io.gatling.http.Predef._
- import org.apache.usergrid.settings.Headers
+ import org.apache.usergrid.datagenerators.FeederGenerator
+ import org.apache.usergrid.settings.{Settings, Headers}
object ConnectionScenarios {
- val postConnection = exec(
+ val postUserConnection = exec(
http("POST connection")
.post("/users/${user1}/likes/users/${user2}")
.headers(Headers.jsonAuthorized)
@@ -36,5 +37,21 @@ import io.gatling.http.Predef._
.headers(Headers.jsonAuthorized)
.check(status.is(200))
)
+ val entityNameFeeder = FeederGenerator.generateEntityNameFeeder("device", Settings.numEntities)
+ val createScenario = scenario("Create Connections")
+ .feed(Settings.userFeeder)
+ .exec(TokenScenarios.getUserToken)
+ .exec( UserScenarios.getUserByUsername)
+ .repeat(2){
+ feed(entityNameFeeder)
+ .exec( DeviceScenarios.postDeviceWithNotifier)
+ .exec(ConnectionScenarios.postUserToDeviceConnection)
+ }
+ .exec(session => {
+ // print the Session for debugging, don't do that on real Simulations
+ println(session)
+ session
+ })
+ .exec( )
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/81f56f6a/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 b248260..a96cb61 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
@@ -68,10 +68,9 @@ object NotificationScenarios {
)
val numEntities:Int = Settings.numUsers * 3 * Settings.duration
- val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
val createScenario = scenario("Create Push Notification")
- .feed(userFeeder)
+ .feed(Settings.userFeeder)
.exec(TokenScenarios.getUserToken)
.exec( UserScenarios.getUserByUsername)
.repeat(2){
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/81f56f6a/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 03a4200..b595c9d 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
@@ -32,6 +32,8 @@ object Settings {
val baseAppUrl = baseUrl + "/" + org + "/" + app
val httpConf = http.baseURL(baseAppUrl)
+ val skipSetup:Boolean = System.getProperty("skipSetup") == "true"
+
// Simulation settings
var numUsers:Int = Integer.getInteger("numUsers", 10).toInt
@@ -64,4 +66,7 @@ object Settings {
val constantUsers:Int = Settings.numUsers/Settings.duration
println(s"Will inject $constantUsers users per sec")
+ val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(numUsers, userLocationRadius, centerLatitude, centerLongitude)
+
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/81f56f6a/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 50a4728..fb2f8cf 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
@@ -33,13 +33,16 @@ import scala.concurrent.duration._
*/
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
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/81f56f6a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConnectionsSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConnectionsSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConnectionsSimulation.scala
new file mode 100644
index 0000000..efc3c69
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConnectionsSimulation.scala
@@ -0,0 +1,53 @@
+/*
+ *
+ * * 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.{ConnectionScenarios, NotificationScenarios}
+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.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"))
+ )
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/81f56f6a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GeoProfileSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GeoProfileSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GeoProfileSimulation.scala
deleted file mode 100644
index b8b8839..0000000
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GeoProfileSimulation.scala
+++ /dev/null
@@ -1,33 +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.http.Predef._
-import org.apache.usergrid.scenarios.{OrganizationScenarios, UserScenarios}
-import org.apache.usergrid.settings.Settings
-
-/**
- * Classy class class.
- */
-class GeoProfileSimulation extends Simulation {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/81f56f6a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostDevicesSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostDevicesSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostDevicesSimulation.scala
deleted file mode 100755
index d7c6dd8..0000000
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostDevicesSimulation.scala
+++ /dev/null
@@ -1,45 +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.http.Predef._
- import org.apache.usergrid.datagenerators.FeederGenerator
- import org.apache.usergrid.scenarios.DeviceScenarios
- import org.apache.usergrid.settings.Settings
- import scala.concurrent.duration._
-
-class PostDevicesSimulation extends Simulation {
-
- // Target settings
- val httpConf = Settings.httpConf
-
- // Simulation settings
- val numUsers:Int = Settings.numUsers
- val numEntities:Int = Settings.numEntities
- val rampTime:Int = Settings.rampTime
- val throttle:Int = Settings.throttle
-
- val feeder = FeederGenerator.generateEntityNameFeeder("device", numEntities)
-
- val scnToRun = scenario("POST device")
- .feed(feeder)
- .exec(DeviceScenarios.postDeviceWithNotifier)
-
- setUp(scnToRun.inject(atOnceUsers(numUsers)).throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf))
-
-}
[28/42] incubator-usergrid git commit: Netbeans needs this for
run-single-test functionality.
Posted by to...@apache.org.
Netbeans needs this for run-single-test functionality.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b7f81efc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b7f81efc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b7f81efc
Branch: refs/heads/es-type-updates
Commit: b7f81efc53530cfe87d70b8bf05a5fca81e1ab63
Parents: efc0ec3
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Nov 7 09:58:37 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Nov 7 09:58:37 2014 -0500
----------------------------------------------------------------------
stack/core/pom.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b7f81efc/stack/core/pom.xml
----------------------------------------------------------------------
diff --git a/stack/core/pom.xml b/stack/core/pom.xml
index a303d17..98c7628 100644
--- a/stack/core/pom.xml
+++ b/stack/core/pom.xml
@@ -189,6 +189,7 @@
<exclude>**/*Test.java</exclude>
</excludes>
</configuration>
+ <version>2.15</version>
</plugin>
<plugin>
[15/42] incubator-usergrid git commit: update readme
Posted by to...@apache.org.
update readme
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/f79b5e9a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/f79b5e9a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/f79b5e9a
Branch: refs/heads/es-type-updates
Commit: f79b5e9a7ddce7caa7424d0b8eee345ae6088d50
Parents: b7579d0
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 10:10:45 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 10:10:45 2014 -0700
----------------------------------------------------------------------
stack/loadtests/README.md | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f79b5e9a/stack/loadtests/README.md
----------------------------------------------------------------------
diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md
index 6e7d66b..54f358b 100644
--- a/stack/loadtests/README.md
+++ b/stack/loadtests/README.md
@@ -16,6 +16,8 @@ Gatling will run through mvn
>mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DnumUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dsimulation=all
Setting the rampTime => Injects a given number of users with a linear ramp over a given duration.
+
+ Values for simulation are 'all','connections'
Also see http://gatling.io/docs/2.0.2/general/simulation_setup.html
[35/42] incubator-usergrid git commit: changing numUsers to rampUsers
Posted by to...@apache.org.
changing numUsers to rampUsers
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4436ead4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4436ead4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4436ead4
Branch: refs/heads/es-type-updates
Commit: 4436ead4adf59ed9e7f67e9f03f54861e06470f2
Parents: 7c14d83
Author: Shawn Feldman <sf...@apache.org>
Authored: Fri Nov 7 16:18:33 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Fri Nov 7 16:18:33 2014 -0700
----------------------------------------------------------------------
stack/loadtests/README.md | 4 ++--
.../org/apache/usergrid/scenarios/NotificationScenarios.scala | 6 +++---
.../src/main/scala/org/apache/usergrid/settings/Settings.scala | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4436ead4/stack/loadtests/README.md
----------------------------------------------------------------------
diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md
index a17813e..f5f72ad 100644
--- a/stack/loadtests/README.md
+++ b/stack/loadtests/README.md
@@ -6,7 +6,7 @@ Gatling will run through mvn
1. execute mvn gatling:execute with these options
*Required
- > -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd} -Dgatling.simulationClass={simulationFQDN}
+ > -Dthrottle={maxReqsSec} -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DrampUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd} -Dgatling.simulationClass={simulationFQDN}
*Addional optional settings
@@ -15,7 +15,7 @@ Gatling will run through mvn
skipSetup will skip the setup steps
So running will look something like this
- >mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DnumUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dgatling.simulationClass=org.apache.usergrid.simulations.AppSimulation
+ >mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DrampUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dgatling.simulationClass=org.apache.usergrid.simulations.AppSimulation
Setting the users and duration => Injects a given number of users with a linear ramp over a given duration. users must be greater than duration
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4436ead4/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 ed1610f..c616472 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,14 +67,14 @@ object NotificationScenarios {
.check(status.is(200))
)
- val numEntities:Int = Settings.numUsers * 2
+ val userFeeder = Settings.getUserFeeder
val createScenario = scenario("Create Push Notification")
- .feed(Settings.getUserFeeder)
+ .feed(userFeeder)
.exec(TokenScenarios.getUserToken)
.exec( UserScenarios.getUserByUsername)
.repeat(2){
- feed(FeederGenerator.generateEntityNameFeeder("device", numEntities))
+ feed(FeederGenerator.generateEntityNameFeeder("device", Settings.numDevices))
.exec( DeviceScenarios.postDeviceWithNotifier)
.exec(ConnectionScenarios.postUserToDeviceConnection)
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4436ead4/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 aec7cfc..67faccd 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
@@ -41,7 +41,7 @@ object Settings {
var numUsers:Int = constantUsers * duration
val numEntities:Int = Integer.getInteger("numEntities", 5000).toInt
- val numDevices:Int = Integer.getInteger("numDevices", 2000).toInt
+ val numDevices:Int = Integer.getInteger("numDevices", 4000).toInt
val rampTime:Int = Integer.getInteger("rampTime", 0).toInt // in seconds
val throttle:Int = Integer.getInteger("throttle", 50).toInt // in seconds
[06/42] incubator-usergrid git commit: change default simulation
Posted by to...@apache.org.
change default 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/00d8347b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/00d8347b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/00d8347b
Branch: refs/heads/es-type-updates
Commit: 00d8347b9cacd97d78e664b5bde520e7d757dc67
Parents: 7d0cd3b
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 08:27:21 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 08:27:21 2014 -0700
----------------------------------------------------------------------
.../main/scala/org/apache/usergrid/settings/Settings.scala | 7 ++++++-
stack/loadtests/src/test/scala/Engine.scala | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/00d8347b/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 90dd41d..30cd4ab 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,7 +33,8 @@ object Settings {
val httpConf = http.baseURL(baseAppUrl)
// Simulation settings
- val numUsers:Int = Integer.getInteger("numUsers", 10).toInt
+ var numUsers:Int = Integer.getInteger("numUsers", 10).toInt
+
val numEntities:Int = Integer.getInteger("numEntities", 5000).toInt
val numDevices:Int = Integer.getInteger("numDevices", 2000).toInt
@@ -41,6 +42,10 @@ object Settings {
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
+ }
// Geolocation settings
val centerLatitude:Double = 37.442348 // latitude of center point
val centerLongitude:Double = -122.138268 // longitude of center point
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/00d8347b/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 00f1004..543674a 100644
--- a/stack/loadtests/src/test/scala/Engine.scala
+++ b/stack/loadtests/src/test/scala/Engine.scala
@@ -26,7 +26,7 @@ object Engine extends App {
props.requestBodiesDirectory(IDEPathHelper.requestBodiesDirectory.toString)
props.binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString)
- props.simulationClass("org.apache.usergrid.simulations.PushNotificationTargetUserSimulation")
+ props.simulationClass("org.apache.usergrid.simulations.AppSimulation")
Gatling.fromMap(props.build)
}
[41/42] incubator-usergrid git commit: Finished CP cleanup
Posted by to...@apache.org.
Finished CP cleanup
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/1ea42f83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1ea42f83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1ea42f83
Branch: refs/heads/es-type-updates
Commit: 1ea42f834eadd99b545f6ae4e02b614f20afe936
Parents: 6ae1bef
Author: Todd Nine <tn...@apigee.com>
Authored: Mon Nov 10 16:20:41 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Mon Nov 10 16:20:41 2014 -0700
----------------------------------------------------------------------
.../apache/usergrid/corepersistence/CpRelationManager.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1ea42f83/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index 20309a7..561c269 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@ -619,8 +619,8 @@ public class CpRelationManager implements RelationManager {
}
- public Entity addToCollection( String collName, EntityRef itemRef,
- org.apache.usergrid.persistence.model.entity.Entity memberEntity, boolean connectBack )
+ public Entity addToCollection(final String collName, final EntityRef itemRef,
+ final org.apache.usergrid.persistence.model.entity.Entity memberEntity, final boolean connectBack )
throws Exception {
// don't fetch entity if we've already got one
@@ -646,12 +646,9 @@ public class CpRelationManager implements RelationManager {
applicationScope.getApplication(),
applicationScope.getApplication(),
CpNamingUtils.getCollectionScopeNameFromEntityType( itemRef.getType() ) );
- EntityCollectionManager memberMgr = managerCache.getEntityCollectionManager( memberScope );
//TODO, this double load should disappear once events are in
Id entityId = new SimpleId( itemRef.getUuid(), itemRef.getType() );
- org.apache.usergrid.persistence.model.entity.Entity memberEntity =
- ((CpEntityManager)em).load( new CpEntityManager.EntityScope( memberScope, entityId));
if ( memberEntity == null ) {
throw new RuntimeException(
[40/42] incubator-usergrid git commit: Merge remote-tracking branch
'origin/two-dot-o' into es-type-updates
Posted by to...@apache.org.
Merge remote-tracking branch 'origin/two-dot-o' into es-type-updates
Conflicts:
stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/6ae1bef6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/6ae1bef6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/6ae1bef6
Branch: refs/heads/es-type-updates
Commit: 6ae1bef66e3061f1dae84e7913b6e72475c9090e
Parents: dd84f99 c282d80
Author: Todd Nine <tn...@apigee.com>
Authored: Mon Nov 10 16:20:07 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Mon Nov 10 16:20:07 2014 -0700
----------------------------------------------------------------------
stack/core/pom.xml | 1 +
.../corepersistence/CpEntityManager.java | 5 +-
.../corepersistence/CpRelationManager.java | 22 ++-
.../index/impl/ElasticSearchResource.java | 30 +++-
stack/loadtests/README.md | 27 +++
stack/loadtests/pom.xml | 10 --
.../datagenerators/EntityDataGenerator.scala | 28 ++-
.../datagenerators/FeederGenerator.scala | 52 +++++-
.../org/apache/usergrid/helpers/Setup.scala | 178 +++++++++++++++++++
.../scenarios/ConnectionScenarios.scala | 29 ++-
.../usergrid/scenarios/EntityScenarios.scala | 65 +++++++
.../scenarios/NotificationScenarios.scala | 22 +--
.../usergrid/scenarios/UserScenarios.scala | 33 +++-
.../org/apache/usergrid/settings/Settings.scala | 30 +++-
.../usergrid/simulations/AppSimulation.scala | 44 +++++
.../simulations/ConnectionsSimulation.scala | 53 ++++++
.../PostCustomEntitySimulation.scala | 61 +++++++
.../simulations/PostDevicesSimulation.scala | 45 -----
.../PushNotificationTargetUserSimulation.scala | 22 ++-
.../usergrid/simulations/SetupSimulation.scala | 45 +++++
stack/loadtests/src/test/scala/Engine.scala | 4 +-
.../services/users/devices/DevicesService.java | 4 +-
.../usergrid/cassandra/CassandraResource.java | 138 +++++++++++---
23 files changed, 812 insertions(+), 136 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6ae1bef6/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6ae1bef6/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --cc stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index c822679,a47ce8c..20309a7
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@@ -689,8 -675,8 +707,10 @@@ public class CpRelationManager implemen
// headEntityScope.getName()});
if ( connectBack && collection != null && collection.getLinkedCollection() != null ) {
+ getRelationManager( itemEntity ).addToCollection(
+ collection.getLinkedCollection(), headEntity, cpHeadEntity, false );
+ getRelationManager( itemEntity ).addToCollection(
+ collection.getLinkedCollection(), headEntity, false );
}
return itemEntity;
[27/42] 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 to...@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/efc0ec37
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/efc0ec37
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/efc0ec37
Branch: refs/heads/es-type-updates
Commit: efc0ec37a775fdc6b955e0e7b4e5542f513a56b1
Parents: 02c9f42 19179bc
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Nov 7 08:33:24 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Nov 7 08:33:24 2014 -0500
----------------------------------------------------------------------
portal/config.js | 3 +-
stack/awscluster/assembly.xml | 8 +-
stack/awscluster/pom.xml | 379 ++++++-----
.../main/dist/init_instance/create_keyspaces.sh | 2 +
.../src/main/dist/init_instance/create_raid0.sh | 9 +-
.../main/dist/init_instance/init_db_server.sh | 15 +-
.../main/dist/init_instance/init_es_server.sh | 8 +-
.../dist/init_instance/init_graphite_server.sh | 2 +
.../dist/init_instance/init_opscenter_server.sh | 287 +++++++++
.../main/dist/init_instance/init_rest_server.sh | 66 +-
.../dist/init_instance/install_cassandra.sh | 22 +-
.../dist/init_instance/install_elasticsearch.sh | 57 +-
.../init_instance/install_opscenter_agent.sh | 12 +-
stack/awscluster/src/main/dist/update.sh | 16 +-
.../main/groovy/configure_elasticsearch.groovy | 84 ++-
.../groovy/configure_opscenter_agent.groovy | 4 +-
.../groovy/configure_opscenter_cassandra.groovy | 120 ++++
.../groovy/configure_opscenter_usergrid.groovy | 58 ++
.../src/main/groovy/configure_usergrid.groovy | 19 +-
stack/awscluster/ugcluster-cf.json | 321 +++++++++-
.../main/resources/usergrid-default.properties | 5 +-
stack/core/pom.xml | 15 +-
.../corepersistence/CpEntityManagerFactory.java | 22 +
.../corepersistence/CpManagerCache.java | 12 +-
.../usergrid/corepersistence/CpSetup.java | 5 +-
.../usergrid/corepersistence/GuiceModule.java | 8 +
.../HybridEntityManagerFactory.java | 19 +
.../migration/GraphShardVersionMigration.java | 43 ++
.../corepersistence/migration/Versions.java | 37 ++
.../persistence/EntityManagerFactory.java | 18 +
.../cassandra/EntityManagerFactoryImpl.java | 19 +
.../usergrid/ConcurrentCoreIteratorITSuite.java | 3 +-
.../usergrid/ConcurrentCoreTestSuite.java | 4 +-
.../org/apache/usergrid/CoreITSetupImpl.java | 4 +-
.../java/org/apache/usergrid/CoreITSuite.java | 5 +-
.../java/org/apache/usergrid/CoreTestSuite.java | 4 +-
.../batch/job/AbstractSchedulerRuntimeIT.java | 9 +-
.../CpEntityDeleteListenerTest.java | 3 +-
.../CpEntityIndexDeleteListenerTest.java | 3 -
.../SimpleIndexBucketLocatorImplTest.java | 177 ------
.../SimpleIndexShardLocatorImplTest.java | 177 ++++++
stack/corepersistence/collection/pom.xml | 7 +-
.../impl/CollectionPrefixedKey.java | 100 +++
.../impl/CollectionScopedRowKeySerializer.java | 25 +-
.../MvccEntitySerializationStrategyImpl.java | 88 ++-
.../MvccLogEntrySerializationStrategyImpl.java | 66 +-
.../serialization/impl/SerializationModule.java | 2 +-
.../UniqueValueSerializationStrategyImpl.java | 31 +-
.../collection/CollectionContextImplTest.java | 3 -
.../EntityCollectionManagerFactoryTest.java | 6 +-
.../collection/EntityCollectionManagerIT.java | 4 +-
.../EntityCollectionManagerStressTest.java | 6 +-
.../EntityCollectionManagerSyncIT.java | 4 +-
.../collection/guice/MigrationManagerRule.java | 4 +-
.../collection/guice/TestCollectionModule.java | 3 +-
.../collection/guice/TestModule.java | 48 --
...niqueValueSerializationStrategyImplTest.java | 4 +-
.../stage/write/WriteOptimisticVerifyTest.java | 2 +-
.../mvcc/stage/write/WriteUniqueVerifyIT.java | 4 +-
.../mvcc/stage/write/WriteUniqueVerifyTest.java | 4 +-
...MvccEntitySerializationStrategyImplTest.java | 14 +-
.../impl/MvccLESSTransientTest.java | 78 ++-
...ccLogEntrySerializationStrategyImplTest.java | 4 +-
.../impl/ScopedRowKeySerializerTest.java | 18 +-
stack/corepersistence/common/pom.xml | 15 +-
.../core/astyanax/BucketScopedRowKey.java | 114 ++++
.../astyanax/BucketScopedRowKeySerializer.java | 91 +++
.../core/astyanax/CassandraConfig.java | 6 +
.../core/astyanax/CassandraConfigImpl.java | 23 +
.../persistence/core/astyanax/CassandraFig.java | 14 +
.../persistence/core/astyanax/ColumnSearch.java | 13 +-
.../core/astyanax/CompositeFieldSerializer.java | 1 +
.../core/astyanax/IdRowCompositeSerializer.java | 1 +
.../core/astyanax/MultiRowColumnIterator.java | 236 +++++--
.../core/astyanax/MultiTennantColumnFamily.java | 8 +-
.../OrganizationScopedRowKeySerializer.java | 85 ---
.../persistence/core/astyanax/ScopedRowKey.java | 13 +-
.../core/astyanax/ScopedRowKeySerializer.java | 83 +++
.../astyanax/StringRowCompositeSerializer.java | 68 ++
.../persistence/core/guice/CommonModule.java | 43 +-
.../persistence/core/guice/CurrentImpl.java | 42 ++
.../persistence/core/guice/PreviousImpl.java | 42 ++
.../persistence/core/guice/ProxyImpl.java | 42 ++
.../persistence/core/migration/Migration.java | 36 --
.../core/migration/MigrationException.java | 37 --
.../core/migration/MigrationManager.java | 34 -
.../core/migration/MigrationManagerFig.java | 22 -
.../core/migration/MigrationManagerImpl.java | 196 ------
.../core/migration/data/DataMigration.java | 84 +++
.../migration/data/DataMigrationException.java | 39 ++
.../migration/data/DataMigrationManager.java | 55 ++
.../data/DataMigrationManagerImpl.java | 258 ++++++++
.../data/MigrationInfoSerialization.java | 66 ++
.../data/MigrationInfoSerializationImpl.java | 178 ++++++
.../core/migration/schema/Migration.java | 36 ++
.../migration/schema/MigrationException.java | 37 ++
.../core/migration/schema/MigrationManager.java | 34 +
.../migration/schema/MigrationManagerFig.java | 22 +
.../migration/schema/MigrationManagerImpl.java | 196 ++++++
.../core/shard/ExpandingShardLocator.java | 95 +++
.../persistence/core/shard/ShardLocator.java | 77 +++
.../persistence/core/shard/StringHashUtils.java | 54 ++
.../core/astyanax/ColumnNameIteratorTest.java | 6 +
.../MultiKeyColumnNameIteratorTest.java | 6 +
.../astyanax/MultiRowColumnIteratorTest.java | 42 ++
.../core/cassandra/CassandraRule.java | 2 +-
.../persistence/core/cassandra/ITRunner.java | 60 --
.../core/guice/MigrationManagerRule.java | 4 +-
.../core/guice/TestCommonModule.java | 34 +
.../persistence/core/guice/TestModule.java | 48 ++
.../data/DataMigrationManagerImplTest.java | 220 +++++++
.../data/MigrationInfoSerializationTest.java | 105 ++++
.../core/shard/ExpandingShardLocatorTest.java | 65 ++
.../core/shard/ShardLocatorTest.java | 64 ++
.../persistence/core/test/ITRunner.java | 119 ++++
.../persistence/core/test/UseModules.java | 69 ++
stack/corepersistence/graph/pom.xml | 15 +-
.../persistence/graph/guice/GraphModule.java | 34 +-
.../graph/impl/GraphManagerImpl.java | 13 +-
.../graph/impl/stage/EdgeMetaRepairImpl.java | 3 +-
.../impl/stage/NodeDeleteListenerImpl.java | 3 +-
.../EdgeMetadataSerialization.java | 2 +-
.../graph/serialization/NodeSerialization.java | 2 +-
.../impl/EdgeMetadataSerializationImpl.java | 476 --------------
.../EdgeMetadataSerializationProxyImpl.java | 276 ++++++++
.../impl/EdgeMetadataSerializationV1Impl.java | 478 ++++++++++++++
.../impl/EdgeMetadataSerializationV2Impl.java | 627 +++++++++++++++++++
.../impl/NodeSerializationImpl.java | 36 +-
.../impl/shard/EdgeColumnFamilies.java | 14 +-
.../impl/shard/EdgeShardSerialization.java | 2 +-
.../count/NodeShardCounterSerialization.java | 2 +-
.../NodeShardCounterSerializationImpl.java | 10 +-
.../impl/shard/impl/EdgeSearcher.java | 18 +-
.../shard/impl/EdgeShardSerializationImpl.java | 14 +-
.../impl/ShardedEdgeSerializationImpl.java | 76 +--
.../impl/shard/impl/ShardsColumnIterator.java | 21 +-
.../shard/impl/SizebasedEdgeColumnFamilies.java | 34 +-
.../impl/shard/impl/SourceEdgeSearcher.java | 22 -
.../serialize/EdgeShardRowKeySerializer.java | 2 +
.../shard/impl/serialize/RowSerializer.java | 2 +-
.../shard/impl/serialize/RowTypeSerializer.java | 3 +-
.../graph/CommittedGraphManagerIT.java | 4 +-
.../persistence/graph/GraphManagerIT.java | 9 +-
.../persistence/graph/GraphManagerLoadTest.java | 4 +-
.../graph/GraphManagerShardConsistencyIT.java | 5 +-
.../graph/GraphManagerShardingIT.java | 4 +-
.../graph/GraphManagerStressTest.java | 4 +-
.../usergrid/persistence/graph/SimpleTest.java | 4 +-
.../graph/StorageGraphManagerIT.java | 4 +-
.../graph/guice/TestGraphModule.java | 2 +-
.../graph/impl/EdgeDeleteListenerTest.java | 6 +-
.../graph/impl/NodeDeleteListenerTest.java | 6 +-
.../graph/impl/stage/EdgeDeleteRepairTest.java | 4 +-
.../graph/impl/stage/EdgeMetaRepairTest.java | 6 +-
.../EdgeMetaDataSerializationProxyV1Test.java | 85 +++
.../EdgeMetaDataSerializationProxyV2Test.java | 83 +++
.../EdgeMetaDataSerializationV1Test.java | 69 ++
.../EdgeMetaDataSerializationV2Test.java | 52 ++
.../EdgeMetadataSerializationTest.java | 33 +-
.../EdgeSerializationChopTest.java | 4 +-
.../serialization/EdgeSerializationTest.java | 50 +-
.../serialization/NodeSerializationTest.java | 10 +-
.../PermanentSerializationTest.java | 9 +-
.../graph/serialization/TestCount.java | 52 +-
.../impl/shard/EdgeShardSerializationTest.java | 35 +-
.../impl/shard/NodeShardAllocationTest.java | 15 +-
.../impl/shard/NodeShardCacheTest.java | 118 ++--
.../impl/shard/ShardEntryGroupTest.java | 57 +-
.../impl/shard/ShardGroupCompactionTest.java | 181 +++---
.../shard/count/NodeShardApproximationTest.java | 18 +-
.../NodeShardCounterSerializationTest.java | 10 +-
.../shard/impl/ShardEntryGroupIteratorTest.java | 9 +-
...rceDirectedEdgeDescendingComparatorTest.java | 4 +-
.../1.4-UG/_maven.repositories | 4 -
.../1.4-UG/jukito-build-tools-1.4-UG.jar | Bin 4603 -> 0 bytes
.../1.4-UG/jukito-build-tools-1.4-UG.pom | 13 -
.../jukito-build-tools/maven-metadata-local.xml | 12 -
.../jukito-parent/1.4-UG/_maven.repositories | 3 -
.../1.4-UG/jukito-parent-1.4-UG.pom | 313 ---------
.../jukito-parent/maven-metadata-local.xml | 12 -
.../jukito-samples/1.4-UG/_maven.repositories | 4 -
.../1.4-UG/jukito-samples-1.4-UG.jar | Bin 5103 -> 0 bytes
.../1.4-UG/jukito-samples-1.4-UG.pom | 33 -
.../jukito-samples/maven-metadata-local.xml | 12 -
.../jukito/jukito/1.4-UG/_maven.repositories | 5 -
.../jukito/1.4-UG/jukito-1.4-UG-sources.jar | Bin 30660 -> 0 bytes
.../org/jukito/jukito/1.4-UG/jukito-1.4-UG.jar | Bin 42832 -> 0 bytes
.../org/jukito/jukito/1.4-UG/jukito-1.4-UG.pom | 93 ---
.../org/jukito/jukito/maven-metadata-local.xml | 12 -
stack/corepersistence/map/pom.xml | 6 -
.../persistence/map/guice/MapModule.java | 2 +-
.../persistence/map/impl/MapSerialization.java | 2 +-
.../map/impl/MapSerializationImpl.java | 97 ++-
.../persistence/map/MapManagerTest.java | 4 +-
.../persistence/map/guice/TestMapModule.java | 2 +-
stack/corepersistence/pom.xml | 4 +-
stack/corepersistence/queryindex/pom.xml | 11 -
.../usergrid/persistence/index/IndexFig.java | 14 +-
.../index/impl/EsEntityIndexBatchImpl.java | 23 +-
.../index/impl/EsEntityIndexImpl.java | 109 ++--
.../persistence/index/impl/EsProvider.java | 235 +++----
.../persistence/index/impl/FailureMonitor.java | 41 ++
.../index/impl/FailureMonitorImpl.java | 101 +++
.../index/guice/TestIndexModule.java | 2 +-
.../index/impl/CorePerformanceIT.java | 2 +-
.../index/impl/ElasticSearchResource.java | 171 +++++
.../index/impl/ElasticSearchRule.java | 50 --
.../impl/EntityConnectionIndexImplTest.java | 7 +-
.../persistence/index/impl/EntityIndexTest.java | 10 +-
.../persistence/index/impl/EsRunner.java | 51 ++
.../src/test/resources/usergrid-UNIT.properties | 2 +-
stack/corepersistence/queue/pom.xml | 9 -
.../usergrid/persistence/queue/QueueFig.java | 4 +-
.../persistence/queue/QueueManagerTest.java | 6 +-
.../queue/guice/TestQueueModule.java | 2 +-
stack/loadtests/README.md | 27 +
stack/loadtests/pom.xml | 18 +-
.../datagenerators/EntityDataGenerator.scala | 26 +-
.../datagenerators/FeederGenerator.scala | 15 +-
.../org/apache/usergrid/helpers/Setup.scala | 168 +++++
.../scenarios/ApplicationScenarios.scala | 10 +-
.../scenarios/ConnectionScenarios.scala | 29 +-
.../usergrid/scenarios/DeviceScenarios.scala | 8 +-
.../usergrid/scenarios/EntityScenarios.scala | 65 ++
.../usergrid/scenarios/GeoScenarios.scala | 6 +-
.../scenarios/NotificationScenarios.scala | 25 +-
.../usergrid/scenarios/NotifierScenarios.scala | 20 +-
.../scenarios/OrganizationScenarios.scala | 27 +-
.../usergrid/scenarios/TokenScenarios.scala | 29 +-
.../usergrid/scenarios/UserScenarios.scala | 28 +-
.../org/apache/usergrid/settings/Settings.scala | 32 +-
.../usergrid/simulations/AppSimulation.scala | 52 ++
.../simulations/ConnectionsSimulation.scala | 53 ++
.../PostCustomEntitySimulation.scala | 61 ++
.../simulations/PostDevicesSimulation.scala | 45 --
...PushNotificationTargetDeviceSimulation.scala | 57 --
.../PushNotificationTargetUserSimulation.scala | 59 +-
.../src/test/resources/logback-test.xml | 1 -
stack/loadtests/src/test/scala/Engine.scala | 4 +-
stack/pom.xml | 25 +-
.../apache/usergrid/rest/SystemResource.java | 94 ++-
.../java/org/apache/usergrid/rest/ITSetup.java | 8 +-
.../org/apache/usergrid/rest/RestITSuite.java | 4 +-
.../org/apache/usergrid/ServiceITSetupImpl.java | 1 +
.../org/apache/usergrid/ServiceITSuite.java | 3 +-
stack/test-utils/pom.xml | 7 +
.../org/apache/usergrid/ElasticSearchMain.java | 107 ----
.../apache/usergrid/ElasticSearchResource.java | 178 ------
248 files changed, 8298 insertions(+), 3567 deletions(-)
----------------------------------------------------------------------
[14/42] incubator-usergrid git commit: update reamde
Posted by to...@apache.org.
update reamde
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b7579d0c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b7579d0c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b7579d0c
Branch: refs/heads/es-type-updates
Commit: b7579d0cbbb80fd22b8e9cabb6ded29d5431e3b8
Parents: 1589d04
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 10:09:19 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 10:09:19 2014 -0700
----------------------------------------------------------------------
stack/loadtests/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b7579d0c/stack/loadtests/README.md
----------------------------------------------------------------------
diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md
index 8206a90..6e7d66b 100644
--- a/stack/loadtests/README.md
+++ b/stack/loadtests/README.md
@@ -10,10 +10,10 @@ Gatling will run through mvn
*Addional optional settings
- >-DpushNotifier={notifierName} -DpushProvider=noop
+ >-DpushNotifier={notifierName} -DpushProvider={noop_apns_or_gcm} -Dsimulation={simulationNameOrAll}
So running will look something like this
- >mvn gatling:execute -Dthrottle=100 -Dduration={durationInSecs} -Dorg={org} -Dapp={appName} -Dbaseurl={uriNoProceedingSlash} -DnumEntities={numberOfEntitiesYouWantToCreateInteger} -DnumUsers={totalUsersInteger} -DrampTime={rampTimeIntegerSeconds} -DadminUser={username} -DadminPassword={pwd}
+ >mvn gatling:execute -Dthrottle=100 -Dduration=300 -Dorg=usergrid -Dapp=load -Dbaseurl=http://load.usergrid.com -DnumEntities=300 -DnumUsers=600 -DrampTime=30 -DadminUser=usergrid -DadminPassword=test -Dsimulation=all
Setting the rampTime => Injects a given number of users with a linear ramp over a given duration.
[25/42] incubator-usergrid git commit: updated engine - specify class
to run, added custom entity simulation
Posted by to...@apache.org.
updated engine - specify class to run, added custom entity 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/19179bc9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/19179bc9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/19179bc9
Branch: refs/heads/es-type-updates
Commit: 19179bc95968e6f7644787c65c522aa6fbea34a4
Parents: fadee4a
Author: Rod Simpson <ro...@apigee.com>
Authored: Thu Nov 6 17:45:41 2014 -0700
Committer: Rod Simpson <ro...@apigee.com>
Committed: Thu Nov 6 17:45:41 2014 -0700
----------------------------------------------------------------------
.../datagenerators/EntityDataGenerator.scala | 21 +++++++
.../datagenerators/FeederGenerator.scala | 9 +++
.../usergrid/scenarios/EntityScenarios.scala | 65 ++++++++++++++++++++
.../PostCustomEntitySimulation.scala | 61 ++++++++++++++++++
stack/loadtests/src/test/scala/Engine.scala | 4 +-
5 files changed, 158 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/19179bc9/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
index 6917930..2481737 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
@@ -59,4 +59,25 @@ object EntityDataGenerator {
)
}
+ def generateCustomEntity(entityName: String): Map[String,String] = {
+
+ return Map(
+ "name" -> entityName,
+ "address" -> Utils.generateRandomInt(10000, 1000000).toString,
+ "city" -> Utils.generateRandomInt(10000, 1000000).toString,
+ "state" -> Utils.generateRandomInt(10000, 1000000).toString,
+ "zip" -> Utils.generateRandomInt(10000, 1000000).toString,
+ "phone" -> Utils.generateRandomInt(10000, 1000000).toString,
+ "businessname" -> Utils.generateRandomInt(0, 1).toString,
+ "menu" -> Utils.generateRandomInt(1, 1000000).toString,
+ "specials" -> Utils.generateRandomInt(1, 1000000).toString,
+ "profile" -> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
+ "description" -> "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
+ "directions" -> Utils.generateRandomInt(18, 65).toString,
+ "atmosphere" -> Utils.generateRandomInt(48, 84).toString,
+ "bar" -> Utils.generateRandomInt(120, 350).toString,
+ "tables" -> Utils.generateRandomInt(50, 100000).toString,
+ "outdoor" -> Utils.generateRandomInt(50, 100000).toString
+ )
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/19179bc9/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
index 03ba0f6..8832bd7 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
@@ -113,4 +113,13 @@ object FeederGenerator {
}
+ def generateCustomEntityFeeder(numEntities: Int): Array[Map[String, String]] = {
+ var entityArray: ArrayBuffer[Map[String, String]] = new ArrayBuffer[Map[String, String]]
+ for (entityCount <- 1 to numEntities) {
+ var entity: Map[String, String] = EntityDataGenerator.generateCustomEntity(entityCount.toString)
+ entityArray += entity
+ }
+ return entityArray.toArray
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/19179bc9/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityScenarios.scala
new file mode 100644
index 0000000..35b80d7
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityScenarios.scala
@@ -0,0 +1,65 @@
+/*
+ * 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.scenarios
+
+import io.gatling.core.Predef._
+import io.gatling.http.Predef._
+import org.apache.usergrid.datagenerators.{EntityDataGenerator, FeederGenerator}
+import org.apache.usergrid.settings.{Headers, Utils, Settings}
+
+/**
+ * Provides CRUD methods for custom entities
+ *
+ *
+ *
+ */
+object EntityScenarios {
+
+ val getEntity = exec(
+ http("GET custom entityr")
+ .get(Settings.baseUrl+"/${collectionType}/${entityName}")
+ .headers(Headers.jsonAuthorized)
+ .check(status.is(200))
+ )
+
+ val putEntity = exec(
+ http("Put custom entity")
+ .put(Settings.baseUrl+"/${collectionType}/${entityName}")
+ .body(StringBody("{\"address\":\""+Utils.generateRandomInt(1, Settings.numEntities)+"\",\"phone\":\""+Utils.generateRandomInt(1, Settings.numEntities)+"\"}}"))
+ .headers(Headers.jsonAuthorized)
+ .check(status.is(200))
+ )
+
+
+ val deleteEntity = exec(
+ http("DELETE custom entityr")
+ .get(Settings.baseUrl+"/${collectionType}/${entityName}")
+ .headers(Headers.jsonAuthorized)
+ .check(status.is(200))
+ )
+
+ val postEntity = exec(
+ http("Post custom entity")
+ //.post(Settings.baseUrl+"/${collectionType}")
+ .post(Settings.baseUrl+"/restaurants")
+ //.body(StringBody(EntityDataGenerator.generateCustomEntity("/${entityName}").toString()))
+ .body(StringBody("{\"property\":\"fred\"}"))
+ .headers(Headers.jsonAuthorized)
+ .check(status.is(200))
+ )
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/19179bc9/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostCustomEntitySimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostCustomEntitySimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostCustomEntitySimulation.scala
new file mode 100644
index 0000000..f5523b1
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PostCustomEntitySimulation.scala
@@ -0,0 +1,61 @@
+/*
+ *
+ * * 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.scenario.Simulation
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.{EntityScenarios, TokenScenarios}
+import java.nio.file.{Paths, Files}
+import io.gatling.core.Predef._
+import org.apache.usergrid.datagenerators.FeederGenerator
+import scala.concurrent.duration._
+import org.apache.usergrid.settings.{Headers, Settings}
+
+/**
+ * Classy class class.
+ */
+class PostCustomEntitySimulation extends Simulation {
+
+ if(!Settings.skipSetup) {
+ println("Begin setup")
+ Setup.setupOrg()
+ Setup.setupApplication()
+ println("End Setup")
+ }else{
+ println("Skipping Setup")
+ }
+
+ val numEntities:Int = Settings.numEntities
+ val collectionType:String = "restaurants"
+ val rampTime:Int = Settings.rampTime
+ val throttle:Int = Settings.throttle
+ val feeder = FeederGenerator.generateCustomEntityFeeder(numEntities).queue
+ val httpConf = Settings.httpConf
+
+ val scnToRun = scenario("POST custom entities")
+ .feed(feeder)
+ .exec(TokenScenarios.getManagementToken)
+ .exec(EntityScenarios.postEntity)
+
+ setUp(scnToRun.inject(atOnceUsers(numEntities)).throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf)).maxDuration(Settings.duration)
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/19179bc9/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 543674a..48c93f8 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)
-
- props.simulationClass("org.apache.usergrid.simulations.AppSimulation")
+ val simName = if(System.getProperty("simulationClass")!=null) System.getProperty("simulationClass") else "AppSimulation";
+ props.simulationClass("org.apache.usergrid.simulations."+simName)
Gatling.fromMap(props.build)
}
[02/42] incubator-usergrid git commit: Merge branch
'key-row-sharding' of
https://git-wip-us.apache.org/repos/asf/incubator-usergrid into
key-row-sharding
Posted by to...@apache.org.
Merge branch 'key-row-sharding' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into key-row-sharding
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/1c0f9313
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1c0f9313
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1c0f9313
Branch: refs/heads/es-type-updates
Commit: 1c0f9313d27e96833bf1ade13b3cf0bf90a2dc25
Parents: 60055e4 c3f01dc
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Nov 5 14:31:08 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Nov 5 14:31:08 2014 -0700
----------------------------------------------------------------------
stack/awscluster/assembly.xml | 8 +-
stack/awscluster/pom.xml | 379 +++++++++++--------
.../main/dist/init_instance/init_rest_server.sh | 12 +
stack/awscluster/src/main/dist/update.sh | 16 +-
.../main/groovy/configure_elasticsearch.groovy | 47 ++-
.../src/main/groovy/configure_usergrid.groovy | 5 +-
stack/awscluster/ugcluster-cf.json | 10 +-
stack/pom.xml | 10 +-
8 files changed, 304 insertions(+), 183 deletions(-)
----------------------------------------------------------------------
[03/42] incubator-usergrid git commit: new setup methodology
Posted by to...@apache.org.
new setup methodology
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/cb43d817
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/cb43d817
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/cb43d817
Branch: refs/heads/es-type-updates
Commit: cb43d8173fcbf36b436c6f2c0c0570f0835188ac
Parents: 1c0f931
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Nov 5 17:21:06 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Nov 5 17:21:06 2014 -0700
----------------------------------------------------------------------
.../org/apache/usergrid/helpers/Setup.scala | 96 +++++++++++++-------
.../scenarios/NotificationScenarios.scala | 5 +-
.../usergrid/scenarios/UserScenarios.scala | 3 -
.../org/apache/usergrid/settings/Settings.scala | 3 +
.../PushNotificationTargetUserSimulation.scala | 2 +-
5 files changed, 68 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb43d817/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 8072be8..bb1ae51 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
@@ -20,8 +20,10 @@
package org.apache.usergrid.helpers
+import java.util
+
import com.fasterxml.jackson.databind.ObjectMapper
-import com.ning.http.client.AsyncHttpClient
+import com.ning.http.client.{ListenableFuture, AsyncHttpClient,Response}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.http.request.StringBody
@@ -29,26 +31,28 @@ import io.gatling.jsonpath.JsonPath
import org.apache.usergrid.datagenerators.FeederGenerator
import org.apache.usergrid.settings.{Settings, Headers}
+import scala.collection.mutable.ArrayBuffer
+
/**
* Classy class class.
*/
object Setup {
var token:String = null
+ val client = new AsyncHttpClient()
+
def setupOrg(): Integer = {
- val client = new AsyncHttpClient()
val createOrgPost = client
.preparePost(Settings.baseUrl + "/management/organizations")
- .setBody("{\"organization\":\"" + Settings.org + "\",\"username\":\"" + Settings.admin + "\",\"name\":\"" + Settings.admin + "\",\"email\":\"" + Settings.admin + "@apigee.com\",\"password\":\"" + Settings.password + "\"}")
- .setHeader("Cache-Control", "no-cache")
+ .setHeader("Cache-Control", "no-cache")
.setHeader("Content-Type", "application/json; charset=UTF-8")
-
- val orgResponse = createOrgPost.execute().get();
-
+ .setBody("{\"organization\":\"" + Settings.org + "\",\"username\":\"" + Settings.admin + "\",\"name\":\"" + Settings.admin + "\",\"email\":\"" + Settings.admin + "@apigee.com\",\"password\":\"" + Settings.password + "\"}")
+ .build()
+ val orgResponse = client.executeRequest(createOrgPost).get()
+ printResponse("POST ORG",orgResponse.getStatusCode,orgResponse.getResponseBody())
return orgResponse.getStatusCode
}
def setupApplication():Integer = {
- val client = new AsyncHttpClient()
val authToken = getManagementToken()
val createAppPost = client
@@ -57,16 +61,15 @@ object Setup {
.setHeader("Cache-Control", "no-cache")
.setHeader("Content-Type", "application/json; charset=UTF-8")
.setHeader("Authorization","Bearer "+authToken)
+ .build()
-
- val appResponse = createAppPost.execute().get();
-
+ val appResponse = client.executeRequest(createAppPost).get();
+ printResponse("POST Application",appResponse.getStatusCode, appResponse.getResponseBody())
return appResponse.getStatusCode
}
def setupNotifier():Integer = {
- val client = new AsyncHttpClient()
val authToken = getManagementToken()
val createNotifier = client
@@ -75,57 +78,82 @@ object Setup {
.setHeader("Cache-Control", "no-cache")
.setHeader("Content-Type", "application/json; charset=UTF-8")
.setHeader("Authorization","Bearer "+authToken)
+ .build()
- val notifierResponse = createNotifier.execute().get();
+ val notifierResponse = client.executeRequest(createNotifier).get();
+ printResponse("POST Notifier", notifierResponse.getStatusCode ,notifierResponse.getResponseBody())
return notifierResponse.getStatusCode
}
def getManagementToken():String = {
-// if(token==null) {
-
- val client = new AsyncHttpClient()
+ if(token == null) {
val getToken = client
.preparePost(Settings.baseUrl + "/management/token")
.setBody("{\"username\":\"" + Settings.admin + "\",\"password\":\"" + Settings.password + "\",\"grant_type\":\"password\"}")
.setHeader("Cache-Control", "no-cache")
.setHeader("Content-Type", "application/json; charset=UTF-8")
- val body = getToken.execute().get().getResponseBody()
+ .build()
+ val response = client.executeRequest(getToken).get()
val omapper = new ObjectMapper();
- val tree = omapper.readTree(body)
+ val tree = omapper.readTree(response.getResponseBody())
val node = tree.get("access_token");
- token = node.toString
-// }
+ token = node.asText()
+ println("Token is "+token)
+ }
return token
}
def setupUsers() = {
- val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers * Settings.duration, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
+ val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers * Settings.duration, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
+ val list:ArrayBuffer[ListenableFuture[Response]] = new ArrayBuffer[ListenableFuture[Response]]
userFeeder.foreach(user => {
- setupUser(user);
+ list += setupUser(user);
});
+ list.foreach(f => {
+ val response = f.get()
+ printResponse("Post user",response.getStatusCode,response.getResponseBody())
+ })
}
- def setupUser(user:Map[String,String]):Integer = {
-
- val client = new AsyncHttpClient()
+ def setupUser(user:Map[String,String]):ListenableFuture[Response] = {
+
+ val latitude = user.get("latitude").get
+ val longitude = user.get("longitude").get
+ val username = user.get("username").get
+ val displayName = user.get("displayName").get
+ val age = user.get("age").get
+ val seen = user.get("seen").get
+ val weight = user.get("weight").get
+ val height = user.get("height").get
+ val aboutMe = user.get("aboutMe").get
+ val profileId = user.get("profileId").get
+ val headline = user.get("headline").get
+ val showAge = user.get("showAge").get
+ val relationshipStatus = user.get("relationshipStatus").get
+ val ethnicity = user.get("ethnicity").get
+ val password= user.get("password").get
+ val body = s"""{"location":{"latitude":"$latitude","longitude":"$longitude"},"username":"$username",
+ "displayName":"$displayName","age":"$age","seen":"$seen","weight":"$weight",
+ "height":"$height","aboutMe":"$aboutMe","profileId":"$profileId","headline":"$headline",
+ "showAge":"$showAge","relationshipStatus":"$relationshipStatus","ethnicity":"$ethnicity","password":"$password"}"""
val authToken = getManagementToken()
val createUser = client
.preparePost(Settings.baseAppUrl + "/users")
- .setBody("{\"location\":{\"latitude\":\"" + user.get("latitude") + "\",\"longitude\":\"" + user.get("longitude") + "\"},\"username\":\"" + user.get("username") + "\"," +
- "\"displayName\":\""+user.get("displayName")+"\",\"age\":\""+user.get("age")+"\",\"seen\":\""+user.get("seen")+"\",\"weight\":\""+user.get("weight")+"\"," +
- "\"height\":\""+user.get("height")+"\",\"aboutMe\":\""+user.get("aboutMe")+"\",\"profileId\":\""+user.get("profileId")+"\",\"headline\":\""+user.get("headline")+"\"," +
- "\"showAge\":\""+user.get("showAge")+"\",\"relationshipStatus\":\""+user.get("relationshipStatus")+"\",\"ethnicity\":\""+user.get("ethnicity")+"\",\"password\":\""+user.get("password")+"\"}"
- )
- .setHeader("Cache-Control", "no-cache")
- .setHeader("Content-Type", "application/json; charset=UTF-8")
+ .setBody(body)
+ .setBodyEncoding("UTF-8")
.setHeader("Authorization","Bearer "+authToken)
+ .build()
+
+ return client.executeRequest(createUser)
- val createUserResponse = createUser.execute().get();
- return createUserResponse.getStatusCode
+ }
+
+ def printResponse(caller:String, status:Int, body:String) = {
+ println(caller + ": status: "+status.toString+" body:"+body)
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb43d817/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 40f5085..b248260 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
@@ -68,13 +68,12 @@ object NotificationScenarios {
)
val numEntities:Int = Settings.numUsers * 3 * Settings.duration
-
- val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers * Settings.duration, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
+ val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
val createScenario = scenario("Create Push Notification")
.feed(userFeeder)
- .exec( UserScenarios.getUserByUsername)
.exec(TokenScenarios.getUserToken)
+ .exec( UserScenarios.getUserByUsername)
.repeat(2){
feed(FeederGenerator.generateEntityNameFeeder("device", numEntities))
.exec( DeviceScenarios.postDeviceWithNotifier)
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb43d817/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 7a557e5..86d1f78 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
@@ -62,8 +62,5 @@ import io.gatling.core.Predef._
.doIf("${userStatus}", "400") {
exec(getUserByUsername)
}
- val numEntities:Int = Settings.numEntities
-
- val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers * Settings.duration, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb43d817/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 5c7852b..90dd41d 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
@@ -18,6 +18,7 @@ package org.apache.usergrid.settings
import io.gatling.core.Predef._
import io.gatling.http.Predef._
+import org.apache.usergrid.datagenerators.FeederGenerator
import scala.concurrent.duration._
object Settings {
@@ -50,4 +51,6 @@ object Settings {
val pushNotifier = System.getProperty("pushNotifier")
val pushProvider = System.getProperty("pushProvider")
+ val constantUsers:Int = Settings.numUsers/Settings.duration
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb43d817/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
index 4c1de29..510cee1 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
@@ -35,7 +35,7 @@ class PushNotificationTargetUserSimulation extends Simulation {
}
setUp(
NotificationScenarios.createScenario
- .inject(constantUsersPerSec(Settings.numUsers) during (Settings.duration)) // wait for 15 seconds so create org can finish, need to figure out coordination
+ .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"))
)
[29/42] incubator-usergrid git commit: adding connection scenario
Posted by to...@apache.org.
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/es-type-updates
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)
[04/42] incubator-usergrid git commit: adding new simulation
Posted by to...@apache.org.
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/es-type-updates
Commit: 1b408c19209e24741a0a5daeb3849a6e8723e0a2
Parents: cb43d81
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Nov 5 17:24:02 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
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"))
+ )
+
+
+}
[23/42] incubator-usergrid git commit: Merge branch 'two-dot-o' of
https://git-wip-us.apache.org/repos/asf/incubator-usergrid into
upstream/two-dot-o
Posted by to...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into upstream/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/fadee4af
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/fadee4af
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/fadee4af
Branch: refs/heads/es-type-updates
Commit: fadee4af4b0354b931eab9e70e1cf57b507dd17a
Parents: 51b8c8e 2d08b25
Author: Rod Simpson <ro...@apigee.com>
Authored: Thu Nov 6 15:03:47 2014 -0700
Committer: Rod Simpson <ro...@apigee.com>
Committed: Thu Nov 6 15:03:47 2014 -0700
----------------------------------------------------------------------
.../apache/usergrid/services/users/devices/DevicesService.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[18/42] incubator-usergrid git commit: [APIBAAS-1362]External
cassandra setup
Posted by to...@apache.org.
[APIBAAS-1362]External cassandra setup
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/3275a709
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/3275a709
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/3275a709
Branch: refs/heads/es-type-updates
Commit: 3275a709d70e1dc7eebfed900262d87f7fe0ccd0
Parents: 46d6c05
Author: ryan bridges <rb...@apigee.com>
Authored: Thu Nov 6 12:39:39 2014 -0500
Committer: ryan bridges <rb...@apigee.com>
Committed: Thu Nov 6 13:43:22 2014 -0500
----------------------------------------------------------------------
.../usergrid/cassandra/CassandraResource.java | 136 +++++++++++++++----
1 file changed, 109 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3275a709/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
----------------------------------------------------------------------
diff --git a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
index 96d0d74..0b4c083 100644
--- a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
+++ b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
@@ -33,15 +33,15 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.core.env.PropertySource;
import org.yaml.snakeyaml.Yaml;
-
import org.apache.cassandra.service.CassandraDaemon;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.RandomUtils;
-
/**
* A JUnit {@link org.junit.rules.ExternalResource} designed to start up Cassandra once in a TestSuite or test Class as
* a shared external resource across test cases and shut it down after the TestSuite has completed.
@@ -65,6 +65,7 @@ public class CassandraResource extends ExternalResource {
public static final int DEFAULT_STORAGE_PORT = 7000;
public static final int DEFAULT_SSL_STORAGE_PORT = 7001;
public static final int DEFAULT_NATIVE_TRANSPORT_PORT = 9042;
+ public static final String DEFAULT_HOST = "127.0.0.1";
public static final String PROPERTIES_FILE = "project.properties";
public static final String TARGET_DIRECTORY_KEY = "target.directory";
@@ -101,9 +102,9 @@ public class CassandraResource extends ExternalResource {
private static Properties properties = null;
private boolean forkCassandra = false;
+ private boolean externalCassandra = false;
-
- /**
+ /**
* Creates a Cassandra starting ExternalResource for JUnit test cases which uses the
* default SchemaManager for Cassandra.
*/
@@ -144,12 +145,15 @@ public class CassandraResource extends ExternalResource {
new ClassPathXmlApplicationContext( locations );
Properties properties = (Properties)appContext.getBean("properties");
+ properties.putAll(ArrayUtils.toMap(this.getProjectProperties().entrySet().toArray(new Object[]{})));
String forkString = properties.getProperty("cassandra.startup");
forkCassandra = "forked".equals( forkString );
+ externalCassandra = "external".equals( forkString );
} catch (Exception ex) {
throw new RuntimeException("Error getting properties", ex);
}
+// throw new RuntimeException("My debugging skills are terrible!");
}
@@ -288,15 +292,26 @@ public class CassandraResource extends ExternalResource {
if ( isReady() ) {
return;
}
-
+
if ( forkCassandra ) {
startCassandraForked();
- } else {
+ } else if (externalCassandra) {
+ startCassandraExternal();
+ }else {
+
startCassandraEmbedded();
}
}
}
+ private void addShutdownHook(){
+ Runtime.getRuntime().addShutdownHook( new Thread() {
+ @Override
+ public void run() {
+ after();
+ }
+ } );
+ }
private void startCassandraEmbedded() throws Throwable {
LOG.info( "-------------------------------------------------------------------");
@@ -366,13 +381,13 @@ public class CassandraResource extends ExternalResource {
cassandraDaemon = new CassandraDaemon();
cassandraDaemon.activate();
- Runtime.getRuntime().addShutdownHook( new Thread() {
- @Override
- public void run() {
- after();
- }
- } );
-
+// Runtime.getRuntime().addShutdownHook( new Thread() {
+// @Override
+// public void run() {
+// after();
+// }
+// } );
+ addShutdownHook();
String[] locations = { "usergrid-test-context.xml" };
applicationContext = new ClassPathXmlApplicationContext( locations );
@@ -501,13 +516,13 @@ public class CassandraResource extends ExternalResource {
}
}).start();
- Runtime.getRuntime().addShutdownHook( new Thread() {
- @Override
- public void run() {
- after();
- }
- } );
-
+// Runtime.getRuntime().addShutdownHook( new Thread() {
+// @Override
+// public void run() {
+// after();
+// }
+// } );
+ addShutdownHook();
// give C* time to start
Thread.sleep(5000);
@@ -519,13 +534,31 @@ public class CassandraResource extends ExternalResource {
LOG.info( "External Cassandra resource at {} is ready!", tempDir.toString() );
lock.notifyAll();
}
-
+ private void startCassandraExternal() throws Throwable {
+ LOG.info( "-------------------------------------------------------------------");
+ LOG.info( "Initializing External Cassandra");
+ LOG.info( "-------------------------------------------------------------------");
+ LOG.info("before() test, setting system properties for ports : "
+ + "[rpc, storage, sslStorage, native] = [{}, {}, {}, {}]",
+ new Object[] {rpcPort, storagePort, sslStoragePort, nativeTransportPort});
+ Thread.sleep(5000);
+ String[] locations = { "usergrid-test-context.xml" };
+ applicationContext = new ClassPathXmlApplicationContext( locations );
+// PropertySource ps=new PropertySource<String>();
+// applicationContext.getEnvironment().getPropertySources().addLast(ps);
+ applicationContext.refresh();
+ loadSchemaManager( schemaManagerName );
+ initialized = true;
+
+ LOG.info( "External Cassandra resource at {} is ready!", tempDir.toString() );
+ lock.notifyAll();
+
+ }
/** Stops Cassandra after a TestSuite or test Class executes. */
@Override
protected synchronized void after() {
super.after();
-
if ( process != null ) {
process.destroy();
}
@@ -534,11 +567,15 @@ public class CassandraResource extends ExternalResource {
@Override
public void run() {
try {
- Thread.currentThread().sleep( 100L );
+ Thread.currentThread();
+ Thread.sleep( 100L );
}
catch ( InterruptedException ignored ) {}
-
- LOG.info( "Shutting down Cassandra instance in {}", tempDir.toString() );
+ if(externalCassandra){
+ LOG.info( "Cleaning up external Cassandra instance");
+ }else{
+ LOG.info( "Shutting down Cassandra instance in {}", tempDir.toString() );
+ }
if ( schemaManager != null ) {
LOG.info( "Destroying schemaManager..." );
@@ -556,7 +593,7 @@ public class CassandraResource extends ExternalResource {
LOG.info( "ApplicationContext stopped..." );
try {
- if ( cassandraDaemon != null ) {
+ if ( !externalCassandra && cassandraDaemon != null ) {
LOG.info( "Deactivating CassandraDaemon..." );
cassandraDaemon.deactivate();
}
@@ -641,6 +678,51 @@ public class CassandraResource extends ExternalResource {
return instance;
}
}
+ public static CassandraResource newWithMavenAllocatedPorts() {
+ synchronized ( lock ) {
+ Properties props = new Properties();
+ try {
+ props.load(ClassLoader.getSystemResourceAsStream( "project.properties" ));
+
+ } catch (IOException e) {
+ LOG.error("Unable to load project properties: {}", e.getLocalizedMessage());
+ }
+ int rpcPort = Integer.parseInt(props.getProperty("cassandra.rpcPort", Integer.toString(CassandraResource.DEFAULT_RPC_PORT)));
+ int storagePort = Integer.parseInt(props.getProperty("cassandra.storagePort", Integer.toString(CassandraResource.DEFAULT_STORAGE_PORT))) ;
+ int sslStoragePort = Integer.parseInt(props.getProperty("cassandra.sslPort", Integer.toString(CassandraResource.DEFAULT_SSL_STORAGE_PORT)));
+ int nativeTransportPort = Integer.parseInt(props.getProperty("cassandra.nativeTransportPort", Integer.toString(CassandraResource.DEFAULT_NATIVE_TRANSPORT_PORT)));
+ String host = props.getProperty("cassandra.host", DEFAULT_HOST);
+// int rpcPort = CassandraResource.DEFAULT_RPC_PORT;
+// int storagePort = CassandraResource.DEFAULT_STORAGE_PORT ;
+// int sslStoragePort = CassandraResource.DEFAULT_SSL_STORAGE_PORT;
+// int nativeTransportPort = CassandraResource.DEFAULT_NATIVE_TRANSPORT_PORT;
+
+ System.setProperty( "cassandra.url", host+":" + Integer.toString( rpcPort ) );
+ System.setProperty( "cassandra.cluster", props.getProperty("cassandra.cluster","Test Cluster") );
+ System.setProperty( "cassandra-foreground", "true" );
+ System.setProperty( "log4j.defaultInitOverride", "true" );
+ System.setProperty( "log4j.configuration", "log4j.properties" );
+ System.setProperty( "cassandra.ring_delay_ms", "100" );
+
+ System.setProperty( "cassandra." + RPC_PORT_KEY, Integer.toString( rpcPort ) );
+ System.setProperty( "cassandra." + STORAGE_PORT_KEY, Integer.toString( storagePort ) );
+ System.setProperty( "cassandra." + SSL_STORAGE_PORT_KEY, Integer.toString( sslStoragePort ) );
+ System.setProperty( "cassandra." + NATIVE_TRANSPORT_PORT_KEY, Integer.toString( nativeTransportPort ) );
+
+ LOG.info("project.properties loaded properties for ports : "
+ + "[rpc, storage, sslStorage, native] = [{}, {}, {}, {}]",
+ new Object[] {rpcPort, storagePort, sslStoragePort, nativeTransportPort});
+
+
+ instance = new CassandraResource(
+ null, rpcPort, storagePort, sslStoragePort, nativeTransportPort );
+
+ LOG.info("Created a new instance of CassandraResource: {}", instance);
+ LOG.info("Cassandra using ports {} and {}", storagePort, sslStoragePort);
+
+ return instance;
+ }
+ }
/**
@@ -650,7 +732,7 @@ public class CassandraResource extends ExternalResource {
* @return a new CassandraResource with possibly non-default ports
*/
public static CassandraResource newWithAvailablePorts() {
- return newWithAvailablePorts( null );
+ return newWithMavenAllocatedPorts();
}
[22/42] incubator-usergrid git commit: Revert "remove unregister
devices"
Posted by to...@apache.org.
Revert "remove unregister devices"
This reverts commit d68967c2fada77ce765c3a0d77431d444308d5cf.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2d08b252
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2d08b252
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2d08b252
Branch: refs/heads/es-type-updates
Commit: 2d08b25224fea6d344d009d9c312c1ffceddf417
Parents: 81f56f6
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 15:01:24 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 15:01:24 2014 -0700
----------------------------------------------------------------------
.../apache/usergrid/services/users/devices/DevicesService.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d08b252/stack/services/src/main/java/org/apache/usergrid/services/users/devices/DevicesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/devices/DevicesService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/devices/DevicesService.java
index 1d6fd14..4556eaa 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/devices/DevicesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/devices/DevicesService.java
@@ -40,7 +40,7 @@ public class DevicesService extends org.apache.usergrid.services.devices.Devices
@Override
public ServiceResults putItemById( ServiceContext context, UUID id ) throws Exception {
logger.debug("Registering device {}", id);
-// unregisterDeviceToUsers(id,context.getOwner());
+ unregisterDeviceToUsers(id,context.getOwner());
ServiceResults results = super.putItemById( context, id );
return results;
}
@@ -49,7 +49,7 @@ public class DevicesService extends org.apache.usergrid.services.devices.Devices
@Override
public ServiceResults postItemById( ServiceContext context, UUID id ) throws Exception {
logger.info( "Attempting to connect an entity to device {}", id );
-// unregisterDeviceToUsers(id,context.getOwner());
+ unregisterDeviceToUsers(id,context.getOwner());
ServiceResults results = super.postItemById( context, id );
return results;
}
[38/42] incubator-usergrid git commit: loadtests:infinite user feeder
Posted by to...@apache.org.
loadtests:infinite user feeder
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/a3b517b8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a3b517b8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a3b517b8
Branch: refs/heads/es-type-updates
Commit: a3b517b85a6e43fc75817d93a4e07e321818667f
Parents: 87d6e43
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Nov 10 14:54:11 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Nov 10 14:54:11 2014 -0700
----------------------------------------------------------------------
.../datagenerators/EntityDataGenerator.scala | 2 +-
.../datagenerators/FeederGenerator.scala | 43 +++++++++++++++++--
.../scenarios/NotificationScenarios.scala | 14 +-----
.../usergrid/scenarios/UserScenarios.scala | 26 ++++++++---
.../org/apache/usergrid/settings/Settings.scala | 12 +++++-
.../usergrid/simulations/AppSimulation.scala | 8 +---
.../usergrid/simulations/SetupSimulation.scala | 45 ++++++++++++++++++++
7 files changed, 118 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a3b517b8/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
index 2481737..f923eb2 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
@@ -41,7 +41,7 @@ object EntityDataGenerator {
}
- def generateUser(userId: Int): Map[String,String] = {
+ def generateUser(userId: String): Map[String,String] = {
return Map("username" -> "user".concat(userId.toString),
"profileId" -> Utils.generateRandomInt(10000, 1000000).toString,
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a3b517b8/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
index 8832bd7..7aee8c0 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
@@ -16,18 +16,20 @@
*/
package org.apache.usergrid.datagenerators
+ import java.util
import java.util.UUID
-
+ import java.util.concurrent.atomic.{AtomicInteger, AtomicLong}
import io.gatling.core.Predef._
import org.apache.usergrid.settings.Utils
import scala.collection.mutable.ArrayBuffer
+ import scala.util.Random
-object FeederGenerator {
+ object FeederGenerator {
def generateUserWithGeolocationFeeder(numUsers: Int, radius: Double, centerLatitude: Double, centerLongitude: Double): Array[Map[String, String]] = {
var userArray: ArrayBuffer[Map[String, String]] = new ArrayBuffer[Map[String, String]]
for (userCount <- 1 to numUsers) {
- var user: Map[String, String] = EntityDataGenerator.generateUser(userCount)
+ var user: Map[String, String] = EntityDataGenerator.generateUser(userCount.toString)
var geolocation: Map[String, String] = Utils.generateRandomGeolocation(radius, centerLatitude, centerLongitude)
var blockLists: Map[String, String] = EntityDataGenerator.generateBlockUserLists(numUsers)
@@ -38,6 +40,41 @@ object FeederGenerator {
return userArray.toArray
}
+
+
+ /**
+ * Generate users forever
+ * @param radius
+ * @param centerLatitude
+ * @param centerLongitude
+ * @return
+ */
+ def generateUserWithGeolocationFeederInfinite(radius: Double, centerLatitude: Double, centerLongitude: Double, maxPossible: Int): Iterator[Map[String, String]] = {
+ val userFeeder = Iterator.from(1).map(i=>generateUserData(i.toString, radius, centerLatitude, centerLongitude))
+ return userFeeder
+
+ }
+
+ /**
+ * Generate user data based on atomically increasing integers
+ * @param radius
+ * @param centerLatitude
+ * @param centerLongitude
+ * @return
+ */
+ def generateUserData(id: String, radius: Double, centerLatitude: Double, centerLongitude: Double): Map[String, String] = {
+
+
+ var user: Map[String, String] = EntityDataGenerator.generateUser(id)
+ var geolocation: Map[String, String] = Utils.generateRandomGeolocation(radius, centerLatitude, centerLongitude)
+ var blockLists: Map[String, String] = EntityDataGenerator.generateBlockUserLists(1)
+
+ user = user ++ geolocation ++ blockLists
+
+ return user
+ }
+
+
def generateGeolocationFeeder(radius: Double, centerLatitude: Double, centerLongitude: Double): Feeder[String] = {
val geolocationFeeder = new Feeder[String] {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a3b517b8/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 c616472..6ed5625 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
@@ -68,21 +68,9 @@ object NotificationScenarios {
)
- val userFeeder = Settings.getUserFeeder
+ val userFeeder = Settings.getInfiniteUserFeeder()
val createScenario = scenario("Create Push Notification")
.feed(userFeeder)
- .exec(TokenScenarios.getUserToken)
- .exec( UserScenarios.getUserByUsername)
- .repeat(2){
- feed(FeederGenerator.generateEntityNameFeeder("device", Settings.numDevices))
- .exec( DeviceScenarios.postDeviceWithNotifier)
- .exec(ConnectionScenarios.postUserToDeviceConnection)
- }
- .exec(session => {
- // print the Session for debugging, don't do that on real Simulations
- println(session)
- session
- })
.exec( sendNotificationToUser)
/**
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a3b517b8/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 d4579f7..0ebc5b6 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
@@ -54,14 +54,14 @@ import io.gatling.core.Predef._
http("POST geolocated Users")
.put("/users")
.body(new StringBody( """{"location":{"latitude":"${latitude}","longitude":"${longitude}"},"username":"${username}",
- "displayName":"${displayName}","age":"${age}","seen":"${seen}","weight":"${weight}",
- "height":"${height}","aboutMe":"${aboutMe}","profileId":"${profileId}","headline":"${headline}",
- "showAge":"${showAge}","relationshipStatus":"${relationshipStatus}","ethnicity":"${ethnicity}","password":"password"}"""))
- .check(status.is(200), status.saveAs("userStatus"), jsonPath("$..entities[0].uuid").saveAs("userId"))
- )
+ "displayName":"${displayName}","age":"${age}","seen":"${seen}","weight":"${weight}",
+ "height":"${height}","aboutMe":"${aboutMe}","profileId":"${profileId}","headline":"${headline}",
+ "showAge":"${showAge}","relationshipStatus":"${relationshipStatus}","ethnicity":"${ethnicity}","password":"password"}"""))
+ .check(status.in(200 to 400), status.saveAs("userStatus"), jsonPath("$..entities[0].uuid").saveAs("userId"))
+ )
.doIf("${userStatus}", "400") {
- exec(getUserByUsername)
- }
+ exec(getUserByUsername)
+ }
val deleteUserByUsername = exec(
http("DELETE user")
@@ -69,4 +69,16 @@ import io.gatling.core.Predef._
.headers(Headers.jsonAuthorized)
.check(status.is(200), jsonPath("$..entities[0].uuid").saveAs("userId"))
)
+
+ val createUsersWithDevicesScenario = scenario("Create Users")
+ .feed(Settings.getInfiniteUserFeeder())
+ .exec(TokenScenarios.getManagementToken)
+ .exec(UserScenarios.postUser)
+ .exec(TokenScenarios.getUserToken)
+ .exec(UserScenarios.getUserByUsername)
+ .repeat(2){
+ feed(FeederGenerator.generateEntityNameFeeder("device", Settings.numDevices))
+ .exec( DeviceScenarios.postDeviceWithNotifier)
+ .exec(ConnectionScenarios.postUserToDeviceConnection)
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a3b517b8/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 67faccd..4bcb6bb 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
@@ -38,7 +38,10 @@ object Settings {
// Simulation settings
val constantUsers:Int = Integer.getInteger("rampUsers", 10).toInt
- var numUsers:Int = constantUsers * duration
+ val numUsers:Int = constantUsers * duration
+
+ // Simulation settings
+ val maxPossibleUsers:Int = Integer.getInteger("maxPossibleUsers", 10).toInt
val numEntities:Int = Integer.getInteger("numEntities", 5000).toInt
val numDevices:Int = Integer.getInteger("numDevices", 4000).toInt
@@ -58,10 +61,15 @@ object Settings {
println(s"Will inject $constantUsers users per sec")
- def getUserFeeder():Array[Map[String, String]]= {
+ def getUserFeeder():Array[Map[String, String]]= {
val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(numUsers, userLocationRadius, centerLatitude, centerLongitude)
return userFeeder
}
+ def getInfiniteUserFeeder():Iterator[Map[String, String]]= {
+ val userFeeder = FeederGenerator.generateUserWithGeolocationFeederInfinite( userLocationRadius, centerLatitude, centerLongitude,maxPossibleUsers)
+ return userFeeder
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a3b517b8/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 48fff1c..a9cfd10 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
@@ -33,16 +33,12 @@ import scala.concurrent.duration._
*/
class AppSimulation extends Simulation {
println("Begin setup")
- Setup.setupOrg()
- Setup.setupApplication()
Setup.setupNotifier()
- Setup.setupUsers()
println("End 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
- .throttle(reachRps(Settings.throttle) in (Settings.rampTime.seconds))
+ .inject(constantUsersPerSec(Settings.maxPossibleUsers) during (Settings.duration))
.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/a3b517b8/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
new file mode 100644
index 0000000..ab68d98
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/SetupSimulation.scala
@@ -0,0 +1,45 @@
+/*
+ *
+ * * 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(constantUsersPerSec(Settings.maxPossibleUsers) during (Settings.duration))
+ .protocols(Settings.httpConf.acceptHeader("application/json"))
+ ).throttle(reachRps(Settings.throttle) in (Settings.rampTime seconds), holdFor(Settings.duration))
+}
[13/42] incubator-usergrid git commit: adding switch for simulation
selector
Posted by to...@apache.org.
adding switch for simulation selector
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/1589d041
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1589d041
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1589d041
Branch: refs/heads/es-type-updates
Commit: 1589d0417f3c74ba0116eec29c7736857ef717d7
Parents: 66b1468
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 6 09:47:42 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 6 09:47:42 2014 -0700
----------------------------------------------------------------------
.../org/apache/usergrid/settings/Settings.scala | 2 +
.../usergrid/simulations/AppSimulation.scala | 41 +++++++++++++-------
2 files changed, 29 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1589d041/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 03a4200..3a0d23d 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
@@ -64,4 +64,6 @@ object Settings {
val constantUsers:Int = Settings.numUsers/Settings.duration
println(s"Will inject $constantUsers users per sec")
+ var simulation:String = if(System.getProperty("simulation") != null) System.getProperty("simulation") else "all"
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1589d041/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 aa246a4..9805eea 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
@@ -25,26 +25,39 @@ 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.annotation.switch
import scala.concurrent.duration._
/**
* Classy class class.
*/
class AppSimulation extends Simulation{
- before{
- println("Begin setup")
- Setup.setupOrg()
- Setup.setupApplication()
- Setup.setupNotifier()
- Setup.setupUsers()
- println("End 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
- .throttle(reachRps(Settings.throttle) in ( Settings.rampTime.seconds))
- .protocols( Settings.httpConf.acceptHeader("application/json"))
- )
+ val simulation = Settings.simulation
+ println(s"Running simulation $simulation")
+
+ println("Begin setup")
+ Setup.setupOrg()
+ Setup.setupApplication()
+ Setup.setupNotifier()
+ Setup.setupUsers()
+ println("End Setup")
+ def sim(choice:String) = (choice: @switch) match {
+ case "connections" =>
+ 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"))
+ )
+ case "all" =>
+ 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"))
+ )
+ }
+ sim(simulation)
}
[36/42] 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 to...@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/87d6e438
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/87d6e438
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/87d6e438
Branch: refs/heads/es-type-updates
Commit: 87d6e4387b8782b990f0d8fa5adbbe98027a1e95
Parents: 11eef84 4436ead
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Nov 10 09:21:43 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Nov 10 09:21:43 2014 -0500
----------------------------------------------------------------------
stack/loadtests/README.md | 4 ++--
.../org/apache/usergrid/scenarios/NotificationScenarios.scala | 6 +++---
.../src/main/scala/org/apache/usergrid/settings/Settings.scala | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------