Skip to contents

Computes summary statistics for a cache directory: number of entries, total size, age range, and per-function breakdown.

Usage

cache_stats(cache_dir)

Arguments

cache_dir

A character string specifying the path to the cache directory.

Value

A list with:

n_entries

Integer count of cache files (excluding graph.rds).

total_size_mb

Total size in megabytes (rounded to 2 decimal places).

oldest

POSIXct timestamp of the oldest cache file.

newest

POSIXct timestamp of the newest cache file.

by_function

A data.frame with columns fname, n_files, and total_size_mb summarizing entries per cached function.