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

cache_reporter design issue #59

Open
hannesm opened this issue Nov 30, 2023 · 0 comments
Open

cache_reporter design issue #59

hannesm opened this issue Nov 30, 2023 · 0 comments

Comments

@hannesm
Copy link
Member

hannesm commented Nov 30, 2023

The Metrics.cache_reporter stores a map from metric sources to measurement. Now, the issue is that if you have a source that uses tags, and multiple measurements with different tags are used, only the latest one is stored. NB: each source has a uid, and comparison of a source created one way with the same parameters as another source are not identical.

A workaround is done e.g. in the mirage-net-solo5 package -- https://github.com/mirage/mirage-net-solo5/blob/v0.8.0/src/netif.ml#L82 -- where each new mirage-net-solo5 instance (value returned by Netif.connect) creates a fresh source.

It would be great to instead adapt the cache_reporter to properly cope with this. Eventually instead of a "Map.Make(Src)", there should be something that takes all tags into account (but here I'm lost how to write this down - esp. since 'a Tags.t is pretty tough (and there's no equality/comparison defined for Tags.t)...

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