Puma::Clocker

A super-basic gem to calculate the speed of your Rails project's rails server command.

Installation

Add the following to your Rails project's Gemfile:

gem 'puma-clocker'

Bundle it!

Usage

Time-calculations are done based on the exact time you executed the command. For this, the system's date command is used. Its output is passed to rails s as an environment variable, like so:

STARTING_PUMA_ON=$(date) rails s

or as an abbreviated variable, like so:

SPO=$(date) rails s

The time-calculation result will appear in the last line shown right after Puma's own messages:

alt text

If you are loading other environment variables from a .env file, you might be tempted to do the same for SPO. However, keep in mind that the start-time considered then will not be the true starting time of the command.