class

Spectator::Profile

Inherits Indexable / Enumerable / Iterable / Reference / Object

Information about the runtime of examples.

Constructors

new(slowest : Array(Example), total_time : Time::Span)

Creates the profiling information. The slowest results must already be sorted, longest time first.

Source

Class methods

generate(examples, size = 10)

Produces the profile from a report.

Source

Instance methods

percentage

Percentage (from 0 to 100) of time the results in this profile took compared to all examples.

Source
size

Number of results in the profile.

Source
time

Length of time it took to run the results in the profile.

Source
to_json(json : JSON::Builder)

Produces a JSON fragment containing the profiling information.

Source
total_time

Total length of time it took to run all examples in the test suite.

Source
unsafe_fetch(index)

Retrieves a result at the specified index.

Source