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
class Object | |
def log_with_time txt=nil, thld=100, with_stat=nil, &block | |
with_stat ||= false | |
start = Time.now | |
result = yield | |
taken = ((Time.now - start) * 1000).round(1) | |
dbg = ["===="] | |
dbg << txt.to_s.ljust(50) if txt |
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
class QuickieParallel | |
attr_accessor :results | |
def initialize(args) | |
@num_procs = args.fetch(:num_processes, 4) | |
@using_db = args.fetch(:using_db, false) | |
@debug = args.fetch(:debug, false) | |
@results = {} | |
end | |
def finish_callback(val, index, result) |
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
diff --git a/app/services/car_importer.rb b/app/services/car_importer.rb | |
index d0a8d8f..f48319e 100644 | |
--- a/app/services/car_importer.rb | |
+++ b/app/services/car_importer.rb | |
@@ -1,5 +1,6 @@ | |
require 'open-uri' | |
require 'net/smtp' | |
+require 'benchmark' | |
module CarImporter |