class Spectator::Profile

Overview

Information about the runtime of examples.

Included Modules

Defined in:

spectator/profile.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

should(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should(matcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should
, should_eventually(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_eventually, should_never(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_never, should_not(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should_not(matcher : Spectator::Matchers::NilMatcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not(matcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not

Constructor Detail

def self.new(slowest : Array(Example), total_time : Time::Span) #

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


[View source]

Class Method Detail

def self.generate(examples, size = 10) #

Produces the profile from a report.


[View source]

Instance Method Detail

def percentage #

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


[View source]
def size #

Number of results in the profile.


[View source]
def time #

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


[View source]
def to_json(json : JSON::Builder) #

Produces a JSON fragment containing the profiling information.


[View source]
def total_time : Time::Span #

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


[View source]
def unsafe_fetch(index) #

Retrieves a result at the specified index.


[View source]