class

Hwaro::Profiler

Inherits Reference / Object

Constructors

new(enabled : Bool = false)
Source

Instance methods

asset_report(io : IO = STDOUT)

Print timing for heavy BeforeRender asset generation (OG images + image resizing). These often dominate the Render phase on sites with auto OG or responsive images enabled.

Source
enabled?
Source
end_phase

End timing for the current phase

Source
hook_report(io : IO = STDOUT)

Print timing for all lifecycle hooks that ran during the build. This gives visibility into taxonomy, SEO, PWA, AMP, asset, and custom hooks.

Source
markdown_report(io : IO = STDOUT)

Print the per-page Markdown rendering report (sorted by total time, top consumers first)

Source
phase_ms(phase : String) : Float64 | Nil

Total recorded time for a named phase (summed across repeats), or nil when the phase never ran. Lets the build receipt show per-row timings.

Source
record_asset_generation(name : String, generated : Int32, skipped : Int32, time_ms : Float64)

Record timing for expensive asset generation hooks (OG images, image resizing). These are the #1 cost on many sites even with aggressive caching.

Source
record_hook(name : String, time_ms : Float64)

Record timing for any lifecycle hook (general per-hook profiling, #561). Called automatically from Lifecycle::Manager#trigger when profiler is enabled.

Source
record_markdown(path : String, bytes : Int64, time_ms : Float64)

Record per-page Markdown rendering profiling data. This captures the dominant cost inside the Render phase (Markd + extensions + TOC + shortcode prep).

Source
record_template(template : String, bytes : Int64, time_ms : Float64)

Record per-template profiling data

Source
report(io : IO = STDOUT)

Print the profiling report

Source
start

Start the overall profiling

Source
start_phase(phase : String)

Start timing a phase. Phase-level timing is collected even when full profiling is disabled — it costs two clock reads per phase and feeds the per-row timings in the build receipt. The detailed per-template / per-page collectors and all reports stay gated on --profile.

Source
template_report(io : IO = STDOUT)

Print the per-template profiling report

Source
total_elapsed

Get total elapsed time

Source

Nested types