Better output messages for streaming job duration
This commit is contained in:
parent
e1da274a48
commit
f92d4a6ac1
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue