Statistic

class Statistic(report: StatisticReport, nameSupplier: () -> String)

An immutable collection of related statistics.

Parameters

nameSupplier

A lambda that supplies the name for this statistic.

report

The report under which this statistic is classified.

Constructors

Link copied to clipboard
fun Statistic(report: StatisticReport, name: String)

Construct a new Statistic with the given fixed name.

Link copied to clipboard
fun Statistic(report: StatisticReport, nameSupplier: () -> String)

Construct a new Statistic with the given name.

Functions

Link copied to clipboard
fun aggregate(): PerInterpreterStatistic

Aggregate the information from my array of PerInterpreterStatistics, and return it as a new PerInterpreterStatistic.

Link copied to clipboard
fun clear()

Clear each of my PerInterpreterStatistics.

Link copied to clipboard
fun name(): String

Answer the name of this Statistic. Note that the nameSupplier may produce different Strings at different times.

Link copied to clipboard
fun record(sample: Double, index: Int = Interpreter.currentIndexOrZero())
fun record(sample: Long, index: Int = Interpreter.currentIndexOrZero())

Record a sample in my PerInterpreterStatistic having the specified contention-avoidance index.

inline fun <A> record(index: Int = Interpreter.currentIndexOrZero(), body: () -> A): A

Perform the body, recording the time it took in the receiver. Answer the value produced by the body.

Properties

Link copied to clipboard
val statistics: Array<PerInterpreterStatistic>