Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions backend/modules/evaluation/domain/service/expt_result_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1169,8 +1169,7 @@ func (e ExptResultServiceImpl) CalculateStats(ctx context.Context, exptID, space
total = 0
cnt = 0
icnt = 0
itotal = 0
ioffset = 0
ioffset = 1

pendingCnt = 0
failCnt = 0
Expand All @@ -1181,13 +1180,12 @@ func (e ExptResultServiceImpl) CalculateStats(ctx context.Context, exptID, space
)

for i := 0; i < maxLoop; i++ {
itemResultList, t, err := e.ExptItemResultRepo.ListItemResultsByExptID(ctx, exptID, spaceID, entity.NewPage(offset, limit), false)
itemResultList, iTotal, err := e.ExptItemResultRepo.ListItemResultsByExptID(ctx, exptID, spaceID, entity.NewPage(ioffset, limit), false)
if err != nil {
return nil, err
}
itotal += int(t)
icnt += len(itemResultList)
ioffset += offset
ioffset++
for _, item := range itemResultList {
switch item.Status {
case entity.ItemRunState_Success:
Expand All @@ -1203,7 +1201,7 @@ func (e ExptResultServiceImpl) CalculateStats(ctx context.Context, exptID, space
default:
}
}
if icnt >= itotal || len(itemResultList) == 0 {
if icnt >= int(iTotal) || len(itemResultList) == 0 {
break
}
time.Sleep(time.Millisecond * 30)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ func (dao *exptItemResultDAOImpl) ScanItemResults(ctx context.Context, exptID, c
}

func (dao *exptItemResultDAOImpl) ListItemResultsByExptID(ctx context.Context, exptID, spaceID int64, page entity.Page, desc bool) ([]*model.ExptItemResult, int64, error) {

db := dao.provider.NewSession(ctx)
q := query.Use(db).ExptItemResult
conds := []gen.Condition{
Expand Down
6 changes: 3 additions & 3 deletions conf/evaluation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ evaluator_record_correction_rmq:
consume_timeout: 10m
expt_turn_result_filter_rmq:
addr: 'cozeloop-namesrv:9876'
topic: 'stone_cozeloop_evaluation_expt_turn_result_filter'
consumer_group: 'stone_cozeloop_evaluation_expt_turn_result_filter_cg'
producer_group: 'stone_cozeloop_evaluation_expt_turn_result_filter_pg'
topic: 'cozeloop_evaluation_expt_turn_result_filter'
consumer_group: 'cozeloop_evaluation_expt_turn_result_filter_cg'
producer_group: 'cozeloop_evaluation_expt_turn_result_filter_pg'
consume_timeout: 10m

rate_limiter_conf:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE `expt_turn_result_filter_key_mapping`
(
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`space_id` bigint NOT NULL COMMENT '空间id',
`expt_id` bigint NOT NULL COMMENT '实验id',
`from_field` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '筛选项唯一键,评估器: evaluator_version_id,人工标准:tag_key_id',
`to_key` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ck侧的map key,评估器:key1 ~ key10,人工标准:key1 ~ key100',
`field_type` int NOT NULL COMMENT '映射类型,Evaluator —— 1,人工标注—— 2',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
`created_by` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_idx_space_expt_from_type` (`space_id`,`expt_id`,`field_type`,`from_field`)
) ENGINE=InnoDB AUTO_INCREMENT=6690 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='expt_turn_result_filter二级key映射表';
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ expt_online_eval_result_event=online_eval_result_local_test_cg
evaluator_record_correction_event=evaluator_record_correction_local_test_cg
trace_ingestion_event=collector_rmq_receiver
trace_annotation_event=trace_annotation_event_cg
stone_cozeloop_evaluation_expt_turn_result_filter=stone_cozeloop_evaluation_expt_turn_result_filter_cg
cozeloop_evaluation_expt_turn_result_filter=cozeloop_evaluation_expt_turn_result_filter_cg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE `expt_turn_result_filter_key_mapping`
(
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`space_id` bigint NOT NULL COMMENT '空间id',
`expt_id` bigint NOT NULL COMMENT '实验id',
`from_field` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '筛选项唯一键,评估器: evaluator_version_id,人工标准:tag_key_id',
`to_key` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ck侧的map key,评估器:key1 ~ key10,人工标准:key1 ~ key100',
`field_type` int NOT NULL COMMENT '映射类型,Evaluator —— 1,人工标注—— 2',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
`created_by` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_idx_space_expt_from_type` (`space_id`,`expt_id`,`field_type`,`from_field`)
) ENGINE=InnoDB AUTO_INCREMENT=6690 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='expt_turn_result_filter二级key映射表';
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ expt_online_eval_result_event=online_eval_result_local_test_cg
evaluator_record_correction_event=evaluator_record_correction_local_test_cg
trace_ingestion_event=collector_rmq_receiver
trace_annotation_event=trace_annotation_event_cg
stone_cozeloop_evaluation_expt_turn_result_filter=stone_cozeloop_evaluation_expt_turn_result_filter_cg
cozeloop_evaluation_expt_turn_result_filter=cozeloop_evaluation_expt_turn_result_filter_cg