You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2014/12/10 01:54:17 UTC
[01/15] incubator-usergrid git commit: WIP,
first copy of adding users simulation
Repository: incubator-usergrid
Updated Branches:
refs/heads/two-dot-o 04679c82a -> 43ed8464f
WIP, first copy of adding users 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/bd79d37d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/bd79d37d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/bd79d37d
Branch: refs/heads/two-dot-o
Commit: bd79d37d56c6f1458990c463833fcf7d39828728
Parents: 7645a79
Author: Todd Nine <tn...@apigee.com>
Authored: Wed Dec 3 15:32:34 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Wed Dec 3 15:32:34 2014 -0700
----------------------------------------------------------------------
.../usergrid/scenarios/UserScenarios.scala | 11 +++++
.../simulations/GetUsersSimulation.scala | 51 ++++++++++++++++++++
2 files changed, 62 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bd79d37d/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 7d1c9b5..2ca6d21 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
@@ -56,6 +56,15 @@ import io.gatling.core.Predef._
)
+
+ val getUsersWithCursor = exec(
+ http("GET user")
+ .get("/users?cursor=${cursor}")
+ .headers(Headers.jsonAuthorized)
+ .check(status.saveAs("userStatus"), jsonPath("$..entities").saveAs("users"))
+ )
+
+
/**
* Try to get a user, if it returns a 404, create the user
*/
@@ -109,4 +118,6 @@ import io.gatling.core.Predef._
val postUsersInfinitely = scenario("Post Users")
.feed(Settings.getInfiniteUserFeeder())
.exec(UserScenarios.postUser)
+
+ val getUsersIndefinitely = scenario("Get Users").exec()
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bd79d37d/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
new file mode 100755
index 0000000..eefeff1
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.simulations
+
+import io.gatling.core.Predef._
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * Posts application users continually to an application. Expects the following parameters
+ *
+ * -DmaxPossibleUsers : The maximum number of users to be making requests as fast as possible. Think of this as conccurrent users in the system
+ * -DrampTime: The amount of time (in seconds) to allow for maxPossibleUsers to be reached. This will add new users linearlly
+ * -Dduration: The amount of time (in seconds) to continue to perform requests up with the maxPossibleUsers
+ */
+class GetUsersSimulation extends Simulation {
+
+ println("Begin setup")
+ Setup.setupOrg()
+ Setup.setupApplication()
+ println("End Setup")
+
+
+ setUp(
+ UserScenarios.postUsersInfinitely
+ .inject(
+ /**
+ * injection steps take from this forum post
+ * https://groups.google.com/forum/#!topic/gatling/JfYHaWCbA-w
+ */
+ rampUsers(Settings.maxPossibleUsers) over Settings.rampTime,
+ constantUsersPerSec(Settings.maxPossibleUsers) during Settings.duration
+
+ )).protocols(Settings.httpConf.acceptHeader("application/json"))
+
+}
[06/15] incubator-usergrid git commit: Added extractor helpers
Posted by gr...@apache.org.
Added extractor helpers
Updated UsersScenario to use helpers and constants
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/6709158f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/6709158f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/6709158f
Branch: refs/heads/two-dot-o
Commit: 6709158fc40a011807007717f432d1d324319e26
Parents: 2372701
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Dec 4 15:14:33 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Dec 4 15:14:33 2014 -0700
----------------------------------------------------------------------
.../apache/usergrid/helpers/Extractors.scala | 72 ++++++++++
.../usergrid/scenarios/UserScenarios.scala | 132 ++++++++++++-------
2 files changed, 153 insertions(+), 51 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6709158f/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
new file mode 100644
index 0000000..055bf8d
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
@@ -0,0 +1,72 @@
+package org.apache.usergrid.helpers
+
+import io.gatling.core.Predef._
+import io.gatling.core.session._
+import io.gatling.http.Predef._
+
+import scala.util.parsing.json.JSONArray
+
+/**
+ * Helper object that will perform extractions
+ */
+object Extractors {
+
+// /**
+// * Will extract the cursor from the response. If the cursor is not present, an empty string will be set
+// */
+// val maybeExtractCursor = jsonPath("$..cursor").transformOption( extract => {
+// //it may or may not be present. If it is, save it, otherwise save it as an empty string
+// extract.orElse(Some(""))
+// }).saveAs("cursor")
+//
+// /**
+// * Will extract entities as a json array into the session. If they do not exist, it will set to an empty list
+// */
+// val maybeExtractEntities = jsonPath("..entities").transformOption(extract => {
+// extract.orElse(Some(JSONArray(List())));
+// }).saveAs("entities")
+
+ /**
+ * Will extract the cursor from the response. If the cursor is not present, an empty string will be set
+ */
+ def maybeExtractCursor(saveAsName : String) = {
+ jsonPath("$..cursor").transformOption(extract => {
+ //it may or may not be present. If it is, save it, otherwise save it as an empty string
+ extract.orElse(Some(""))
+ }).saveAs(saveAsName)
+ }
+
+
+ /**
+ * tries to extract the cursor from the session, if it exists, it returns true. if it's the default, returns false
+ * @param nameInSession The name of the variable in the session
+ * @return
+ */
+ def stringParamExists (nameInSession: String) : Expression[Boolean] = {
+ session => session(nameInSession) != null && session(nameInSession).as[String] != ""
+ }
+
+ /**
+ * Will extract entities as a json array into the session. If they do not exist, it will set to an empty list
+ * @param saveAsName The name to use when saving to the session
+ */
+ def maybeExtractEntities(saveAsName: String) = {
+ jsonPath("$..entities").ofType[Seq[Any]].transformOption(extract => {
+ extract.orElse(Some(Seq()));
+ }).saveAs(saveAsName)
+ }
+
+ /**
+ * Returns true if sequence is not null and has elements. Expects a seq object
+ * @param nameInSession The name ot use when saving to the session
+ * @return
+ */
+ def sequenceHasElements(nameInSession: String) : Expression[Boolean] = {
+ session => session(nameInSession) != null && session(nameInSession).as[Seq[Any]].length > 0
+ }
+
+
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6709158f/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 2bbe9a3..13fb96b 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
@@ -14,28 +14,49 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
- package org.apache.usergrid.scenarios
+
+package org.apache.usergrid.scenarios
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}
+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}
+import org.apache.usergrid.helpers.Extractors._
+
+import scala.util.parsing.json.JSONArray
+
+object UserScenarios {
+
+ /**
+ * Naming constants used in the scenarios for saving values into the sessions
+ */
+
+ //The value for the cursor
+ val SessionVarCursor: String = "cursor"
- object UserScenarios {
+ //the value for the json array of users
+ val SessionVarUsers: String = "users"
+
+ //the value for the users uuid
+ val SessionVarUserId: String = "userId"
+
+ //the value for HTTP response code after requests
+ val SessionVarUserStatus: String = "userStatus"
+
+ val getRandomUser = exec(
+ http("GET user")
+ .get("/users/user" + Utils.generateRandomInt(1, Settings.numEntities))
+ .headers(Headers.jsonAuthorized)
+ .check(status.is(200))
+ )
- val getRandomUser = exec(
- http("GET user")
- .get("/users/user" + Utils.generateRandomInt(1, Settings.numEntities))
- .headers(Headers.jsonAuthorized)
- .check(status.is(200))
- )
val getUserByUsername = exec(
http("GET user")
.get("/users/${username}")
.headers(Headers.jsonAuthorized)
- .check(status.saveAs("userStatus"), jsonPath("$..entities[0]").exists, jsonPath("$..entities[0].uuid").exists, jsonPath("$..entities[0].uuid").saveAs("userId"))
+ .check(status.saveAs(SessionVarUserStatus), jsonPath("$..entities[0]").exists, jsonPath("$..entities[0].uuid").exists, jsonPath("$..entities[0].uuid").saveAs(SessionVarUserId))
)
@@ -45,31 +66,30 @@ import io.gatling.core.Predef._
val postUser =
exec(
- http("POST geolocated Users")
- .post("/users")
- .body(new StringBody("""{"location":{"latitude":"${latitude}","longitude":"${longitude}"},"username":"${username}",
+ http("POST geolocated Users")
+ .post("/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.saveAs("userStatus"))
- .check(status.is(200),jsonPath("$..entities[0].uuid").saveAs("userId"))
- )
-
+ .check(status.saveAs(SessionVarUserStatus))
+ .check(status.is(200), jsonPath("$..entities[0].uuid").saveAs(SessionVarUserId))
+ )
/**
- * Try to get a user, if it returns a 404, create the user
- */
+ * Try to get a user, if it returns a 404, create the user
+ */
val postUserIfNotExists =
exec(getUserByUsername)
- .doIf ("${userStatus}", "404") {
- exec(postUser)
+ .doIf("${userStatus}", "404") {
+ exec(postUser)
}
val putUser =
exec(getUserByUsername)
- .doIf("${userStatus}", "200") {
+ .doIf("${userStatus}", "200") {
exec(
http("POST geolocated Users")
.put("/users")
@@ -77,10 +97,10 @@ import io.gatling.core.Predef._
"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), jsonPath("$..entities[0].uuid").saveAs("userId"))
+ .check(status.is(200), jsonPath("$..entities[0].uuid").saveAs(SessionVarUserId))
)
- }
+ }
/**
* Get a collection of users without a cursor. Sets the cursor and entities array as "users"
@@ -89,59 +109,69 @@ import io.gatling.core.Predef._
http("GET user")
.get("/users")
.headers(Headers.jsonAuthorized)
- .check(status.is(200), jsonPath("$..entities").saveAs("users"), jsonPath("$..cursor").saveAs("cursor"))
+ .check(status.is(200), maybeExtractEntities(SessionVarUsers), maybeExtractCursor(SessionVarCursor))
)
/**
* Get the next page of users with the cursor, expects the value "cursor" to be present in teh session
*/
+ //maybe doif for detecting empty session?
val getUsersWithCursor = exec(
- http("GET user")
- .get("/users?cursor=${cursor}")
- .headers(Headers.jsonAuthorized)
- .check(status.is(200), jsonPath("$..entities").saveAs("users"), jsonPath("$..cursor").saveAs("cursor"))
- )
+ http("GET user")
+ .get("/users?cursor=${" + SessionVarCursor + "}")
+ .headers(Headers.jsonAuthorized)
+ .check(status.is(200), maybeExtractEntities(SessionVarUsers), maybeExtractCursor(SessionVarCursor))
+ ) /**
+ * Debugging block
+
+ .exec(session => {
+
+ val cursor = session.get(SessionVarCursor)
+ val users = session.get(SessionVarUsers)
+
+ session
+ }) */
val deleteUserByUsername = exec(
http("DELETE user")
.delete("/users/${username}")
.headers(Headers.jsonAuthorized)
- .check(status.is(200), jsonPath("$..entities[0].uuid").saveAs("userId"))
+ .check(status.is(200), jsonPath("$..entities[0].uuid").saveAs(SessionVarUserId))
)
/**
* Logs in as the admin user. Checks if a user exists, if not, creates the user
* Logs in as the user, then creates 2 devices if they do not exist
*/
- val createUsersWithDevicesScenario = scenario("Create Users")
+ val createUsersWithDevicesScenario = scenario("Create Users")
.feed(Settings.getInfiniteUserFeeder())
.exec(TokenScenarios.getManagementToken)
.exec(UserScenarios.postUserIfNotExists)
.exec(TokenScenarios.getUserToken)
.exec(UserScenarios.getUserByUsername)
- .repeat(2){
- feed(FeederGenerator.generateEntityNameFeeder("device", Settings.numDevices))
- .exec( DeviceScenarios.maybeCreateDevices)
- }
+ .repeat(2) {
+ feed(FeederGenerator.generateEntityNameFeeder("device", Settings.numDevices))
+ .exec(DeviceScenarios.maybeCreateDevices)
+ }
/**
* Posts a new user every time
*/
- val postUsersInfinitely = scenario("Post Users")
- .feed(Settings.getInfiniteUserFeeder())
- .exec(UserScenarios.postUser)
+ val postUsersInfinitely = scenario("Post Users")
+ .feed(Settings.getInfiniteUserFeeder())
+ .exec(UserScenarios.postUser)
/**
* Get the users a page at a time until exhausted
*/
- val getUsersToEnd = scenario("Get Users").exec(
- //get the management token
- TokenScenarios.getManagementToken,
- //get users without a cursor
- getUsersWithoutCursor
- //as long as we have a cursor, keep getting results
- ).asLongAs(session => session("cursor").as[String] != "") {
- exec(getUsersWithCursor)
- }
+ val getUsersToEnd = scenario("Get Users")
+ //get the management token
+ .exec(TokenScenarios.getManagementToken)
+ //get users without a cursor
+ .exec(getUsersWithoutCursor)
+ //as long as we have a cursor, keep getting results
+ .asLongAs(stringParamExists(SessionVarCursor)) {
+ exec(getUsersWithCursor)
+ }
}
[10/15] incubator-usergrid git commit: Added ability to run the tests
via shell script
Posted by gr...@apache.org.
Added ability to run the tests via shell script
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/d52a185a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/d52a185a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/d52a185a
Branch: refs/heads/two-dot-o
Commit: d52a185aed3df969cb85e11db1470144a32f9992
Parents: 38871cc
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Dec 5 10:56:11 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Dec 5 10:56:11 2014 -0700
----------------------------------------------------------------------
stack/loadtests/runtests.sh | 107 +++++++++++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d52a185a/stack/loadtests/runtests.sh
----------------------------------------------------------------------
diff --git a/stack/loadtests/runtests.sh b/stack/loadtests/runtests.sh
new file mode 100755
index 0000000..171d561
--- /dev/null
+++ b/stack/loadtests/runtests.sh
@@ -0,0 +1,107 @@
+#!/bin/bash
+
+die() { echo "$@" 1>&2 ; exit 1; }
+
+####
+#This is a script to simplify running gatling tests. It will default several parameters, invoke the maven plugins
+#Then aggregate the results
+####
+[ "$#" -eq 4 ] || die "4 arguments required, $# provided. Example is $0 URL MAX_CONCURRENT_USERS RAMP_TIME(seconds) DURATION_TIME(seconds)"
+
+URL="$1"
+MAX_CONCURRENT_USERS="$2"
+RAMP_TIME="$3"
+DURATION_TIME="$4"
+
+shift 4
+
+#Compile everything
+mvn compile
+
+#Set the app id to be a date epoch for uniqueness
+APP1=$(date +%s)
+
+
+
+#Execute the post step
+mvn gatling:execute -Dorg=usergrid \
+-Dbaseurl=${URL} \
+-DmaxPossibleUsers=${MAX_CONCURRENT_USERS} \
+-DmaxPossibleUsers=${RAMP_TIME} \
+-DadminUser=usergrid \
+-DadminPassword=test \
+-Dduration=${DURATION_TIME} \
+-Dgatling.simulationClass=org.apache.usergrid.simulations.PostUsersSimulation \
+-Dapp=${APP1}
+
+
+#Execute the get users by username
+mvn gatling:execute -Dorg=usergrid \
+-Dbaseurl=${URL} \
+-DmaxPossibleUsers=${MAX_CONCURRENT_USERS} \
+-DmaxPossibleUsers=${RAMP_TIME} \
+-DadminUser=usergrid \
+-DadminPassword=test \
+-Dduration=${DURATION_TIME} \
+-Dgatling.simulationClass=org.apache.usergrid.simulations.GetUsersSimulation \
+-Dapp=${APP1}
+
+
+#Execute the get users by page
+mvn gatling:execute -Dorg=usergrid \
+-Dbaseurl=${URL} \
+-DmaxPossibleUsers=${MAX_CONCURRENT_USERS} \
+-DmaxPossibleUsers=${RAMP_TIME} \
+-DadminUser=usergrid \
+-DadminPassword=test \
+-Dduration=${DURATION_TIME} \
+-Dgatling.simulationClass=org.apache.usergrid.simulations.GetUserPagesSimulation \
+-Dapp=${APP1}
+
+
+APP2=$(date +%s)
+
+#Execute put users to create them
+mvn gatling:execute -Dorg=usergrid \
+-Dbaseurl=${URL} \
+-DmaxPossibleUsers=${MAX_CONCURRENT_USERS} \
+-DmaxPossibleUsers=${RAMP_TIME} \
+-DadminUser=usergrid \
+-DadminPassword=test \
+-Dduration=${DURATION_TIME} \
+-Dgatling.simulationClass=org.apache.usergrid.simulations.PutUsersSimulation \
+-Dapp=${APP2}
+
+#Execute the put users to update them
+mvn gatling:execute -Dorg=usergrid \
+-Dbaseurl=${URL} \
+-DmaxPossibleUsers=${MAX_CONCURRENT_USERS} \
+-DmaxPossibleUsers=${RAMP_TIME} \
+-DadminUser=usergrid \
+-DadminPassword=test \
+-Dduration=${DURATION_TIME} \
+-Dgatling.simulationClass=org.apache.usergrid.simulations.PutUsersSimulation \
+-Dapp=${APP2}
+
+
+#Execute the delete to remove them
+mvn gatling:execute -Dorg=usergrid \
+-Dbaseurl=${URL} \
+-DmaxPossibleUsers=${MAX_CONCURRENT_USERS} \
+-DmaxPossibleUsers=${RAMP_TIME} \
+-DadminUser=usergrid \
+-DadminPassword=test \
+-Dduration=${DURATION_TIME} \
+-Dgatling.simulationClass=org.apache.usergrid.simulations.DeleteUsersSimulation \
+-Dapp=${APP2}
+
+
+#Now move all the reports
+#AGGREGATE_DIR="target/aggregate-$(date +%s)"
+
+#mkdir -p ${AGGREGATE_DIR}
+
+
+#copy to the format of target/aggregate(date)/(simnulationame)-simulation.log
+#find target -name "simulation.log" -exec cp {} ${AGGREGATE_DIR}/$(basename $(dirname {} ))-simulation.log \;
+
[04/15] incubator-usergrid git commit: new scenario for put and delete
Posted by gr...@apache.org.
new scenario for put and delete
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/55428142
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/55428142
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/55428142
Branch: refs/heads/two-dot-o
Commit: 554281425ddee0cc269639e89faa25312fbf9bc4
Parents: 3079231
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Dec 4 09:20:40 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Dec 4 09:20:40 2014 -0700
----------------------------------------------------------------------
.../apache/usergrid/scenarios/UserScenarios.scala | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/55428142/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 eeecffa..090ffea 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
@@ -146,7 +146,22 @@ import io.gatling.core.Predef._
*/
val postUsersInfinitely = scenario("Post Users")
.feed(Settings.getInfiniteUserFeeder())
- .exec(UserScenarios.postUser)
+ .exec(postUser)
+
+
+ /**
+ * Puts a new user every time
+ */
+ val putUsersInfinitely = scenario("Post Users")
+ .feed(Settings.getInfiniteUserFeeder())
+ .exec(putUser)
+
+ /**
+ * Deletes user every time
+ */
+ val deleteUsersInfinitely = scenario("Post Users")
+ .feed(Settings.getInfiniteUserFeeder())
+ .exec(deleteUser)
/**
* Get the users a page at a time until exhausted
[13/15] incubator-usergrid git commit: Changed tomcat configuration
to be configured based on number of processors and threads per core
Posted by gr...@apache.org.
Changed tomcat configuration to be configured based on number of processors and threads per core
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/692eff82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/692eff82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/692eff82
Branch: refs/heads/two-dot-o
Commit: 692eff82361af0eaa0824bf47cb70a20ec0bd184
Parents: ecce52d
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Dec 5 15:46:07 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Dec 5 15:46:07 2014 -0700
----------------------------------------------------------------------
.../main/dist/init_instance/init_rest_server.sh | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/692eff82/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 924fb49..3d5fdaf 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
@@ -68,51 +68,51 @@ export ACCEPT_COUNT=100
export NR_OPEN=1048576
export FILE_MAX=761773
+#Number of threads to allow per core
+export NUM_THREAD_PROC=25
+
+#Get the number of processors
+export NUM_PROC=$(nproc)
+
+#Configure the max amount of tomcat threads
+export TOMCAT_THREADS=$((${NUM_PROC} * ${NUM_THREAD_PROC}))
+
case `(curl http://169.254.169.254/latest/meta-data/instance-type)` in
'm1.small' )
# total of 1.7g
export TOMCAT_RAM=1190m
- export TOMCAT_THREADS=300
;;
'm1.medium' )
# total of 3.75g
export TOMCAT_RAM=2625m
- export TOMCAT_THREADS=500
;;
'm1.large' )
# total of 7.5g
export TOMCAT_RAM=5250m
- export TOMCAT_THREADS=1000
;;
'm1.xlarge' )
# total of 15g
export TOMCAT_RAM=10500m
- export TOMCAT_THREADS=2000
;;
'm3.large' )
# total of 7.5g
export TOMCAT_RAM=5250m
- export TOMCAT_THREADS=1600
;;
'm3.xlarge' )
# total of 15g
export TOMCAT_RAM=10500m
- export TOMCAT_THREADS=3300
;;
'c3.xlarge' )
# total of 7.5g
export TOMCAT_RAM=4096m
- export TOMCAT_THREADS=1000
;;
'c3.2xlarge' )
# total of 15g
export TOMCAT_RAM=10500m
- export TOMCAT_THREADS=2000
;;
'c3.4xlarge' )
# total of 30g
export TOMCAT_RAM=21000m
- export TOMCAT_THREADS=4000
esac
[07/15] incubator-usergrid git commit: Merge branch 'USERGRID-252' of
https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-252
Posted by gr...@apache.org.
Merge branch 'USERGRID-252' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-252
Conflicts:
stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c64fcba7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c64fcba7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c64fcba7
Branch: refs/heads/two-dot-o
Commit: c64fcba728908a5f093e6a55b48af1b1fb50d496
Parents: 6709158 949daf8
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Dec 4 15:16:38 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Dec 4 15:16:38 2014 -0700
----------------------------------------------------------------------
.../usergrid/scenarios/UserScenarios.scala | 46 ++++++++++++----
.../simulations/DeleteUsersSimulation.scala | 56 ++++++++++++++++++++
.../simulations/PutUsersSimulation.scala | 56 ++++++++++++++++++++
3 files changed, 147 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c64fcba7/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
----------------------------------------------------------------------
diff --cc stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
index 13fb96b,090ffea..e48b60c
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
@@@ -78,28 -60,42 +78,37 @@@ object UserScenarios
/**
- * Try to get a user, if it returns a 404, create the user
- */
+ * Try to get a user, if it returns a 404, create the user
+ */
val postUserIfNotExists =
exec(getUserByUsername)
- .doIf ("${userStatus}", "404") {
- exec(postUser)
+ .doIf("${userStatus}", "404") {
+ exec(postUser)
}
-
- val putUser =
- exec(getUserByUsername)
- .doIf("${userStatus}", "200") {
- exec(
- http("POST geolocated Users")
- .put("/users")
- .body(new StringBody( """{"location":{"latitude":"${latitude}","longitude":"${longitude}"},"username":"${username}",
+ val putUser = exec(
+ http("PUT geolocated Users")
+ .put("/users/${username}")
+ .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), jsonPath("$..entities[0].uuid").saveAs(SessionVarUserId))
- .check(status.is(200), jsonPath("$..entities[0].uuid").saveAs("userId"))
-
- )
++ .check(status.is(200), jsonPath("$..entities[0].uuid").saveAs(SessionVarUserId))
- val putUserIfExists =
- exec(getUserByUsername)
- .doIf("${userStatus}", "200") {
- putUser
- }
+ )
++
+
+ val deleteUser = exec(
+ http("PUT geolocated Users")
+ .delete("/users/${username}")
+ .check(status.is(200))
+
+ )
+
+ val deleteUserIfExists =
+ exec(getUserByUsername)
+ .doIf("${userStatus}", "200") {
+ deleteUser
}
/**
@@@ -158,9 -144,24 +167,24 @@@
/**
* Posts a new user every time
*/
- val postUsersInfinitely = scenario("Post Users")
+ val postUsersInfinitely = scenario("Post Users")
+ .feed(Settings.getInfiniteUserFeeder())
+ .exec(postUser)
+
+
+ /**
+ * Puts a new user every time
+ */
- val putUsersInfinitely = scenario("Post Users")
++ val putUsersInfinitely = scenario("Put Users")
+ .feed(Settings.getInfiniteUserFeeder())
+ .exec(putUser)
+
+ /**
+ * Deletes user every time
+ */
- val deleteUsersInfinitely = scenario("Post Users")
++ val deleteUsersInfinitely = scenario("Delete Users")
.feed(Settings.getInfiniteUserFeeder())
- .exec(UserScenarios.postUser)
+ .exec(deleteUser)
/**
* Get the users a page at a time until exhausted
[02/15] incubator-usergrid git commit: Mostly working. Need to finish
with setting cursor to empty on last request
Posted by gr...@apache.org.
Mostly working. Need to finish with setting cursor to empty on last request
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/23727010
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/23727010
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/23727010
Branch: refs/heads/two-dot-o
Commit: 23727010cc0bd3ca5a2363b6de5577a6845ed599
Parents: bd79d37
Author: Todd Nine <tn...@apigee.com>
Authored: Wed Dec 3 17:53:34 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Wed Dec 3 17:53:34 2014 -0700
----------------------------------------------------------------------
.../usergrid/scenarios/UserScenarios.scala | 42 +++++++++++++++-----
.../simulations/GetUsersSimulation.scala | 2 +-
2 files changed, 34 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/23727010/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 2ca6d21..2bbe9a3 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
@@ -57,14 +57,6 @@ import io.gatling.core.Predef._
- val getUsersWithCursor = exec(
- http("GET user")
- .get("/users?cursor=${cursor}")
- .headers(Headers.jsonAuthorized)
- .check(status.saveAs("userStatus"), jsonPath("$..entities").saveAs("users"))
- )
-
-
/**
* Try to get a user, if it returns a 404, create the user
*/
@@ -90,6 +82,27 @@ import io.gatling.core.Predef._
)
}
+ /**
+ * Get a collection of users without a cursor. Sets the cursor and entities array as "users"
+ */
+ val getUsersWithoutCursor = exec(
+ http("GET user")
+ .get("/users")
+ .headers(Headers.jsonAuthorized)
+ .check(status.is(200), jsonPath("$..entities").saveAs("users"), jsonPath("$..cursor").saveAs("cursor"))
+ )
+
+ /**
+ * Get the next page of users with the cursor, expects the value "cursor" to be present in teh session
+ */
+ val getUsersWithCursor = exec(
+ http("GET user")
+ .get("/users?cursor=${cursor}")
+ .headers(Headers.jsonAuthorized)
+ .check(status.is(200), jsonPath("$..entities").saveAs("users"), jsonPath("$..cursor").saveAs("cursor"))
+ )
+
+
val deleteUserByUsername = exec(
http("DELETE user")
.delete("/users/${username}")
@@ -119,5 +132,16 @@ import io.gatling.core.Predef._
.feed(Settings.getInfiniteUserFeeder())
.exec(UserScenarios.postUser)
- val getUsersIndefinitely = scenario("Get Users").exec()
+ /**
+ * Get the users a page at a time until exhausted
+ */
+ val getUsersToEnd = scenario("Get Users").exec(
+ //get the management token
+ TokenScenarios.getManagementToken,
+ //get users without a cursor
+ getUsersWithoutCursor
+ //as long as we have a cursor, keep getting results
+ ).asLongAs(session => session("cursor").as[String] != "") {
+ exec(getUsersWithCursor)
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/23727010/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
index eefeff1..cceab3c 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
@@ -37,7 +37,7 @@ class GetUsersSimulation extends Simulation {
setUp(
- UserScenarios.postUsersInfinitely
+ UserScenarios.getUsersToEnd
.inject(
/**
* injection steps take from this forum post
[09/15] incubator-usergrid git commit: Updated delete to include 404
responses as valid
Posted by gr...@apache.org.
Updated delete to include 404 responses as valid
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/38871cc1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/38871cc1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/38871cc1
Branch: refs/heads/two-dot-o
Commit: 38871cc1bf1ed976feb69b499a8d89cc4693817b
Parents: 9ad779e
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Dec 4 16:22:50 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Dec 4 16:22:50 2014 -0700
----------------------------------------------------------------------
.../main/scala/org/apache/usergrid/scenarios/UserScenarios.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/38871cc1/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 2cfdef2..c589365 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
@@ -103,7 +103,7 @@ object UserScenarios {
http("DELETE geolocated Users")
.delete("/users/${username}")
.headers(Headers.jsonAuthorized)
- .check(status.is(200))
+ .check(status.in(Seq(200,404)))
)
val deleteUserIfExists =
[14/15] incubator-usergrid git commit: Merge remote-tracking branch
'origin/two-dot-o' into USERGRID-252
Posted by gr...@apache.org.
Merge remote-tracking branch 'origin/two-dot-o' into USERGRID-252
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/5d4ce726
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/5d4ce726
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/5d4ce726
Branch: refs/heads/two-dot-o
Commit: 5d4ce726117ddb8ba67e3df86180751d201a3561
Parents: 692eff8 a63b856
Author: Todd Nine <tn...@apigee.com>
Authored: Tue Dec 9 16:08:50 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Tue Dec 9 16:08:50 2014 -0700
----------------------------------------------------------------------
.../corepersistence/CpEntityManager.java | 230 ++++++++++---------
.../corepersistence/util/CpEntityMapUtils.java | 32 ++-
.../batch/job/SchedulerRuntimeIntervalIT.java | 49 ++--
.../migration/EntityDataMigrationIT.java | 139 +++++------
.../migration/EntityTypeMappingMigrationIT.java | 89 +++----
.../apache/usergrid/persistence/CounterIT.java | 89 ++++---
.../usergrid/persistence/CountingMutatorIT.java | 4 +-
.../persistence/EntityDictionaryIT.java | 11 +-
.../usergrid/persistence/EntityManagerIT.java | 47 ++--
.../persistence/GeoQueryBooleanTest.java | 7 +-
.../apache/usergrid/persistence/IndexIT.java | 14 +-
.../usergrid/persistence/PathQueryIT.java | 10 +-
.../PerformanceEntityRebuildIndexTest.java | 6 +-
.../usergrid/persistence/PermissionsIT.java | 5 +-
.../cassandra/EntityManagerFactoryImplIT.java | 9 +-
.../query/AbstractIteratingQueryIT.java | 3 +-
stack/core/src/test/resources/log4j.properties | 5 +-
.../data/DataMigrationManagerImpl.java | 29 ++-
.../persistence/index/IndexIdentifier.java | 4 +
.../index/impl/EsEntityIndexImpl.java | 80 ++++---
.../persistence/queue/DefaultQueueManager.java | 68 ++++++
.../usergrid/services/TestQueueManager.java | 65 ------
.../AbstractServiceNotificationIT.java | 16 +-
.../apns/NotificationsServiceIT.java | 12 +-
.../gcm/NotificationsServiceIT.java | 15 +-
25 files changed, 570 insertions(+), 468 deletions(-)
----------------------------------------------------------------------
[15/15] incubator-usergrid git commit: Merge remote-tracking branch
'origin/two-dot-o' into USERGRID-252
Posted by gr...@apache.org.
Merge remote-tracking branch 'origin/two-dot-o' into USERGRID-252
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/43ed8464
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/43ed8464
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/43ed8464
Branch: refs/heads/two-dot-o
Commit: 43ed8464f81316619f3985a43fb61d2a0aa1c78a
Parents: 5d4ce72 04679c8
Author: Todd Nine <tn...@apigee.com>
Authored: Tue Dec 9 17:31:33 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Tue Dec 9 17:31:33 2014 -0700
----------------------------------------------------------------------
.../corepersistence/CpEntityManagerFactory.java | 4 +-
.../persistence/index/AliasedEntityIndex.java | 48 ++++++++
.../usergrid/persistence/index/EntityIndex.java | 5 -
.../usergrid/persistence/index/IndexFig.java | 3 +
.../index/impl/EsEntityIndexBatchImpl.java | 38 +++++--
.../index/impl/EsEntityIndexImpl.java | 44 ++++---
.../persistence/index/impl/EsIndexCache.java | 114 +++++++++++++++++++
.../persistence/index/impl/EntityIndexTest.java | 61 +++++++---
8 files changed, 273 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
[03/15] incubator-usergrid git commit: add delete and put methods
Posted by gr...@apache.org.
add delete and put 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/3079231c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/3079231c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/3079231c
Branch: refs/heads/two-dot-o
Commit: 3079231c92fc100caf5b02aa6e3e98b11b522a1f
Parents: 2372701
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Dec 3 20:54:55 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Dec 3 20:54:55 2014 -0700
----------------------------------------------------------------------
.../usergrid/scenarios/UserScenarios.scala | 38 ++++++++++++++------
1 file changed, 27 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3079231c/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 2bbe9a3..eeecffa 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/UserScenarios.scala
@@ -35,7 +35,9 @@ import io.gatling.core.Predef._
http("GET user")
.get("/users/${username}")
.headers(Headers.jsonAuthorized)
- .check(status.saveAs("userStatus"), jsonPath("$..entities[0]").exists, jsonPath("$..entities[0].uuid").exists, jsonPath("$..entities[0].uuid").saveAs("userId"))
+ .check(status.saveAs("userStatus"), jsonPath("$..entities[0]").exists,
+ jsonPath("$..entities[0].uuid").exists, jsonPath("$..entities[0].uuid").saveAs("userId"),
+ jsonPath("$..entities[0].username").exists, jsonPath("$..entities[0].uuid").saveAs("username"))
)
@@ -66,22 +68,36 @@ import io.gatling.core.Predef._
exec(postUser)
}
-
- val putUser =
- exec(getUserByUsername)
- .doIf("${userStatus}", "200") {
- exec(
- http("POST geolocated Users")
- .put("/users")
- .body(new StringBody( """{"location":{"latitude":"${latitude}","longitude":"${longitude}"},"username":"${username}",
+ val putUser = exec(
+ http("PUT geolocated Users")
+ .put("/users/${username}")
+ .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), jsonPath("$..entities[0].uuid").saveAs("userId"))
+ .check(status.is(200), jsonPath("$..entities[0].uuid").saveAs("userId"))
- )
+ )
+
+ val putUserIfExists =
+ exec(getUserByUsername)
+ .doIf("${userStatus}", "200") {
+ putUser
}
+ val deleteUser = exec(
+ http("PUT geolocated Users")
+ .delete("/users/${username}")
+ .check(status.is(200))
+
+ )
+
+ val deleteUserIfExists =
+ exec(getUserByUsername)
+ .doIf("${userStatus}", "200") {
+ deleteUser
+ }
+
/**
* Get a collection of users without a cursor. Sets the cursor and entities array as "users"
*/
[08/15] incubator-usergrid git commit: Added session injection of a
singleton token for removing post from report
Posted by gr...@apache.org.
Added session injection of a singleton token for removing post from report
Created 2 distinct scenarios for users get by username and get by page.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/9ad779eb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/9ad779eb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/9ad779eb
Branch: refs/heads/two-dot-o
Commit: 9ad779ebf6e27f1e676207752afb53e8da9fdfae
Parents: c64fcba
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Dec 4 16:12:56 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Dec 4 16:12:56 2014 -0700
----------------------------------------------------------------------
.../apache/usergrid/helpers/Extractors.scala | 11 +++++
.../usergrid/scenarios/UserScenarios.scala | 26 ++++++----
.../org/apache/usergrid/settings/Headers.scala | 6 ++-
.../simulations/GetUserPagesSimulation.scala | 51 ++++++++++++++++++++
.../simulations/GetUsersSimulation.scala | 2 +-
5 files changed, 85 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ad779eb/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
index 055bf8d..3e85712 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
@@ -66,6 +66,17 @@ object Extractors {
}
+ val ManagementToken: String = Setup.getManagementToken()
+
+
+ /**
+ * Get the management token for the admin username and password in settings, then inject it into the session
+ * under the variable "authToken"
+ * @return
+ */
+ def injectStaticTokenToSession() : Expression[Session] = {
+ session => session.set("authToken", ManagementToken)
+ }
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ad779eb/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 e48b60c..2cfdef2 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
@@ -24,7 +24,6 @@ import org.apache.usergrid.datagenerators.FeederGenerator
import org.apache.usergrid.settings.{Headers, Settings, Utils}
import org.apache.usergrid.helpers.Extractors._
-import scala.util.parsing.json.JSONArray
object UserScenarios {
@@ -86,9 +85,11 @@ object UserScenarios {
exec(postUser)
}
+
val putUser = exec(
http("PUT geolocated Users")
.put("/users/${username}")
+ .headers(Headers.jsonAuthorized)
.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}",
@@ -99,10 +100,10 @@ object UserScenarios {
val deleteUser = exec(
- http("PUT geolocated Users")
+ http("DELETE geolocated Users")
.delete("/users/${username}")
+ .headers(Headers.jsonAuthorized)
.check(status.is(200))
-
)
val deleteUserIfExists =
@@ -175,27 +176,34 @@ object UserScenarios {
/**
* Puts a new user every time
*/
- val putUsersInfinitely = scenario("Put Users")
+ val putUsersInfinitely = scenario("Put Users").exec(injectStaticTokenToSession)
.feed(Settings.getInfiniteUserFeeder())
.exec(putUser)
/**
* Deletes user every time
*/
- val deleteUsersInfinitely = scenario("Delete Users")
+ val deleteUsersInfinitely = scenario("Delete Users").exec(injectStaticTokenToSession)
.feed(Settings.getInfiniteUserFeeder())
.exec(deleteUser)
/**
* Get the users a page at a time until exhausted
*/
- val getUsersToEnd = scenario("Get Users")
- //get the management token
- .exec(TokenScenarios.getManagementToken)
+ val getUserPagesToEnd = scenario("Get User Pages").exec(injectStaticTokenToSession)
//get users without a cursor
.exec(getUsersWithoutCursor)
//as long as we have a cursor, keep getting results
.asLongAs(stringParamExists(SessionVarCursor)) {
exec(getUsersWithCursor)
- }
+ }.exec(sessionFunction => {
+ sessionFunction
+ })
+
+ val getUsersByUsername = scenario("Get User By Username").exec(injectStaticTokenToSession)
+ .feed(Settings.getInfiniteUserFeeder())
+ //get users without a cursor
+ .exec(getUserByUsername)
+
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ad779eb/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Headers.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Headers.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Headers.scala
index 9b735e5..6cd6f2e 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Headers.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Headers.scala
@@ -16,7 +16,9 @@
*/
package org.apache.usergrid.settings
-/**
+ import org.apache.usergrid.helpers.Setup
+
+ /**
*
*/
object Headers {
@@ -40,4 +42,6 @@ object Headers {
+
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ad779eb/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUserPagesSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUserPagesSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUserPagesSimulation.scala
new file mode 100755
index 0000000..5d76ca0
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUserPagesSimulation.scala
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.simulations
+
+import io.gatling.core.Predef._
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * Posts application users continually to an application. Expects the following parameters
+ *
+ * -DmaxPossibleUsers : The maximum number of users to be making requests as fast as possible. Think of this as conccurrent users in the system
+ * -DrampTime: The amount of time (in seconds) to allow for maxPossibleUsers to be reached. This will add new users linearlly
+ * -Dduration: The amount of time (in seconds) to continue to perform requests up with the maxPossibleUsers
+ */
+class GetUserPagesSimulation extends Simulation {
+
+ println("Begin setup")
+ Setup.setupOrg()
+ Setup.setupApplication()
+ println("End Setup")
+
+
+ setUp(
+ UserScenarios.getUserPagesToEnd
+ .inject(
+ /**
+ * injection steps take from this forum post
+ * https://groups.google.com/forum/#!topic/gatling/JfYHaWCbA-w
+ */
+ rampUsers(Settings.maxPossibleUsers) over Settings.rampTime,
+ constantUsersPerSec(Settings.maxPossibleUsers) during Settings.duration
+
+ )).protocols(Settings.httpConf.acceptHeader("application/json"))
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ad779eb/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
index cceab3c..a088e27 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/GetUsersSimulation.scala
@@ -37,7 +37,7 @@ class GetUsersSimulation extends Simulation {
setUp(
- UserScenarios.getUsersToEnd
+ UserScenarios.getUsersByUsername
.inject(
/**
* injection steps take from this forum post
[05/15] incubator-usergrid git commit: new simulations for put and
delete
Posted by gr...@apache.org.
new simulations for put and delete
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/949daf8d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/949daf8d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/949daf8d
Branch: refs/heads/two-dot-o
Commit: 949daf8dc67a995f7da42d2069a8ff1de793a6ec
Parents: 5542814
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Dec 4 09:30:01 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Dec 4 09:30:01 2014 -0700
----------------------------------------------------------------------
.../simulations/DeleteUsersSimulation.scala | 56 ++++++++++++++++++++
.../simulations/PutUsersSimulation.scala | 56 ++++++++++++++++++++
2 files changed, 112 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/949daf8d/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/DeleteUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/DeleteUsersSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/DeleteUsersSimulation.scala
new file mode 100644
index 0000000..bcfbe2d
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/DeleteUsersSimulation.scala
@@ -0,0 +1,56 @@
+/*
+ *
+ * * Licensed to the Apache Software Foundation (ASF) under one or more
+ * * contributor license agreements. The ASF licenses this file to You
+ * * under the Apache License, Version 2.0 (the "License"); you may not
+ * * use this file except in compliance with the License.
+ * * You may obtain a copy of the License at
+ * *
+ * * http://www.apache.org/licenses/LICENSE-2.0
+ * *
+ * * Unless required by applicable law or agreed to in writing, software
+ * * distributed under the License is distributed on an "AS IS" BASIS,
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * * See the License for the specific language governing permissions and
+ * * limitations under the License. For additional information regarding
+ * * copyright in this work, please see the NOTICE file in the top level
+ * * directory of this distribution.
+ *
+ */
+
+package org.apache.usergrid.simulations
+
+import io.gatling.core.Predef._
+import io.gatling.core.scenario.Simulation
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * Deletes application users continually to an application. Expects the following parameters
+ *
+ * -DmaxPossibleUsers : The maximum number of users to be making requests as fast as possible. Think of this as conccurrent users in the system
+ * -DrampTime: The amount of time (in seconds) to allow for maxPossibleUsers to be reached. This will add new users linearlly
+ * -Dduration: The amount of time (in seconds) to continue to perform requests up with the maxPossibleUsers
+ */
+class DeleteUsersSimulation extends Simulation {
+
+ println("Begin setup")
+ Setup.setupOrg()
+ Setup.setupApplication()
+ println("End Setup")
+
+
+ setUp(
+ UserScenarios.deleteUsersInfinitely
+ .inject(
+ /**
+ * injection steps take from this forum post
+ * https://groups.google.com/forum/#!topic/gatling/JfYHaWCbA-w
+ */
+ rampUsers(Settings.maxPossibleUsers) over Settings.rampTime,
+ constantUsersPerSec(Settings.maxPossibleUsers) during Settings.duration
+
+ )).protocols(Settings.httpConf.acceptHeader("application/json"))
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/949daf8d/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutUsersSimulation.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutUsersSimulation.scala
new file mode 100644
index 0000000..f89952c
--- /dev/null
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PutUsersSimulation.scala
@@ -0,0 +1,56 @@
+/*
+ *
+ * * Licensed to the Apache Software Foundation (ASF) under one or more
+ * * contributor license agreements. The ASF licenses this file to You
+ * * under the Apache License, Version 2.0 (the "License"); you may not
+ * * use this file except in compliance with the License.
+ * * You may obtain a copy of the License at
+ * *
+ * * http://www.apache.org/licenses/LICENSE-2.0
+ * *
+ * * Unless required by applicable law or agreed to in writing, software
+ * * distributed under the License is distributed on an "AS IS" BASIS,
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * * See the License for the specific language governing permissions and
+ * * limitations under the License. For additional information regarding
+ * * copyright in this work, please see the NOTICE file in the top level
+ * * directory of this distribution.
+ *
+ */
+
+package org.apache.usergrid.simulations
+
+import io.gatling.core.Predef._
+import io.gatling.core.scenario.Simulation
+import org.apache.usergrid.helpers.Setup
+import org.apache.usergrid.scenarios.UserScenarios
+import org.apache.usergrid.settings.Settings
+
+/**
+ * PUTS application users continually to an application. Expects the following parameters
+ *
+ * -DmaxPossibleUsers : The maximum number of users to be making requests as fast as possible. Think of this as conccurrent users in the system
+ * -DrampTime: The amount of time (in seconds) to allow for maxPossibleUsers to be reached. This will add new users linearlly
+ * -Dduration: The amount of time (in seconds) to continue to perform requests up with the maxPossibleUsers
+ */
+class PutUsersSimulation extends Simulation {
+
+ println("Begin setup")
+ Setup.setupOrg()
+ Setup.setupApplication()
+ println("End Setup")
+
+
+ setUp(
+ UserScenarios.putUsersInfinitely
+ .inject(
+ /**
+ * injection steps take from this forum post
+ * https://groups.google.com/forum/#!topic/gatling/JfYHaWCbA-w
+ */
+ rampUsers(Settings.maxPossibleUsers) over Settings.rampTime,
+ constantUsersPerSec(Settings.maxPossibleUsers) during Settings.duration
+
+ )).protocols(Settings.httpConf.acceptHeader("application/json"))
+
+}
[11/15] incubator-usergrid git commit: Merge remote-tracking branch
'origin/two-dot-o' into USERGRID-252
Posted by gr...@apache.org.
Merge remote-tracking branch 'origin/two-dot-o' into USERGRID-252
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/1b239b7f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1b239b7f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1b239b7f
Branch: refs/heads/two-dot-o
Commit: 1b239b7fa7da3e95175286e47422a955580ee6a7
Parents: d52a185 c4973e9
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Dec 5 14:12:05 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Dec 5 14:12:05 2014 -0700
----------------------------------------------------------------------
.../org/apache/usergrid/persistence/GeoIT.java | 771 +++++++++----------
1 file changed, 371 insertions(+), 400 deletions(-)
----------------------------------------------------------------------
[12/15] incubator-usergrid git commit: Added license headers to files
Posted by gr...@apache.org.
Added license headers to files
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/ecce52d4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/ecce52d4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/ecce52d4
Branch: refs/heads/two-dot-o
Commit: ecce52d4fcda80cd063cccbb6ea4934c30c36777
Parents: 1b239b7
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Dec 5 14:15:24 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Dec 5 14:15:24 2014 -0700
----------------------------------------------------------------------
stack/loadtests/runtests.sh | 13 ++++++
.../apache/usergrid/helpers/Extractors.scala | 49 ++++++++++----------
.../org/apache/usergrid/helpers/Setup.scala | 30 ++++++------
3 files changed, 53 insertions(+), 39 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ecce52d4/stack/loadtests/runtests.sh
----------------------------------------------------------------------
diff --git a/stack/loadtests/runtests.sh b/stack/loadtests/runtests.sh
index 171d561..0897d25 100755
--- a/stack/loadtests/runtests.sh
+++ b/stack/loadtests/runtests.sh
@@ -1,4 +1,17 @@
#!/bin/bash
+#
+# Licensed 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.
+#
die() { echo "$@" 1>&2 ; exit 1; }
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ecce52d4/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
index 3e85712..aa8c614 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
@@ -1,35 +1,37 @@
+/*
+ *
+ * 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 io.gatling.core.Predef._
import io.gatling.core.session._
import io.gatling.http.Predef._
-import scala.util.parsing.json.JSONArray
-
/**
* Helper object that will perform extractions
*/
object Extractors {
-// /**
-// * Will extract the cursor from the response. If the cursor is not present, an empty string will be set
-// */
-// val maybeExtractCursor = jsonPath("$..cursor").transformOption( extract => {
-// //it may or may not be present. If it is, save it, otherwise save it as an empty string
-// extract.orElse(Some(""))
-// }).saveAs("cursor")
-//
-// /**
-// * Will extract entities as a json array into the session. If they do not exist, it will set to an empty list
-// */
-// val maybeExtractEntities = jsonPath("..entities").transformOption(extract => {
-// extract.orElse(Some(JSONArray(List())));
-// }).saveAs("entities")
-
/**
* Will extract the cursor from the response. If the cursor is not present, an empty string will be set
*/
- def maybeExtractCursor(saveAsName : String) = {
+ def maybeExtractCursor(saveAsName: String) = {
jsonPath("$..cursor").transformOption(extract => {
//it may or may not be present. If it is, save it, otherwise save it as an empty string
extract.orElse(Some(""))
@@ -42,7 +44,7 @@ object Extractors {
* @param nameInSession The name of the variable in the session
* @return
*/
- def stringParamExists (nameInSession: String) : Expression[Boolean] = {
+ def stringParamExists(nameInSession: String): Expression[Boolean] = {
session => session(nameInSession) != null && session(nameInSession).as[String] != ""
}
@@ -61,12 +63,12 @@ object Extractors {
* @param nameInSession The name ot use when saving to the session
* @return
*/
- def sequenceHasElements(nameInSession: String) : Expression[Boolean] = {
+ def sequenceHasElements(nameInSession: String): Expression[Boolean] = {
session => session(nameInSession) != null && session(nameInSession).as[Seq[Any]].length > 0
}
- val ManagementToken: String = Setup.getManagementToken()
+ val ManagementToken: String = Setup.getManagementToken()
/**
@@ -74,10 +76,9 @@ object Extractors {
* under the variable "authToken"
* @return
*/
- def injectStaticTokenToSession() : Expression[Session] = {
- session => session.set("authToken", ManagementToken)
+ def injectStaticTokenToSession(): Expression[Session] = {
+ session => session.set("authToken", ManagementToken)
}
-
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ecce52d4/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 2dd0ed7..fb0bcde 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
@@ -1,20 +1,20 @@
/*
*
- * * 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.
+ * 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.
*
*/