|
|
|
@ -10,7 +10,7 @@ namespace :subjects do
|
|
|
|
|
column_value = "subject_id, study_count, course_study_count, initiative_study, passed_count, course_used_count, " +
|
|
|
|
|
"school_used_count, created_at, updated_at"
|
|
|
|
|
subjects.find_in_batches(batch_size: 50) do |s|
|
|
|
|
|
Parallel.each_with_index(s, in_processes: 4) do |subject, index|
|
|
|
|
|
Parallel.each_with_index(s, in_threads: 4) do |subject, index|
|
|
|
|
|
puts("---------------------data_statistic: #{subject.id}")
|
|
|
|
|
Rails.logger.info("---------------------data_statistic: #{subject.id}")
|
|
|
|
|
data = Subjects::DataStatisticService.new(subject)
|
|
|
|
@ -51,7 +51,7 @@ namespace :subjects do
|
|
|
|
|
"choice_shixun_frequency, created_at, updated_at"
|
|
|
|
|
|
|
|
|
|
subjects.find_in_batches(batch_size: 50) do |s|
|
|
|
|
|
Parallel.each(s, in_processes: 4) do |subject|
|
|
|
|
|
Parallel.each(s, in_threads: 4) do |subject|
|
|
|
|
|
puts("---------------------course_info_statistic: #{subject.id}")
|
|
|
|
|
Rails.logger.info("---------------------course_info_statistic: #{subject.id}")
|
|
|
|
|
data = Subjects::CourseUsedInfoService.call(subject)
|
|
|
|
@ -90,7 +90,7 @@ namespace :subjects do
|
|
|
|
|
column_value = "subject_id, shixun_id, stage, shixun_name, challenge_count, course_count, " +
|
|
|
|
|
"school_count, used_count, passed_count, evaluate_count, passed_ave_time, created_at, updated_at"
|
|
|
|
|
subjects.find_in_batches(batch_size: 50) do |s|
|
|
|
|
|
Parallel.each_with_index(s, in_processes: 4) do |subject|
|
|
|
|
|
Parallel.each_with_index(s, in_threads: 4) do |subject|
|
|
|
|
|
puts("---------------------shixun_info_statistic: #{subject.id}")
|
|
|
|
|
Rails.logger.info("---------------------shixun_info_statistic: #{subject.id}")
|
|
|
|
|
data = Subjects::ShixunUsedInfoService.call(subject)
|
|
|
|
@ -131,7 +131,7 @@ namespace :subjects do
|
|
|
|
|
"code_line_count, evaluate_count, cost_time, created_at, updated_at"
|
|
|
|
|
|
|
|
|
|
subjects.find_in_batches(batch_size: 50) do |s|
|
|
|
|
|
Parallel.each_with_index(s, in_processes: 4) do |subject, index|
|
|
|
|
|
Parallel.each_with_index(s, in_threads: 4) do |subject, index|
|
|
|
|
|
puts("---------------------user_info_statistic: #{subject.id}")
|
|
|
|
|
data = Subjects::UserUsedInfoService.call(subject)
|
|
|
|
|
data.each do |key|
|
|
|
|
|