mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
working on loading data
This commit is contained in:
parent
a8594e848d
commit
b58bca6012
2 changed files with 8 additions and 7 deletions
|
|
@ -145,7 +145,7 @@ namespace :data do
|
|||
bad_answers = {}
|
||||
year = '2017'
|
||||
|
||||
timeToRun = 10000 * 60 * 60
|
||||
timeToRun = 6 * 60 * 60
|
||||
startIndex = 0
|
||||
startTime = Time.new
|
||||
|
||||
|
|
@ -158,12 +158,12 @@ namespace :data do
|
|||
|
||||
t = Time.new
|
||||
csv.each_with_index do |row, index|
|
||||
# next if index < startIndex
|
||||
#
|
||||
# if Time.new - startTime >= timeToRun
|
||||
# puts("ENDING #{timeToRun} SECONDS: #{Time.new - startTime} = #{startIndex} -> #{index} = #{index - startIndex} or #{(Time.new - t) / (index - startIndex)} per second")
|
||||
# break
|
||||
# end
|
||||
next if index < startIndex
|
||||
|
||||
if Time.new - startTime >= timeToRun
|
||||
puts("ENDING #{timeToRun} SECONDS: #{Time.new - startTime} = #{startIndex} -> #{index} = #{index - startIndex} or #{(Time.new - t) / (index - startIndex)} per second")
|
||||
break
|
||||
end
|
||||
|
||||
if index % 10 == 0
|
||||
puts("DATAMSG: PROCESSING ROW: #{index} OUT OF #{csv.length} ROWS: #{Time.new - t} - Total: #{Time.new - startTime} - #{timeToRun - (Time.new - startTime)} TO GO")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue