I’m frequently find myself in need to measure request time of remote request from my application to an API or service. Previously, i used simple block of ruby code with
end_time. Finally i decided to find out more robust method of doing so. I’m using
faraday gem for remote requests, because it’s easy extendable by middlewares and great overall. You can take a look at the project with collection of middlewares for faraday on github. This project contains
Instrumentation middleware that we will use for tracking time of our request.
Before we start, here is an image of Dr. Faraday from LOST:
By the way github handle of faraday author is @lostisland. Coincidence? I don’t think so :)Read on →