[−][src]Crate ccache_stats_reader
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.
Example Usage
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))
Structs
CacheDir | A container for collecting statistics from a ccache directory. |
CacheFieldData | A hash-like interface for accessing values using Enums as keys. |
CacheFieldMeta | A container for metadata about various fields. |
CacheLeaf | A leaf container for one sub-cache of a ccache directory. |
Enums
CacheField | An enum based field definition for ccache's data fields. |
CacheFieldFormat | A descriptor enum for which formatting to use for a given field. |
ErrorKind | An enum for wrapping various errors emitted by this crate. |
Traits
CacheFieldCollection | An abstact representation of 'a thing' that can expose data about its unit. |