Measurer

trait Measurer[V] extends Serializable
Companion
object
trait Serializable
class Object
trait Matchable
class Any

Value members

Abstract methods

def measure[T](context: Context, measurements: Int, setup: T => Any, tear: T => Any, regen: () => T, snippet: T => Any): Seq[Quantity[V]]
def name: String

Concrete methods

def afterExecution(context: Context): Unit

Does some final cleanup after execution of all benchmarks in a performance test.

Does some final cleanup after execution of all benchmarks in a performance test.

This method is invoked in the PerformanceTest executeTests method just after execution of all benchmarks.

Most measurers do not need to do any side effects in beforeExecution, so the default implementation just does nothing.

def beforeExecution(context: Context): Unit

Does some side effects before execution of all benchmarks in a performance test.

Does some side effects before execution of all benchmarks in a performance test.

This method is invoked in the PerformanceTest executeTests method just before execution of any benchmarks.

Most measurers do not need add additional context keys in prepareContext, so the default implementation just does nothing.

def map[U](f: Quantity[V] => Quantity[U]): Measurer[U]

Modifies the initial test context.

Modifies the initial test context.

This method is invoked before the PerformanceTest object's ctor is invoked. The key-value pairs that the org.scalameter.Measurer adds to the org.scalameter.Context in this method are visible to all the test snippets within the PerformanceTest class.

Most measurers do not need to add any specific keys, so the default implementation just returns the context.

Indicates if a measurer uses instrumented classpath - if true measurer must be run using an executor that spawns separate JVMs.

Indicates if a measurer uses instrumented classpath - if true measurer must be run using an executor that spawns separate JVMs.