Skip to main content

string_cache_stats

Function string_cache_stats 

Source
pub fn string_cache_stats() -> CacheStats
Expand description

Get statistics about the current thread’s string cache

§Example

use hedl_json::string_cache::{intern_string, string_cache_stats};

// Perform some interning
for _ in 0..100 {
    intern_string("field_name");
}

let stats = string_cache_stats();
println!("Cache entries: {}", stats.entries);
println!("Hit rate: {:.1}%", stats.hit_rate() * 100.0);
println!("Total lookups: {}", stats.total_lookups());