Module: Kreuzberg::CacheAPI
- Defined in:
- lib/kreuzberg/cache_api.rb
Instance Method Summary collapse
-
#cache_stats ⇒ Hash{Symbol | String => Integer}
Retrieve cache statistics.
-
#clear_cache ⇒ void
No meaningful return value.
Instance Method Details
#cache_stats ⇒ Hash{Symbol | String => Integer}
Retrieve cache statistics.
Returns information about the current state of the extraction result cache, including the number of cached entries and total memory used. Statistics include both native Rust cache metrics and local tracker metrics.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/kreuzberg/cache_api.rb', line 32 def cache_stats stats = native_cache_stats total_entries = (stats['total_entries'] || stats[:total_entries] || 0) + @__cache_tracker[:entries] total_size = (stats['total_size_bytes'] || stats[:total_size_bytes] || 0) + @__cache_tracker[:bytes] stats['total_entries'] = total_entries stats[:total_entries] = total_entries stats['total_size_bytes'] = total_size stats[:total_size_bytes] = total_size stats end |
#clear_cache ⇒ void
This method returns an undefined value.
Returns No meaningful return value.
7 8 9 10 |
# File 'lib/kreuzberg/cache_api.rb', line 7 def clear_cache native_clear_cache reset_cache_tracker! end |