rack-mini-profiler

https://github.com/miniprofiler/rack-mini-profiler

Ruby

Profiler for your development and production Ruby rack apps.

Rack::MiniProfiler::MemoryStore::CacheCleanupThread#sleepy_run

We don't want to hit the filesystem every 10s to clean up the cache so we need to do a bit of
accounting to avoid sleeping that entire time.  We don't want to sleep for the entire period because
it means the thread will stay live in hot deployment scenarios, keeping a potentially large memory
graph from being garbage collected upon undeploy.

Source | Google | Stack overflow

Edit

git clone [email protected]:miniprofiler/rack-mini-profiler.git

cd rack-mini-profiler

open lib/mini_profiler/storage/memory_store.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Rack--MiniProfiler--MemoryStore--CacheCleanupThread-sleepy_run-for-pr


# Commit to git

git add lib/mini_profiler/storage/memory_store.rbgit commit -m "better docs for Rack::MiniProfiler::MemoryStore::CacheCleanupThread#sleepy_run"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Rack--MiniProfiler--MemoryStore--CacheCleanupThread-sleepy_run-for-pr

hub pull-request


# Celebrate!