Skip to content

Instantly share code, notes, and snippets.

@PavelPenkov
Created October 18, 2013 08:12
Show Gist options
  • Save PavelPenkov/7038171 to your computer and use it in GitHub Desktop.
Save PavelPenkov/7038171 to your computer and use it in GitHub Desktop.
resp = B.with_benchmark("GET payment info") do
Faraday.post BankerConfig.payments.url, {'CHANNEL' => BankerConfig.payments.channel, 'TGT' => BankerConfig.payments .target, 'o' => id}
end
module B
def self.with_benchmark(metric, &block)
out = nil
ts = Benchmark.realtime do
out = yield
end
Rails.logger.debug "#{metric}: #{ts} seconds"
out
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment