John Bachir

Measuring Sidekiq with Librato

Here's what I recently put together so I could measure some Sidekiq behavior with Librato. This code makes use of the librato-metrics gem.

Measure the time taken to perform each type of job

I put this in my lib directory:

class SidekiqMetrics
 def call(worker, msg, queue)
 librato_queue = Librato::Metrics:: . . .

Read More

July 04, 2015

How to make a git branch be based off of a different branch from what it was originally branched off from

An easy thing to do covered confusingly in 2-dozen other blog posts around the web. But not here my friend.

git checkout branch-you-are-working-on
git rebase --onto branch-you-want-it-based-on branch-it-is-based-on

Read More

March 27, 2015

Benchmarking Postgres vs. Redis Reads

I was curious what would be the difference in performance between Postgres and Redis for basic read operations. Redis is highly optimized for writing and reading specific types of data structures, where Postgres, with its ACID guarantees and general-purpose features, can't compete. But for the most basic read operations, where Postgres . . .

Read More

March 21, 2015

Setting Priorities For Sidekiq Workers

I love Sidekiq, and Medstro is a Sidekiq Pro customer. We started out with pretty basic usage, using no custom workers, only using the ActiveRecord extension which enables .delay that you might be familiar with in other queueing systems. We also use devise-async to automatically catch all our outgoing devise email.

We've . . .

Read More

March 07, 2015


MetaInspector is a handy gem which makes it easy to get information about a webpage such as…

So let's say that you have a field in your app's user profiles for "personal . . .

Read More

October 09, 2014

Monitoring connection quality of Amtrak wifi vs. phone tethering

Kudos to Amtrak for having free Wi-Fi. But the network quality is dependent on a mobile data connection, which varies throughout the trip. Meanwhile, I also have tethering on my phone.

One might guess that the connection quality would be pretty much identical between the two, since they both rely on similar or the same networks over . . .

Read More

July 18, 2014

DHH Sounds Out of Touch

I just read Uncle Bob's Test Induced Design Damage?.

I keep fearing the day when Rails messes up and becomes too complicated or poorly maintained or something else, but that hasn't happened. It’s really an impressive solid project that solves common problems and steadily integrates popular solutions to new problems with each . . .

Read More

May 01, 2014