class Spectator::Profile

Overview

Information about the runtimes of examples.

Included Modules

Defined in:

spectator/profile.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

should(matcher, message = nil) should, should_eventually(matcher, message = nil) should_eventually, should_never(matcher, message = nil) should_never, should_not(matcher, message = nil) should_not

Constructor Detail

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

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]