SPARK-2134: Report metrics before application finishes

Yeah, this is something the Scala developers recommend to differentiate methods that have no side-effects (e.g. property getters or things like toString): http://docs.scala-lang.org/style/method-invocation.html