usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdun...@apache.org
Subject usergrid git commit: USERGRID-1044: print progress during audit and log failures as such
Date Wed, 28 Oct 2015 14:29:29 GMT
Repository: usergrid
Updated Branches:
  refs/heads/USERGRID-1044 2e70a72b9 -> 2a09bf15d


USERGRID-1044: print progress during audit and log failures as such


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

Branch: refs/heads/USERGRID-1044
Commit: 2a09bf15d8063199bf25b7e7f437929601f7193a
Parents: 2e70a72
Author: Mike Dunker <mdunker@apigee.com>
Authored: Wed Oct 28 07:28:51 2015 -0700
Committer: Mike Dunker <mdunker@apigee.com>
Committed: Wed Oct 28 07:28:51 2015 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/datagenerators/FeederGenerator.scala | 8 ++++++++
 .../scala/org/apache/usergrid/scenarios/AuditScenarios.scala | 6 +++---
 .../usergrid/scenarios/EntityCollectionScenarios.scala       | 8 +++++---
 3 files changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/2a09bf15/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
index 38db19a..a9225b2 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/FeederGenerator.scala
@@ -255,6 +255,9 @@ object FeederGenerator {
     val csvLines = if (Settings.feedAuditUuids) Source.fromFile(Settings.feedAuditUuidFilename).getLines().toArray
else Array[String]()
     val csvLinesLen = csvLines.length
     var counter = new AtomicInteger(0)
+    var entityCounter: Long = 0L
+    var lastEntityCountPrinted: Long = 0L
+    var entityProgressCount: Long = Settings.entityProgressCount
 
     override def hasNext: Boolean = true
 
@@ -284,6 +287,11 @@ object FeederGenerator {
       val accessField = if (uuid != "") uuid else name
       val queryField = if (uuid != "") s"uuid='$uuid'" else s"name='$name'"
 
+      if (entityProgressCount > 0L && entityCounter >= lastEntityCountPrinted
+ entityProgressCount) {
+        println(s"CSV Entity: $entityCounter")
+        lastEntityCountPrinted = entityCounter
+      }
+
       Map("collectionName" -> collectionName, "name" -> name,  "uuid" -> uuid, "modified"
-> modified, "lastStatus" -> lastStatus,
         "validEntity" -> validEntity, "accessField" -> accessField, "queryField" ->
queryField)
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2a09bf15/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 1ce2bc2..d1e2c4b 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
@@ -202,15 +202,15 @@ object AuditScenarios {
             Settings.incAuditNotFoundViaQuery()
             println(s"NOT FOUND VIA QUERY: $collectionName.$reqName ($uuid)")
           }
-          session
+          session.markAsFailed
         } else if (saveFailures) {
           Settings.addAuditUuid(uuid, collectionName, reqName, modified, status, "Failure",
lastStatus)
-          session
+          session.markAsFailed
         } else {
           session.markAsFailed
         }
 
-      }).exitHereIfFailed
+      })
 
   val getCollectionEntity = exec(
     http("GET collection entity")

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2a09bf15/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 d5b3101..22b9f08 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
@@ -241,16 +241,18 @@ object EntityCollectionScenarios {
             val entityName = session("entityName").as[String]
             val modified = if (status == 200) session(SessionVarModified).as[Long] else 0
             val collectionName = session("collectionName").as[String]
+            Settings.addUuid(uuid, collectionName, entityName, modified, status)
             if (status != 200) {
               val bodyString = session(SessionVarBodyString).as[String]
               println(s">>>>>>>> LOAD ERROR - Status: $status\nBody:\n$bodyString")
+              session.markAsFailed
+            } else {
+              session
             }
-            Settings.addUuid(uuid, collectionName, entityName, modified, status)
-            session
           } else {
             session.markAsFailed
           }
-        }).exitHereIfFailed
+        })
     }
   )
 


Mime
View raw message