usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [19/21] incubator-usergrid git commit: USERGRID-871: fix broken load test
Date Mon, 03 Aug 2015 20:31:03 GMT
USERGRID-871: fix broken load test


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

Branch: refs/heads/two-dot-o-dev
Commit: d6368af5ca08b2671b3cc6fe5d06b8d9dae658ed
Parents: 32fefb9
Author: Mike Dunker <mdunker@apigee.com>
Authored: Mon Aug 3 12:18:02 2015 -0700
Committer: Mike Dunker <mdunker@apigee.com>
Committed: Mon Aug 3 12:18:02 2015 -0700

----------------------------------------------------------------------
 .../loadtests/runAuditGetCollectionEntities.sh  |  4 +-
 stack/loadtests/runRandomEntityByUuidTest.sh    |  2 +-
 .../usergrid/scenarios/AuditScenarios.scala     |  1 +
 .../org/apache/usergrid/settings/Settings.scala | 72 +++++++++++++++++---
 .../simulations/ConfigurableSimulation.scala    |  1 +
 5 files changed, 67 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d6368af5/stack/loadtests/runAuditGetCollectionEntities.sh
----------------------------------------------------------------------
diff --git a/stack/loadtests/runAuditGetCollectionEntities.sh b/stack/loadtests/runAuditGetCollectionEntities.sh
index f34ea54..673c2b7 100755
--- a/stack/loadtests/runAuditGetCollectionEntities.sh
+++ b/stack/loadtests/runAuditGetCollectionEntities.sh
@@ -38,7 +38,8 @@ ADMIN_PASSWORD=test
 ORG=gatling
 APP=millionentities
 SCENARIO_TYPE=auditGetCollectionEntities
-SEARCH_LIMIT=1000
+SEARCH_LIMIT=177
+SEARCH_QUERY=order%20by%20name
 
 AUTH_TYPE=token
 TOKEN_TYPE=management
@@ -57,6 +58,7 @@ mvn gatling:execute \
 -DtokenType=${TOKEN_TYPE} \
 -DauditUuidFilename=${AUDIT_UUID_FILENAME} \
 -DsearchLimit=${SEARCH_LIMIT} \
+-DsearchQuery=${SEARCH_QUERY} \
 -Dgatling.simulationClass=org.apache.usergrid.simulations.AuditSimulation
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d6368af5/stack/loadtests/runRandomEntityByUuidTest.sh
----------------------------------------------------------------------
diff --git a/stack/loadtests/runRandomEntityByUuidTest.sh b/stack/loadtests/runRandomEntityByUuidTest.sh
index 4a83eb5..50f15e8 100755
--- a/stack/loadtests/runRandomEntityByUuidTest.sh
+++ b/stack/loadtests/runRandomEntityByUuidTest.sh
@@ -55,7 +55,7 @@ AUTH_TYPE=anonymous
 TOKEN_TYPE=management
 END_CONDITION_TYPE=minutesElapsed
 #END_CONDITION_TYPE=requestCount
-END_MINUTES=2
+END_MINUTES=10
 END_REQUEST_COUNT=100
 
 #Execute the test

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d6368af5/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala
index b58ee07..93440ac 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala
@@ -43,6 +43,7 @@ object AuditScenarios {
       (if (Settings.searchLimit > 0) s"limit=${Settings.searchLimit}&" else "")
 
     // remove trailing & or ?
+    println (url.dropRight(1))
     url.dropRight(1)
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d6368af5/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 3c1c2e2..663d4d6 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
@@ -116,6 +116,7 @@ object Settings {
   val overallEntitySeed = initIntSetting(ConfigProperties.EntitySeed)
   val searchLimit:Int = initIntSetting(ConfigProperties.SearchLimit)
   val searchQuery = initStrSetting(ConfigProperties.SearchQuery)
+  println(s"searchQuery=${searchQuery}")
   val endConditionType = initStrSetting(ConfigProperties.EndConditionType)
   val endMinutes:Int = initIntSetting(ConfigProperties.EndMinutes)
   val endRequestCount:Int = initIntSetting(ConfigProperties.EndRequestCount)
@@ -153,27 +154,76 @@ object Settings {
   private val dummyTestCsv = ConfigProperties.getDefault(ConfigProperties.UuidFilename).toString
   private val dummyAuditCsv = ConfigProperties.getDefault(ConfigProperties.AuditUuidFilename).toString
   private val dummyAuditFailedCsv = ConfigProperties.getDefault(ConfigProperties.FailedUuidFilename).toString
+  private val dummyCaptureCsv = "/tmp/notused.csv"
 
   private val uuidFilename = initStrSetting(ConfigProperties.UuidFilename)
   private val auditUuidFilename = initStrSetting(ConfigProperties.AuditUuidFilename)
   private val failedUuidFilename = initStrSetting(ConfigProperties.FailedUuidFilename)
 
   // feeds require valid files, even if test won't be run
-  val feedUuids = uuidFilename != dummyTestCsv && scenarioType == ScenarioType.UuidRandomInfinite
-  val feedUuidFilename = uuidFilename
+  val feedUuids = scenarioType match {
+    case ScenarioType.UuidRandomInfinite => true
+    case _ => false
+  }
+  val feedUuidFilename = scenarioType match {
+    case ScenarioType.UuidRandomInfinite => uuidFilename
+    case _ => dummyTestCsv
+  }
+  if (feedUuids && feedUuidFilename == dummyTestCsv) {
+    println("Scenario requires CSV file containing UUIDs")
+    System.exit(1)
+  }
 
-  val feedAuditUuids = uuidFilename != dummyAuditCsv && scenarioType == ScenarioType.AuditVerifyCollectionEntities
-  val feedAuditUuidFilename = auditUuidFilename
+  val feedAuditUuids = scenarioType match {
+    case ScenarioType.AuditVerifyCollectionEntities => true
+    case _ => false
+  }
+  val feedAuditUuidFilename = scenarioType match {
+    case ScenarioType.AuditVerifyCollectionEntities => auditUuidFilename
+    case _ => dummyAuditCsv
+  }
+  if (feedAuditUuids && feedAuditUuidFilename == dummyAuditCsv) {
+    println("Scenario requires CSV file containing audit UUIDs")
+    System.exit(1)
+  }
 
-  // also uses uuidFilename
-  val captureUuids = uuidFilename != dummyTestCsv && (scenarioType == ScenarioType.LoadEntities
|| scenarioType == ScenarioType.GetByNameSequential)
-  val captureUuidFilename = uuidFilename
+  val captureUuidFilename = scenarioType match {
+    case ScenarioType.LoadEntities => uuidFilename
+    case ScenarioType.GetByNameSequential => uuidFilename
+    case _ => dummyCaptureCsv   // won't write to this file
+  }
+  val captureUuids = if (captureUuidFilename == dummyCaptureCsv) false
+    else scenarioType match {
+      case ScenarioType.LoadEntities => true
+      case ScenarioType.GetByNameSequential => true
+      case _ => false
+    }
 
-  val captureAuditUuids = (auditUuidFilename != dummyAuditCsv && scenarioType ==
ScenarioType.AuditGetCollectionEntities) ||
-                          (failedUuidFilename != dummyAuditFailedCsv && scenarioType
== ScenarioType.AuditVerifyCollectionEntities)
-  println(s"auditUuidFilename=$auditUuidFilename")
+  val captureAuditUuidFilename = scenarioType match {
+    case ScenarioType.AuditGetCollectionEntities => auditUuidFilename
+    case ScenarioType.AuditVerifyCollectionEntities => failedUuidFilename
+    case _ => dummyCaptureCsv   // won't write to this file
+  }
+  if (scenarioType == ScenarioType.AuditGetCollectionEntities && captureAuditUuidFilename
== dummyCaptureCsv) {
+    println("Scenario requires CSV file location to capture audit UUIDs")
+    System.exit(1)
+  }
+  val captureAuditUuids = (scenarioType == ScenarioType.AuditGetCollectionEntities) ||
+                          (scenarioType == ScenarioType.AuditVerifyCollectionEntities &&
captureAuditUuidFilename != dummyAuditFailedCsv)
+
+  //val feedUuids = uuidFilename != dummyTestCsv && scenarioType == ScenarioType.UuidRandomInfinite
+  //val feedAuditUuids = uuidFilename != dummyAuditCsv && scenarioType == ScenarioType.AuditVerifyCollectionEntities
+  // val captureUuids = uuidFilename != dummyTestCsv && (scenarioType == ScenarioType.LoadEntities
|| scenarioType == ScenarioType.GetByNameSequential)
+
+  //val captureAuditUuids = (auditUuidFilename != dummyAuditCsv && scenarioType ==
ScenarioType.AuditGetCollectionEntities) ||
+  //                        (failedUuidFilename != dummyAuditFailedCsv && scenarioType
== ScenarioType.AuditVerifyCollectionEntities)
+  println(s"feedUuids=$feedUuids")
+  println(s"feedUuidFilename=$feedUuidFilename")
+  println(s"feedAuditUuids=$feedAuditUuids")
+  println(s"feedAuditUuidFilename=$feedAuditUuidFilename")
+  println(s"captureUuids=$captureUuids")
+  println(s"captureUuidFilename=$captureUuidFilename")
   println(s"captureAuditUuids=$captureAuditUuids")
-  val captureAuditUuidFilename = if (scenarioType == ScenarioType.AuditVerifyCollectionEntities)
failedUuidFilename else auditUuidFilename
   println(s"captureAuditUuidFilename=$captureAuditUuidFilename")
 
   val purgeUsers:Int = initIntSetting(ConfigProperties.PurgeUsers)

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d6368af5/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConfigurableSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConfigurableSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConfigurableSimulation.scala
index b923c46..e52e3d8 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConfigurableSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConfigurableSimulation.scala
@@ -44,6 +44,7 @@ class ConfigurableSimulation extends Simulation {
       case ScenarioType.NameRandomInfinite => EntityCollectionScenarios.getRandomEntitiesByName
       case ScenarioType.UuidRandomInfinite => EntityCollectionScenarios.getRandomEntitiesByUuid
       case ScenarioType.GetByNameSequential => EntityCollectionScenarios.getEntitiesByNameSequential
+      case _ => null
     }
   }
 


Mime
View raw message