Feature #2586: Better onedb upgrade time log

(cherry picked from commit 6b0971415b)
This commit is contained in:
Carlos Martín committed 2014-02-18 17:23:09 +01:00
1 parent 492310768a
commit d57b69d0ad
2 files changed
+4 -9

No files matched your search

+3 -8
View File
@@ -16,6 +16,7 @@
require 'onedb_backend'
# If set to true, extra verbose time log will be printed for each migrator
LOG_TIME = false
class OneDB
@@ -149,16 +150,12 @@ class OneDB
time1 = Time.now
if LOG_TIME
puts " > Time for #{file}: #{time1 - time0}s"
end
if !result
raise "Error while upgrading from #{version} to " <<
" #{@backend.db_version}"
end
puts " > Done" if ops[:verbose]
puts " > Done in #{"%0.02f" % (time1 - time0).to_s}s" if ops[:verbose]
puts "" if ops[:verbose]
matches = Dir.glob(
@@ -174,9 +171,7 @@ class OneDB
timeb = Time.now
if LOG_TIME
puts " > Total time: #{timeb - timea}s" if ops[:verbose]
end
puts "Total time: #{"%0.02f" % (timeb - timea).to_s}s" if ops[:verbose]
return 0
+1 -1
View File
@@ -134,7 +134,7 @@ class OneDBBacKEnd
def log_time()
if LOG_TIME
@time1 = Time.now
puts " > #{db_version} Time for block #{@block_n}: #{@time1 - @time0}s"
puts " > #{db_version} Time for block #{@block_n}: #{"%0.02f" % (@time1 - @time0).to_s}s"
@time0 = Time.now
@block_n += 1
end