Better output messages for streaming job duration

This commit is contained in:
Matei Zaharia 2012-08-31 15:33:48 -07:00
parent e1da274a48
commit f92d4a6ac1
2 changed files with 3 additions and 5 deletions

View file

@ -8,7 +8,7 @@ class Job(val time: Time, func: () => _) {
val startTime = System.currentTimeMillis
func()
val stopTime = System.currentTimeMillis
(startTime - stopTime)
(stopTime - startTime)
}
override def toString = "streaming job " + id + " @ " + time

View file

@ -12,10 +12,8 @@ class JobManager(ssc: StreamingContext, numThreads: Int = 1) extends Logging {
SparkEnv.set(ssc.env)
try {
val timeTaken = job.run()
logInfo(
"Running " + job + " took " + timeTaken + " ms, " +
"total delay was " + (System.currentTimeMillis - job.time) + " ms"
)
logInfo("Total delay: %.4f s for job %s; execution was %.4f s".format(
System.currentTimeMillis() - job.time, timeTaken))
} catch {
case e: Exception =>
logError("Running " + job + " failed", e)