I want to try using some reporters in my benchmark for function Main.lengthOfUUID
.
object Main {
def lengthOfUUID(s : Int) = {
val x = List.fill(100000)(1)
val sum = x.sum
}
}
Firstly I tried ChartReporter
import org.scalameter.api._
import org.scalameter.picklers.Implicits._
object UUIDBench extends Bench[Double] {
lazy val executor = LocalExecutor(
new Executor.Warmer.Default,
Aggregator.min[Double],
measurer)
lazy val measurer = new Measurer.Default
lazy val reporter = ChartReporter(ChartFactory.XYLine())
lazy val persistor = Persistor.None
val sizes: Gen[Int] = Gen.range("size")(1, 8, 1)
val ranges: Gen[Range] = for {
size <- sizes
} yield 0 until size
performance of "Batches" config (
exec.benchRuns -> 4
) in {
measure method "main" in {
using(sizes) in { s =>
Main.lengthOfUUID(s)
}
}
}
}
But it throws a error
Error:(14, 36) ambiguous implicit values:
both object BigIntIsIntegral in object Numeric of type scala.math.Numeric.BigIntIsIntegral.type
and object IntIsIntegral in object Numeric of type scala.math.Numeric.IntIsIntegral.type
match expected type Numeric[T]
Error occurred in an application involving default arguments.
lazy val reporter = ChartReporter(ChartFactory.XYLine())
Error:(14, 36) could not find implicit value for evidence parameter of type Numeric[T]
Error occurred in an application involving default arguments.
lazy val reporter = ChartReporter(ChartFactory.XYLine())
Error:(14, 36) not enough arguments for method apply: (implicit evidence$1: Numeric[T])org.scalameter.reporting.ChartReporter[T] in object ChartReporter.
Unspecified value parameter evidence$1.
Error occurred in an application involving default arguments.
lazy val reporter = ChartReporter(ChartFactory.XYLine())
I saw this issue. Code there is not available now, but it is said to use HTMLReporter
, so I tried it
lazy val reporter = Reporter.Composite(
new RegressionReporter(
RegressionReporter.Tester.OverlapIntervals(),
RegressionReporter.Historian.ExponentialBackoff() ),
HtmlReporter(true)
)
But got similar errors
Error:(15, 5) ambiguous implicit values:
both object BigIntIsIntegral in object Numeric of type scala.math.Numeric.BigIntIsIntegral.type
and object IntIsIntegral in object Numeric of type scala.math.Numeric.IntIsIntegral.type
match expected type Numeric[T]
new RegressionReporter(
Error:(15, 5) could not find implicit value for evidence parameter of type Numeric[T]
new RegressionReporter(
Error:(15, 5) not enough arguments for constructor RegressionReporter: (implicit evidence$1: Numeric[T])org.scalameter.reporting.RegressionReporter[T].
Unspecified value parameter evidence$1.
new RegressionReporter(
Error:(18, 17) ambiguous implicit values:
both object BigIntIsIntegral in object Numeric of type scala.math.Numeric.BigIntIsIntegral.type
and object IntIsIntegral in object Numeric of type scala.math.Numeric.IntIsIntegral.type
match expected type Numeric[T]
HtmlReporter(true)
Error:(18, 17) could not find implicit value for evidence parameter of type Numeric[T]
HtmlReporter(true)
Error:(18, 17) not enough arguments for method apply: (implicit evidence$1: Numeric[T])org.scalameter.reporting.HtmlReporter[T] in object HtmlReporter.
Unspecified value parameter evidence$1.
HtmlReporter(true)
How should I use these reporters?