仓库问题定位

dev_forum
jingquan huang 5 years ago
parent 73e2840018
commit 6b01530ad2

@ -503,6 +503,7 @@ class GamesController < ApplicationController
# 监测版本库HEAD是否存在不存在则取最新的HEAD # 监测版本库HEAD是否存在不存在则取最新的HEAD
uri = "#{shixun_tomcat}/bridge/game/check" uri = "#{shixun_tomcat}/bridge/game/check"
res = uri_post uri, rep_params res = uri_post uri, rep_params
uid_logger("repo_content to bridge: res is #{res}")
# res值0 表示正常;-1表示有错误-2表示代码版本库没了 # res值0 表示正常;-1表示有错误-2表示代码版本库没了
if status == 0 && res && (res['code'] == -2 || res['code'] == -1) if status == 0 && res && (res['code'] == -2 || res['code'] == -1)
# 删除不需要的仓库 # 删除不需要的仓库
@ -512,7 +513,7 @@ class GamesController < ApplicationController
uid_logger_error("#{e.message}") uid_logger_error("#{e.message}")
end end
# fork一个新的仓库 # fork一个新的仓库
project_fork(@myshixun, @shixun.repo_path, current_user.login) # project_fork(@myshixun, @shixun.repo_path, current_user.login)
end end
rescue Exception => e rescue Exception => e
uid_logger_error(e.message) uid_logger_error(e.message)

@ -96,6 +96,10 @@ class MyshixunsController < ApplicationController
status = jsonTestDetails['status'] status = jsonTestDetails['status']
game_id = jsonTestDetails['buildID'] game_id = jsonTestDetails['buildID']
sec_key = jsonTestDetails['sec_key'] sec_key = jsonTestDetails['sec_key']
res_usage = jsonTestDetails['resUsage']
ts_time = res_usage['test_set_time_1']
logger.info("training_task_status start#1**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") logger.info("training_task_status start#1**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
resubmit = jsonTestDetails['resubmit'] resubmit = jsonTestDetails['resubmit']
outPut = tran_base64_decode64(jsonTestDetails['outPut']) outPut = tran_base64_decode64(jsonTestDetails['outPut'])
@ -191,8 +195,8 @@ class MyshixunsController < ApplicationController
test_cases_time = format("%.3f", (Time.now.to_f - t1.to_f)).to_f test_cases_time = format("%.3f", (Time.now.to_f - t1.to_f)).to_f
if record.present? if record.present?
consume_time = format("%.3f", (Time.now - record.created_at)).to_f consume_time = format("%.3f", (Time.now - record.created_at)).to_f
record.update_attributes!(:consume_time => consume_time, :git_pull => timeCost['pull'] , record.update_attributes!(:consume_time => consume_time, :git_pull => timeCost['pull'] , :create_pod => timeCost['createPod'],
:create_pod => timeCost['createPod'], :pod_execute => timeCost['execute'], :test_cases => test_cases_time, :pod_execute => timeCost['execute'], :test_cases => test_cases_time, :ts_time => ts_time,
:brige => timeCost['evaluateAllTime'], :return_back => return_back_time) :brige => timeCost['evaluateAllTime'], :return_back => return_back_time)
end end
uid_logger("training_task_status start#4**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") uid_logger("training_task_status start#4**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")

@ -1,3 +1,11 @@
# 字段说明:
# consume_time总耗时包括前端发出请求到最后前端显示效果
# git_pull中间层pull代码耗时
# create_pod创建pod耗时
# pod_executepod执行时间耗时也就代码执行耗时是各个测试集的总耗时
# test_casesoutpus表中存储及处理测试集的时间耗时
# brige中间层总耗时
# return_back回调耗时从中间层发送请求到educoder所耗时间
class EvaluateRecord < ApplicationRecord class EvaluateRecord < ApplicationRecord
default_scope { order("evaluate_records.id desc") } default_scope { order("evaluate_records.id desc") }
belongs_to :game belongs_to :game

@ -1,3 +1,15 @@
# 字段说明:
# code-1表示评测未通过0表示评测成功实质是status的值
# mes
# out_put
# test_set_position: 测试集序号(排序)
# actual_output
# result:
# is_public测试集是否是公开
# query_index评测次数
# compile_success:
# text_scor:
# sec_key每次评测的唯一标识
class Output < ApplicationRecord class Output < ApplicationRecord
belongs_to :game belongs_to :game
end end

@ -0,0 +1,5 @@
class AddTsTimeToOutputs < ActiveRecord::Migration[5.2]
def change
add_column :outputs, :ts_time, :float
end
end

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