Fixed trace sampling bug. Test traces are numbered from 0 to 999, and sampling currently pulls values from 1 to 1000, causing it to crash. Simple bug to fix, I added unit tests to check the bounds - but they might just be extra clutter
Added config.cache_unseen_recency as a configurable parameter. Constant was previously hardcoded to be 500. Added unit tests to ensure that this works properly
Removed the trace_done function - this is not being used
Removed the last_req_time_dict - this is also not being used at all and I thought it was confusing when trying to understand the code - let me know if you think it should stay. The computation for recency is done underneath get_state()