-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
It would be nice to log statistics about cached invocations, such as execution durations and hits vs. misses. This could be used to optimize TTLs and observe unexpected cache misses.
Any such logging should be opt-in at the call site - e.g. behind a --log_statistics flag - and ideally also gated by a Cargo feature (though the feature could be enabled by default as long as it doesn't incur too much overhead).
I'm envisioning writing to an append-only file in the cache directory and using a simple schema such as a TSV. Columns might include:
- Timestamp
- Scope
- Command name (i.e. argv-0)
- Full command line
- cwd
- Parent PID
- Hit / miss / force / refresh (i.e. executed asynchronously via
--warmor--stale) - Exit status
- Execution time (0 for hits)
- Remaining TTL (0 for misses)
- Remaining TTStale (0 for misses)
It would be nice to find some prior art of other CLI tools that log local statistics like this. statsd could be a reasonable choice but it requires more bootstrapping on the part of the user.
borestadborestad and shuraneborestad
Metadata
Metadata
Assignees
Labels
No labels