When we want to gather per-system metrics for tokio-epoll-uring, a good design would be let each system tracks it's own metrics separately, and only go through each thread local system to aggregate the result when we wish to collect the metrics.
Since the Rust standard library does not provide a good functionality for iterating through thread local variables, the implementation would need to refactor the tokio-epoll-uring thread local system to use https://docs.rs/thread_local/latest/thread_local/ and use the its iterator to collect thread local metrics.
When we want to gather per-system metrics for
tokio-epoll-uring
, a good design would be let each system tracks it's own metrics separately, and only go through each thread local system to aggregate the result when we wish to collect the metrics.Compared to the implementation in https://github.com/neondatabase/tokio-epoll-uring/pull/56, this removes the need for locking.
Since the Rust standard library does not provide a good functionality for iterating through thread local variables, the implementation would need to refactor the tokio-epoll-uring thread local system to use https://docs.rs/thread_local/latest/thread_local/ and use the its iterator to collect thread local metrics.