This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/application_controller.rb | |
# Base controller for a Rails app integrated with Heroku Autoscaler. | |
# Tracks web response times and stores them in Redis for autoscaling decisions. | |
# Usage: Works with Heroku::Autoscaler to scale the 'web' dyno based on average response time. | |
# Requirements: 'redis' gem, REDIS_URL env variable set (e.g., via Heroku Redis add-on). | |
require 'json' | |
class ApplicationController < ActionController::Base | |
# Hook to measure response time for every action in the app |