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

Override Time in CacheLib for Accurate Benchmarking #377

Open
hazelnut-99 opened this issue Feb 27, 2025 · 0 comments
Open

Override Time in CacheLib for Accurate Benchmarking #377

hazelnut-99 opened this issue Feb 27, 2025 · 0 comments

Comments

@hazelnut-99
Copy link

Hi!

I'm benchmarking different slab rebalance strategies in CacheLib and noticed that several components are time-dependent:

  1. PoolRebalancer wakes up periodically (default: 1s).
  2. LRU tail age checker relies on time

I was trying to figure out ways to 1) implement a mock timer that ticks according to the trace time 2) override the concept of time in CacheLib with the mock timer.

After reading the code, it feels like all time-relate functionalities in cachelib use real wall clock time via std::chrono, and the current implementation doesn’t seem to support override timer easily.

Does anyone have suggestions on how to approach this? (I think it'd help with testing TTL-related logics as well.

Cheers!

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