You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 --warm or --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.
The text was updated successfully, but these errors were encountered:
dimo414
changed the title
Optional cache statistics
Record cache statistics
Nov 3, 2022
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:
--warm
or--stale
)It would be nice to find some prior art of other CLI tools that log local statistics like this.
The text was updated successfully, but these errors were encountered: