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/12/04 23:16:46 UTC
[2/2] incubator-usergrid git commit: Merge branch 'USERGRID-252' of
https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-252
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/USERGRID-252
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