usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [15/21] incubator-usergrid git commit: USERGRID-871: sort UUID map before writing
Date Mon, 03 Aug 2015 20:30:59 GMT
USERGRID-871: sort UUID map before writing


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

Branch: refs/heads/two-dot-o-dev
Commit: 0a0ef1b91c5dce394c6358b75e2e5ff1e5a0ba43
Parents: af446be
Author: Mike Dunker <mdunker@apigee.com>
Authored: Thu Jul 30 09:33:17 2015 -0700
Committer: Mike Dunker <mdunker@apigee.com>
Committed: Thu Jul 30 09:33:17 2015 -0700

----------------------------------------------------------------------
 .../usergrid/scenarios/EntityCollectionScenarios.scala   |  6 +++---
 .../scala/org/apache/usergrid/settings/Settings.scala    | 11 ++++++-----
 stack/loadtests/src/test/resources/logback-test.xml      |  3 ++-
 3 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0a0ef1b9/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala
index 4e37842..b661d9c 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala
@@ -196,7 +196,7 @@ object EntityCollectionScenarios {
         // 200 for success, 400 if already exists
         .check(status.in(Seq(200)), extractCreateUuid(SessionVarUuid)))
         .exec(session => {
-          Settings.addUuid(session("entityNum").as[String], session(SessionVarUuid).as[String])
+          Settings.addUuid(session("entityNum").as[String].toInt, session(SessionVarUuid).as[String])
           session
         })
     }
@@ -234,10 +234,10 @@ object EntityCollectionScenarios {
     .exec(injectAuthType())
     .asLongAs(session => session("validEntity").asOption[String].map(validEntity =>
validEntity != "no").getOrElse[Boolean](true)) {
     feed(FeederGenerator.generateCustomEntityFeeder(Settings.numEntities, Settings.entityType,
Settings.entityPrefix, Settings.entitySeed))
-      .exec {
+      /*.exec {
       session => if (session("validEntity").as[String] == "yes") { println("Deleting entity
#" + session("entityNum").as[String]) }
         session
-      }
+      }*/
       .doIf(session => session("validEntity").as[String] == "yes") {
         exec(deleteEntity)
       }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0a0ef1b9/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 dc7ff73..387fd24 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
@@ -158,9 +158,9 @@ object Settings {
   val feedUuidFilename = if (feedUuids) uuidFilename else dummyCsv
   val purgeUsers:Int = initIntSetting(ConfigProperties.PurgeUsers)
 
-  private var uuidMap: Map[String, String] = Map()
-  def addUuid(name: String, uuid: String): Unit = {
-    if (captureUuids) uuidMap += (name -> uuid)
+  private var uuidMap: Map[Int, String] = Map()
+  def addUuid(num: Int, uuid: String): Unit = {
+    if (captureUuids) uuidMap += (num -> uuid)
     // println(s"UUID: ${name},${uuid}")
   }
 
@@ -171,8 +171,9 @@ object Settings {
         new PrintWriter(fos, false)
       }
       writer.println("name,uuid")
-      uuidMap.keys.foreach { name =>
-        writer.println(s"${Settings.entityPrefix}${name},${uuidMap(name)}")
+      val uuidList: List[(Int, String)] = uuidMap.toList.sortBy(l => l._1)
+      uuidList.foreach { l =>
+        writer.println(s"${Settings.entityPrefix}${l._1},${l._2}")
       }
       writer.flush()
       writer.close()

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0a0ef1b9/stack/loadtests/src/test/resources/logback-test.xml
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/test/resources/logback-test.xml b/stack/loadtests/src/test/resources/logback-test.xml
index 5ad4ea3..dd39a3e 100644
--- a/stack/loadtests/src/test/resources/logback-test.xml
+++ b/stack/loadtests/src/test/resources/logback-test.xml
@@ -27,8 +27,9 @@
 
 	<!-- Uncomment for logging ALL HTTP request and responses -->
 	 	<!-- <logger name="io.gatling.http.ahc.AsyncHandlerActor" level="TRACE" /> -->
+        <logger name="io.gatling.http.ahc.AsyncHandlerActor" level="TRACE" />
 	<!-- Uncomment for logging ONLY FAILED HTTP request and responses -->
-		<logger name="io.gatling.http.ahc.AsyncHandlerActor" level="DEBUG" />
+        <!-- <logger name="io.gatling.http.ahc.AsyncHandlerActor" level="DEBUG" />
-->
 
 <!-- <logger name="io.gatling.http" level="TRACE" /> -->
         <!-- Uncomment for logging ONLY FAILED HTTP request and responses -->


Mime
View raw message