You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/02/28 20:24:47 UTC

[GitHub] yifeih commented on a change in pull request #23914: [SPARK-27009][TEST] Add Standard Deviation to benchmark results

yifeih commented on a change in pull request #23914: [SPARK-27009][TEST] Add Standard Deviation to benchmark results
URL: https://github.com/apache/spark/pull/23914#discussion_r261368903
 
 

 ##########
 File path: core/src/test/scala/org/apache/spark/benchmark/Benchmark.scala
 ##########
 @@ -158,7 +159,8 @@ private[spark] class Benchmark(
     // scalastyle:on
     val best = runTimes.min
     val avg = runTimes.sum / runTimes.size
-    Result(avg / 1000000.0, num / (best / 1000.0), best / 1000000.0)
+    val stdev = math.sqrt(runTimes.map(time => math.pow(time - avg, 2)).sum / runTimes.size)
 
 Review comment:
   Ah ok, I agree with you on both. If there aren't enough runs, should we just put "N/A" then? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org