Skip to content
This repository
Browse code

parallel collections std dev shown properly now

  • Loading branch information...
commit 215b6a3cf41e4e372daf4b5dc0eaa025895bb363 1 parent f28860a
Mike Slinn authored
21 src/main/scala/com/micronautics/akka/benchmark/Benchmark.scala
@@ -107,10 +107,12 @@ class Benchmark (var load: () => Any, var showResult: Boolean) {
107 107 println("\nRunning " + Benchmark.numRuns + " timed loads on " + executorName)
108 108 val results = for (i <- 0 until Benchmark.numRuns;
109 109 val result = Model.addTest(executor, "Akka Futures w/ " + executorName, runAkkaFutureLoad, false)
110   - ) yield TestResult(runAkkaFutureLoad, "Akka Futures w/ " + executorName, result.millis, result)
111   - val millisMean = arithmeticMean(results.map(_.millis) : _*)
112   - val stdDev = popStdDev(results.map(_.millis) : _*)
113   - gui.addValue(TestResult2(runAkkaFutureLoad, "Akka Futures w/ " + executorName, millisMean.asInstanceOf[Long], stdDev.asInstanceOf[Long]), false)
  110 + ) yield TestResult(newTest1.test, "Akka Futures w/ " + executorName, result.millis, result)
  111 + val millisMean: Long = arithmeticMean(results.map(_.millis) : _*).asInstanceOf[Long]
  112 + val stdDev: Long = popStdDev(results.map(_.millis) : _*).asInstanceOf[Long]
  113 + // std deviation is +/- so subtract from mean and double it to show uncertainty range
  114 + // midpoint of uncertainty is therefore the mean
  115 + gui.addValue(TestResult2(runAkkaFutureLoad, "Akka Futures w/ " + executorName, stdDev*2L, millisMean-stdDev), false)
114 116 if (Benchmark.consoleOutput)
115 117 println("\n---------------------------------------------------\n")
116 118 }
@@ -143,9 +145,14 @@ class Benchmark (var load: () => Any, var showResult: Boolean) {
143 145 val test1StdDev = 0 // // we only warm up once
144 146 gui.addValue(TestResult2(newTest1.test, newTest1.testName, newTest1.millis, test1StdDev), true)
145 147 }
146   - val newTest2 = Model.addTest(nProcessors, msg, runParallelLoad, false)
147   - val newTest2StdDev = 50 // todo make this real
148   - gui.addValue(TestResult2(newTest2.test, newTest2.testName, newTest2.millis, newTest2StdDev), false)
  148 + val results = for (i <- 0 until Benchmark.numRuns;
  149 + val result = Model.addTest(nProcessors, msg, runParallelLoad, false)
  150 + ) yield TestResult(newTest1.test, msg, result.millis, result)
  151 + val millisMean: Long = arithmeticMean(results.map(_.millis) : _*).asInstanceOf[Long]
  152 + val stdDev: Long = popStdDev(results.map(_.millis) : _*).asInstanceOf[Long]
  153 + // std deviation is +/- so subtract from mean and double it to show uncertainty range
  154 + // midpoint of uncertainty is therefore the mean
  155 + gui.addValue(TestResult2(newTest1.test, msg, stdDev*2L, millisMean-stdDev), false)
149 156 if (Benchmark.consoleOutput)
150 157 println("\n---------------------------------------------------\n")
151 158 }

0 comments on commit 215b6a3

Please sign in to comment.
Something went wrong with that request. Please try again.