class Bindgen::Statistics

Overview

Simple collector of run-time statistics.

Defined in:

bindgen/statistics.cr

Constant Summary

DEPTH_MULTIPLIER = 2
HEAP_COLUMN_SIZE = 8
JUSTIFY_OFFSET = 2

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def after : GC::Stats | Nil #

Garbage collector statistics after the measures. Only available after calling #finish!


[View source]
def after? : GC::Stats | Nil | Nil #

Garbage collector statistics after the measures. Only available after calling #finish!


[View source]
def before : GC::Stats #

Garbage collector statistics before any measures.


[View source]
def finish! : self #

Finishes the statistics collection.


[View source]
def heap_size_change : Int64 #

Returns how much the heap size has changed during the measurements


[View source]
def measure(stage_name : String, &) #

Measures execution of the given block. Returns the result of the block. The measured data is put into #stages.


[View source]
def stages : Hash(String, Bindgen::Statistics::Timing) #

Collected stages


[View source]
def to_s(depth : Int32) : String #

Returns a formatted human-readable string.


[View source]
def to_s(io, depth = 0, justification = nil) #

Writes formatted human-readable data into io.


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

Returns the total duration of all measured steps. The timings between the stages is not recorded, and is thus excluded from the total duration.


[View source]