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 non-200s during load (including body)
Date Tue, 27 Oct 2015 21:59:41 GMT
Repository: usergrid
Updated Branches:
  refs/heads/USERGRID-1044 83d7a6f83 -> 038974475


USERGRID-1044: print non-200s during load (including body)


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

Branch: refs/heads/USERGRID-1044
Commit: 0389744752f479d215f84ebbd5f25aa36d2108a4
Parents: 83d7a6f
Author: Mike Dunker <mdunker@apigee.com>
Authored: Tue Oct 27 14:59:10 2015 -0700
Committer: Mike Dunker <mdunker@apigee.com>
Committed: Tue Oct 27 14:59:10 2015 -0700

----------------------------------------------------------------------
 .../usergrid/scenarios/EntityCollectionScenarios.scala       | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/03897447/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 f37a2d2..d5b3101 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
@@ -42,6 +42,7 @@ object EntityCollectionScenarios {
   val SessionVarStatus: String = "status"
   val SessionVarUuid: String = "createUuid"
   val SessionVarModified: String = "createModified"
+  val SessionVarBodyString: String = "bodyString"
 
   def entityGetUrl(useCursor: Boolean): String = {
     val url = s"/${Settings.collection}?" +
@@ -225,11 +226,12 @@ object EntityCollectionScenarios {
             new ResponseWrapper(response) {
               val contentType = response.header("content-type").getOrElse("").toLowerCase
               val bodyStr = if (contentType.contains("json")) response.body.string else "[]"
+              if (bodyStr == "[]") { println(">>>>>>>>>>>
USING EMPTY BODY") }
               override val body = StringResponseBody(bodyStr, response.charset)
             }
         }
         // 200 for success, 400 if already exists
-        .check(status.saveAs(SessionVarStatus), extractEntityUuid(SessionVarUuid), extractEntityModified(SessionVarModified)))
+        .check(status.saveAs(SessionVarStatus), bodyString.saveAs(SessionVarBodyString),
extractEntityUuid(SessionVarUuid), extractEntityModified(SessionVarModified)))
         .exec(session => {
           val saveFailures = Settings.saveInvalidResponse
           val status = session(SessionVarStatus).as[Int]
@@ -239,6 +241,10 @@ 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]
+            if (status != 200) {
+              val bodyString = session(SessionVarBodyString).as[String]
+              println(s">>>>>>>> LOAD ERROR - Status: $status\nBody:\n$bodyString")
+            }
             Settings.addUuid(uuid, collectionName, entityName, modified, status)
             session
           } else {


Mime
View raw message