diff --git a/README.md b/README.md index 2fa85d6..cd12b0b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Overview -Version: 1.0.4 +Version: 1.0.5 API Scaladoc: [SparkHelper](http://xavierguihot.github.io/spark_helper/#com.spark_helper.SparkHelper$) @@ -112,7 +112,7 @@ for a cool exemple. With sbt, just add this one line to your build.sbt: - libraryDependencies += "spark_helper" % "spark_helper" % "1.0.4" from "https://github.com/xavierguihot/spark_helper/releases/download/v1.0.4/spark_helper-1.0.4.jar" + libraryDependencies += "spark_helper" % "spark_helper" % "1.0.5" from "https://github.com/xavierguihot/spark_helper/releases/download/v1.0.5/spark_helper-1.0.5.jar" ## Building the project: diff --git a/build.sbt b/build.sbt index ad2786c..a47398c 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ name := "spark_helper" -version := "1.0.4" +version := "1.0.5" scalaVersion := "2.10.4" diff --git a/src/main/scala/com/spark_helper/monitoring/Monitor.scala b/src/main/scala/com/spark_helper/monitoring/Monitor.scala index 8da0839..36c6c8d 100644 --- a/src/main/scala/com/spark_helper/monitoring/Monitor.scala +++ b/src/main/scala/com/spark_helper/monitoring/Monitor.scala @@ -188,7 +188,12 @@ class Monitor( lastReportUpdate = now - report += "[" + before + "-" + now + "]" + " " + text + "\n" + val update = "[" + before + "-" + now + "]" + " " + text + + // We also print the update to also have them within yarn logs: + println("MONITOR: " + update) + + report += update + "\n" } /** Updates the report with some text and a success. @@ -269,17 +274,21 @@ class Monitor( // possible diagnostic, we set the monitoring as failed: success = false + var update = "" + if (taskDescription != "") - updateReport(taskDescription + ": failed") + update += taskDescription + ": failed\n" if (diagnostic != "") - report += "\tDiagnostic: " + diagnostic + "\n" + update += "\tDiagnostic: " + diagnostic + "\n" - report += ( + update += ( "\t\t" + error.toString() + "\n" + error.getStackTrace.map(line => "\t\t" + line).mkString("\n") + "\n" ) + updateReport(update) + false } @@ -332,14 +341,18 @@ class Monitor( if (!testsAreValid) success = false + var update = "" + // A title in the report for the kpi validation: if (testSuitName != "") { val validation = if (testsAreValid) "success" else "failed" - updateReport(testSuitName + ": " + validation) + update += testSuitName + ": " + validation + "\n" } // The kpi report is added to the report: - report += tests.map(_.stringify).mkString("\n") + "\n" + update += tests.map(_.stringify).mkString("\n") + + updateReport(update) testsAreValid }