beliefer commented on a change in pull request #28081: [SPARK-31315][SQL][TEST]
SQLQueryTestSuite: Display the total compile time for generated java code
URL: https://github.com/apache/spark/pull/28081#discussion_r401432918
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
##########
@@ -1466,10 +1473,12 @@ object CodeGenerator extends Logging {
val startTime = System.nanoTime()
val result = doCompile(code)
val endTime = System.nanoTime()
- def timeMs: Double = (endTime - startTime).toDouble /
NANOS_PER_MILLIS
+ val duration = endTime - startTime
+ val timeMs: Double = duration.toDouble / NANOS_PER_MILLIS
CodegenMetrics.METRIC_SOURCE_CODE_SIZE.update(code.body.length)
CodegenMetrics.METRIC_COMPILATION_TIME.update(timeMs.toLong)
Review comment:
`CodegenMetrics.METRIC_COMPILATION_TIME` is a `Histogram` is a metric which
calculates the distribution of a value. We can't reuse it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]