| Crates.io | ccache_stats_reader |
| lib.rs | ccache_stats_reader |
| version | 0.1.2 |
| created_at | 2019-09-18 10:01:40.137631+00 |
| updated_at | 2020-01-23 18:44:54.087871+00 |
| description | A read-only API for CCACHE_DIR |
| homepage | |
| repository | https://github.com/kentnl-rust/ccache_stats_reader.git |
| max_upload_size | |
| id | 165666 |
| size | 38,381 |
This crate implements a simple interface for accessing ccache stats
without needing an exec call.
Experimental testing demonstrates I can produce the same data emitted by
ccache --print-stats while also using only ¼ the heap, and less
than ½ the stack, while the program itself can call do this multiple
times in-process without adding an exec() penalty to everything.
use ccache_stats_reader::{CacheDir,CacheField,CacheFieldCollection};
let stats = CacheDir::read_dir("/home/foo/.ccache/").unwrap();
println!("Direct Cache Hits: {:?}", stats.get_field(CacheField::CacheHitDir));
println!("Cache Last Zero'd: {}", CacheField::ZeroTimeStamp.format_value( stats.get_field(CacheField::ZeroTimeStamp)));