Module Spoc_framework_registry.Framework_cache

val debug_enabled : bool

Enable debug logging via environment variable

val debugf : ('a, Stdlib.out_channel, unit, unit, unit, unit) Stdlib.format6 -> 'a
val warnf : ('a, Stdlib.out_channel, unit, unit, unit, unit) Stdlib.format6 -> 'a
type stats = {
  1. mutable hits : int;
    (*

    Successful cache lookups

    *)
  2. mutable misses : int;
    (*

    Failed cache lookups

    *)
  3. mutable puts : int;
    (*

    Cache writes

    *)
  4. mutable errors : int;
    (*

    I/O errors

    *)
}

Cache statistics

val stats : stats
val get_stats : unit -> stats

Get current cache statistics

val reset_stats : unit -> unit

Reset statistics

val hit_rate : unit -> float

Calculate hit rate (0.0 - 1.0)

val print_stats : unit -> unit

Print statistics to stdout

val cache_dir_name : string
val get_cache_dir : unit -> string

Get cache directory, creating it if needed

val compute_key : dev_name:string -> driver_version:string -> source:string -> string

Compute cache key from device, driver, and source

val get : key:string -> string option

Retrieve cached data by key

val put : key:string -> data:string -> unit

Store data in cache with given key