Created
          October 18, 2013 08:12 
        
      - 
      
 - 
        
Save PavelPenkov/7038171 to your computer and use it in GitHub Desktop.  
  
    
      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
    
  
  
    
  | 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