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/10/23 18:21:18 UTC
git commit: Fixes package names
Repository: incubator-usergrid
Updated Branches:
refs/heads/gatlingdev 6a1d84c7e -> 724ba365e
Fixes package names
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/724ba365
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/724ba365
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/724ba365
Branch: refs/heads/gatlingdev
Commit: 724ba365e3cbcf23eecf4c6d317b51bfecfc5fd6
Parents: 6a1d84c
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Oct 23 10:21:16 2014 -0600
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Oct 23 10:21:16 2014 -0600
----------------------------------------------------------------------
stack/gatling/pom.xml | 4 +
.../data-generators/EntityDataGenerator.scala | 57 -----------
.../data-generators/FeederGenerator.scala | 101 -------------------
.../PushNotificationTargetUserSimulation.scala | 18 ++--
4 files changed, 13 insertions(+), 167 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/724ba365/stack/gatling/pom.xml
----------------------------------------------------------------------
diff --git a/stack/gatling/pom.xml b/stack/gatling/pom.xml
index 3d748cc..c39e3a8 100644
--- a/stack/gatling/pom.xml
+++ b/stack/gatling/pom.xml
@@ -129,6 +129,10 @@
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
+ <configuration>
+ <simulationsFolder>src/main/scala</simulationsFolder>
+ </configuration>
+
</plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/724ba365/stack/gatling/src/main/scala/org/apache/usergrid/data-generators/EntityDataGenerator.scala
----------------------------------------------------------------------
diff --git a/stack/gatling/src/main/scala/org/apache/usergrid/data-generators/EntityDataGenerator.scala b/stack/gatling/src/main/scala/org/apache/usergrid/data-generators/EntityDataGenerator.scala
deleted file mode 100755
index b1a7a90..0000000
--- a/stack/gatling/src/main/scala/org/apache/usergrid/data-generators/EntityDataGenerator.scala
+++ /dev/null
@@ -1,57 +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
-
-import scala.collection.mutable.ArrayBuffer
-
-object EntityDataGenerator {
-
- def generateBlockUserLists(numUsers: Int): Map[String, String] = {
-
- var blocks: ArrayBuffer[String] = new ArrayBuffer[String]
- var blockedBy: ArrayBuffer[String] = new ArrayBuffer[String]
-
- for (numBlock <- 1 to Utils.generateRandomInt(1, 7)) {
- blocks += "user".concat(Utils.generateRandomInt(1, numUsers).toString)
- }
-
- for (numBlockedBy <- 1 to Utils.generateRandomInt(1, 7)) {
- blockedBy += "user".concat(Utils.generateRandomInt(1, numUsers).toString)
- }
-
- return Map("blocks" -> blocks.toArray.mkString(","), "blockedBy" -> blockedBy.toArray.mkString(","))
-
- }
-
- def generateUser(userId: Int): Map[String,String] = {
-
- 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,
- "ethnicity" -> Utils.generateRandomInt(1, 15).toString,
- "relationshipStatus" -> Utils.generateRandomInt(1, 4).toString,
- "headline" -> "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
- "aboutMe" -> "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
- "age" -> Utils.generateRandomInt(18, 65).toString,
- "height" -> Utils.generateRandomInt(48, 84).toString,
- "weight" -> Utils.generateRandomInt(120, 350).toString,
- "seen" -> Utils.generateRandomInt(50, 100000).toString
- )
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/724ba365/stack/gatling/src/main/scala/org/apache/usergrid/data-generators/FeederGenerator.scala
----------------------------------------------------------------------
diff --git a/stack/gatling/src/main/scala/org/apache/usergrid/data-generators/FeederGenerator.scala b/stack/gatling/src/main/scala/org/apache/usergrid/data-generators/FeederGenerator.scala
deleted file mode 100755
index ffe324c..0000000
--- a/stack/gatling/src/main/scala/org/apache/usergrid/data-generators/FeederGenerator.scala
+++ /dev/null
@@ -1,101 +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
-
-import io.gatling.core.Predef._
-import scala.collection.mutable.ArrayBuffer
-
-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 geolocation: Map[String, String] = Utils.generateRandomGeolocation(radius, centerLatitude, centerLongitude)
- var blockLists: Map[String, String] = EntityDataGenerator.generateBlockUserLists(numUsers)
-
- user = user ++ geolocation ++ blockLists
-
- userArray += user
- }
- return userArray.toArray
- }
-
- def generateGeolocationFeeder(radius: Double, centerLatitude: Double, centerLongitude: Double): Feeder[String] = {
-
- val geolocationFeeder = new Feeder[String] {
-
- // always return true as this feeder can be polled infinitively
- override def hasNext = true
-
- override def next: Map[String, String] = {
- var geolocation: Map[String, String] = Utils.generateRandomGeolocation(radius, centerLatitude, centerLongitude)
- Map("latitude" -> geolocation("latitude"), "longitude" -> geolocation("longitude"))
- }
- }
-
- return geolocationFeeder
-
- }
-
- def generateGeolocationWithQueryFeeder(radius: Double, centerLatitude: Double, centerLongitude: Double): Feeder[String] = {
-
- val geolocationFeeder = new Feeder[String] {
-
- // always return true as this feeder can be polled infinitively
- override def hasNext = true
-
- override def next: Map[String, String] = {
- var geolocation: Map[String, String] = Utils.generateRandomGeolocation(radius, centerLatitude, centerLongitude)
- var queryParams = Utils.generateRandomQueryString
- Map("latitude" -> geolocation("latitude"), "longitude" -> geolocation("longitude"), "queryParams" -> queryParams)
- }
- }
-
- return geolocationFeeder
-
- }
-
- def generateUserConnectionFeeder(numUsers: Int): Feeder[String] = {
-
- val userIdFeeder = new Feeder[String] {
-
- // always return true as this feeder can be polled infinitively
- override def hasNext = true
-
- override def next: Map[String, String] = {
- Map("user1" -> "user".concat(Utils.generateRandomInt(1, numUsers).toString), "user2" -> "user".concat(Utils.generateRandomInt(1, numUsers).toString))
- }
- }
-
- return userIdFeeder
-
- }
-
- def generateEntityNameFeeder(prefix: String, numEntities: Int): Array[Map[String, String]] = {
-
- var nameArray: ArrayBuffer[Map[String, String]] = new ArrayBuffer[Map[String, String]]
-
- for (entityCount <- 1 to numEntities) {
- nameArray += Map("entityName" -> prefix.concat(entityCount.toString))
- }
-
- return nameArray.toArray
-
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/724ba365/stack/gatling/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/gatling/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala b/stack/gatling/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
index 823064d..fa418ec 100644
--- a/stack/gatling/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
+++ b/stack/gatling/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
@@ -55,15 +55,15 @@ class PushNotificationTargetUserSimulation extends Simulation {
.get("/devices/${entityName}/users")
.check(status.is(200))
)
- .exec(http("Connect user with device")
- .post("/users/${username}/devices/${deviceId}")
- .check(status.is(200))
- )
- .exec(http("Send Notification to All Devices")
- .post("/users/${username}/notifications")
- .body(StringBody("{\"payloads\":{\"" + notifier + "\":\"testmessage\"}}"))
- .check(status.is(200))
- )
+// .exec(http("Connect user with device")
+// .post("/users/${username}/devices/${deviceId}")
+// .check(status.is(200))
+// )
+// .exec(http("Send Notification to All Devices")
+// .post("/users/${username}/notifications")
+// .body(StringBody("{\"payloads\":{\"" + notifier + "\":\"testmessage\"}}"))
+// .check(status.is(200))
+// )
setUp(scnToRun.inject(constantUsersPerSec(numUsers) during (duration)).throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf))