Skip to content

Commit

Permalink
session immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
XorSum committed Mar 5, 2024
1 parent 8e957c7 commit aad2bbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ abstract class SparkOperation(session: Session)
info(s"statementId=${statementId}, " +
s"operationRunTime=${formatDuration(l.getOperationRunTime)}, " +
s"operationCpuTime=${formatDuration(l.getOperationCpuTime / 1000000)}")
session.asInstanceOf[SparkSessionImpl].increaseRunTime(l.getOperationRunTime)
session.asInstanceOf[SparkSessionImpl].increaseCpuTime(l.getOperationCpuTime)
session.asInstanceOf[SparkSessionImpl].increaseRunAndCpuTime(
l.getOperationRunTime,
l.getOperationCpuTime)
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,8 @@ class SparkSessionImpl(
handle)
}

def increaseRunTime(time: Long): Unit = {
sessionRunTime.getAndAdd(time)
}

def increaseCpuTime(time: Long): Unit = {
sessionCpuTime.getAndAdd(time)
def increaseRunAndCpuTime(runTime: Long, cpuTime: Long): Unit = {
sessionEvent.sessionRunTime = sessionRunTime.addAndGet(runTime)
sessionEvent.sessionCpuTime = sessionCpuTime.addAndGet(cpuTime)
}
}

0 comments on commit aad2bbb

Please sign in to comment.