Lockistics : Statistics collecting shared mutex on Redis
I just released the first version of Lockistics gem.
Basically it’s a statistics collecting shared mutex on Redis. Sounds complicated? It isn’t.
You can use the locking to ensure for example that two instances of a rake task won’t be running at the same time on multiple hosts. There’s a configurable maximum wait time how long the next invocation will wait for the lock to be released before giving up. After your code has executed some statistics of it’s execution will be collected, such as duration and memory growth.
You can then monitor these statistics to find out for example that a rake task hasn’t been run every day or that it took so long that the next cronjob tried to start another one while one was still running or to simply find long running or memory hogging parts in your code.
The metrics part can also be used separately without using locks and you can even add new metrics with single call during the execution of your code to monitor for example how many items were processed during the task.
Post a comment