Project

General

Profile

« Previous | Next » 

Revision c30fd6f2

Added by Lukas Zapletal almost 6 years ago

Fixes #23808 - monotonic timer to measure durations

View differences:

lib/tasks/convert.rake
ActiveRecord::Base.establish_connection(:production)
skip_tables = ["schema_info", "schema_migrations"]
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
time = Time.now
time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
ProductionModelClass.establish_connection(:production)
ProductionModelClass.table_name = table_name
......
end
DevelopmentModelClass.connection.execute(sql) if sql.present?
print "#{count} records converted in #{Time.now - time} seconds\n"
print "#{count} records converted in #{Process.clock_gettime(Process::CLOCK_MONOTONIC) - time} seconds\n"
end
end
end

Also available in: Unified diff