Skip to content

Instantly share code, notes, and snippets.

@rwd
Created April 4, 2016 08:02
Show Gist options
  • Save rwd/03a19ea8a09e4e3579d9c535b229ae00 to your computer and use it in GitHub Desktop.
Save rwd/03a19ea8a09e4e3579d9c535b229ae00 to your computer and use it in GitHub Desktop.
Benchmark Fog connection requests
require 'fog/core/connection'
# Place this in a Rails initializer
module Fog
module Core
class Connection
include ActiveSupport::Benchmarkable
alias_method :super_request, :request
def request(params, &block)
benchmark("[OpenStack]", level: :info) do
super_request(params, &block)
end
end
private
def logger
Rails.logger
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment