Skip to content

Commit

Permalink
Added more logging for #48, "HAR seems to contain HTTP status codes w…
Browse files Browse the repository at this point in the history
…hich cannot be converted to Int".
  • Loading branch information
manuelkiessling committed Mar 1, 2017
1 parent 9d309f1 commit ae18abe
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ object HarAnalyzer {
entryStatus >= status && entryStatus < status + 100
} catch {
case e: Exception => {
val log = LogManager.getRootLogger
log.warn(s"Problem: '${e.getMessage}' while trying to get the status code at 'response -> status' within ${entry.toString()}")
val logger = LogManager.getLogger(this.getClass)
logger.warn(s"Problem: '${e.getMessage}' while trying to get the status code at 'response -> status' within ${entry.toString()}")
false
}
}
Expand All @@ -83,10 +83,12 @@ object HarAnalyzer {
sdf.format(calendar.getTime)
}
testresultsRDD.map(testresult => {
val logger = LogManager.getLogger(this.getClass)
logger.info(s"Starting to extract statistics from testresult ${testresult.testresultId}...")
val entries = (testresult.har \ "log" \ "entries").children
val cal = java.util.Calendar.getInstance()
cal.setTime(testresult.datetimeRun)
Statistics(
val statistics = Statistics(
testcaseId = testresult.testcaseId,
dayBucket = yMd(cal),
testresultDatetimeRun = testresult.datetimeRun,
Expand All @@ -96,6 +98,8 @@ object HarAnalyzer {
numberOfRequestsWithStatus400 = calculateNumberOfRequestsWithResponseStatus(400, entries),
numberOfRequestsWithStatus500 = calculateNumberOfRequestsWithResponseStatus(500, entries)
)
logger.info(s"Finished extracting statistics from testresult ${testresult.testresultId}...")
statistics
})
}
}
Expand Down

0 comments on commit ae18abe

Please sign in to comment.