测试集内存使用情况

dev_forum
jingquan huang 6 years ago
parent d48c86cbf4
commit ae4e65296c

@ -104,15 +104,6 @@ class MyshixunsController < ApplicationController
logger.info("training_task_status start#1**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
resubmit = jsonTestDetails['resubmit']
outPut = tran_base64_decode64(jsonTestDetails['outPut'])
# 资源消耗
if jsonTestDetails['resUsage'].present?
max_mem = tran_base64_decode64(jsonTestDetails['resUsage']).to_f
uid_logger("6661111111111111122222#{max_mem}")
max_mem = format("%.3f", max_mem/1024/1024).to_f
uid_logger("444411111122222#{max_mem}")
end
uid_logger("1111111111111122222#{max_mem}")
jenkins_testsets = jsonTestDetails['msg']
compile_success = jsonTestDetails['compileSuccess']
@ -139,10 +130,11 @@ class MyshixunsController < ApplicationController
# is_public = test_sets.where(:position => j_test_set['caseId']).first.try(:is_public)
logger.info "actual_output:################################################# #{actual_output}"
ts_time = format("%.2f", j_test_set['testSetTime'].to_f/1000000000).to_f
ts_mem = format("%.2f", j_test_set['testSetMem'].to_f/1024/1024).to_f
Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'],
:actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => max_query_index,
:compile_success => compile_success.to_i, :sec_key => sec_key, :ts_time => ts_time)
:compile_success => compile_success.to_i, :sec_key => sec_key, :ts_time => ts_time, :ts_mem => ts_mem)
# 如果设置了按测试集给分,则需要统计测试集的分值
if challenge.test_set_score && j_test_set['passed'].to_i == 1
test_set_score += challenge.test_sets.where(:position => j_test_set['caseId']).pluck(:score).first
@ -212,7 +204,7 @@ class MyshixunsController < ApplicationController
consume_time = format("%.3f", (Time.now - record.created_at)).to_f
record.update_attributes!(:consume_time => consume_time, :git_pull => timeCost['pull'] , :create_pod => timeCost['createPod'],
:pod_execute => timeCost['execute'], :test_cases => test_cases_time, :max_mem => max_mem,
:pod_execute => timeCost['execute'], :test_cases => test_cases_time,
:brige => timeCost['evaluateAllTime'], :return_back => return_back_time)
end
uid_logger("training_task_status start#4**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")

@ -0,0 +1,5 @@
class AddTsMemToOutputs < ActiveRecord::Migration[5.2]
def change
add_column :outputs, :ts_mem, :float
end
end
Loading…
Cancel
Save