class

Hwaro::Core::Build::CacheManager

Inherits Reference < Object

Constructors

Instance methods

all_stats

Return a snapshot of all layer stats as an array of named tuples.

Source
clear(*names : String, reset_stats : Bool = true)

Clear specific named caches. Pass reset_stats: false to preserve hit/miss counters across clears (useful for streaming batch clears where stats should span the whole build).

Source
clear_runtime(reset_stats : Bool = true)

Clear only runtime (in-memory) caches, preserving persistent caches. Pass reset_stats: false to preserve hit/miss counters.

Source
record_hit(name : String)

Record a cache hit for the named layer.

Deliberately lock-free: the counters are Atomics precisely so hot render paths don't serialize on @mutex (record_hit/record_miss run several times per page from parallel fibers). The bare @layers read is safe because layers are registered once during Builder construction, before any parallel phase mutates or reads stats.

Source
record_miss(name : String)

Record a cache miss for the named layer. Lock-free — see record_hit.

Source
register(name : String, description : String, runtime : Bool = true, &clear : -> Nil)

Register a cache layer with the manager. runtime: true for per-build in-memory caches, false for persistent (file-based) caches.

Source
report

Log cache stats summary. Only logs layers that had activity.

Source
report_verbose

Verbose report with all layers (including inactive ones).

Source

Nested types