Created
April 4, 2016 08:02
-
-
Save rwd/03a19ea8a09e4e3579d9c535b229ae00 to your computer and use it in GitHub Desktop.
Benchmark Fog connection requests
This file contains hidden or 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
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