Expand description
Simple benchmarking functionality for supporting thyme.
Benchmarks consist of a moving average and associated statistics of a given
set of timings. Timings that are grouped together share the same tag.
You can pass a block to be timed using run
, or create a handle with
start
and end the timing with end
.
Use stats
to get a Stats
, which is the
primary interface for reporting on the timings.
Structs§
- Handle
- A benchmarking handle created by
start
.end
this to finish the given benchmark timing - Stats
- Statistics associated with a given set of benchmark timings.
These are obtained with the
stats
method for a given tag. Statistics are for a moving average of the last N timings for the tag, where N is currently hardcoded to 30.
Functions§
- report
- A convenience method to automatically generate a report
String for the given
tag
. The report will include all of the data in theStats
associated with thistag
, and be formatted with appropriate units. Limits to a number of recent samples if there are a large number of total samples. - report_
all - Like
report
, but there is no limit on the number of samples to be considered. - run
- Runs the specified closure
block
as a benchmark timing with the giventag
. - short_
report - Like
report
, but produces a condensed version of the data. - start
- Starts a benchmark timing with the given
tag
. You mustend
the returnedHandle
to complete the timing. - stats
- Returns a
Stats
object for the benchmark timings associated with the giventag
. Limits to a number of recent samples if there are a large number of total samples. - stats_
all - Like
stats
, but there is no limit on the number of samples to be considered.