Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mechanism to report cache age to callers #47

Open
dimo414 opened this issue Oct 17, 2023 · 0 comments
Open

Mechanism to report cache age to callers #47

dimo414 opened this issue Oct 17, 2023 · 0 comments

Comments

@dimo414
Copy link
Owner

dimo414 commented Oct 17, 2023

In #46 @huyz asked about including some messaging like Command cached 2h 3m ago in bkt's output. My initial reaction was to say bkt should be transparent and shouldn't modify a command's output in any way, but the cache age is a piece of information only bkt knows, so it does seem like a potentially useful piece of data to expose in some way.

I think there's a lot of intricacies with including this information in bkt's output (e.g. in the thread there's discussion of how to format the time delta, and you'd presumably need some sort of format string support to enable different associated text like "Offline for", not to mention localization). So I'm hesitant to go that way, but maybe there's something reasonable we could do with that.

Another option would be a separate flag / command like --stats that prints some structured information about the cached data such as when it was last cached, so that a caller could query that information to compute a time delta and print the messaging they want. This could also be used to help inform when to --warm a cache, for example.

Just spitballing right now so please drop some comments if you would be interested in functionality along these lines (or start a separate discussion if that would be easier).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant