|
@@ -218,13 +218,16 @@ def video_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, al
|
|
|
gevent.joinall(t)
|
|
|
recall_result_list = [i.get() for i in t]
|
|
|
|
|
|
- end_recall = time.time()
|
|
|
- log_.info({'request_id': request_id,
|
|
|
- 'mid': mid,
|
|
|
- 'uid': uid,
|
|
|
- 'operation': 'recall',
|
|
|
- 'recall_result': recall_result_list,
|
|
|
- 'executeTime': (end_recall - start_recall) * 1000})
|
|
|
+
|
|
|
+ log_.info({
|
|
|
+ 'logTimestamp': int(time.time() * 1000),
|
|
|
+ 'request_id': request_id,
|
|
|
+ 'mid': mid,
|
|
|
+ 'uid': uid,
|
|
|
+ 'operation': 'recall',
|
|
|
+ 'recall_result': recall_result_list,
|
|
|
+ 'executeTime': (time.time() - start_recall) * 1000
|
|
|
+ })
|
|
|
|
|
|
|
|
|
|
|
@@ -257,26 +260,32 @@ def video_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, al
|
|
|
|
|
|
|
|
|
|
|
|
- end_rank = time.time()
|
|
|
- log_.info({'request_id': request_id,
|
|
|
- 'mid': mid,
|
|
|
- 'uid': uid,
|
|
|
- 'operation': 'rank',
|
|
|
- 'rank_result': rank_result,
|
|
|
- 'executeTime': (end_rank - start_rank) * 1000})
|
|
|
+
|
|
|
+ log_.info({
|
|
|
+ 'logTimestamp': int(time.time() * 1000),
|
|
|
+ 'request_id': request_id,
|
|
|
+ 'mid': mid,
|
|
|
+ 'uid': uid,
|
|
|
+ 'operation': 'rank',
|
|
|
+ 'rank_result': rank_result,
|
|
|
+ 'executeTime': (time.time() - start_rank) * 1000
|
|
|
+ })
|
|
|
|
|
|
if not rank_result:
|
|
|
|
|
|
|
|
|
start_bottom = time.time()
|
|
|
rank_result = bottom_strategy(request_id=request_id, size=size, app_type=app_type, ab_code=ab_code, params=params)
|
|
|
- end_bottom = time.time()
|
|
|
- log_.info({'request_id': request_id,
|
|
|
- 'mid': mid,
|
|
|
- 'uid': uid,
|
|
|
- 'operation': 'bottom',
|
|
|
- 'bottom_result': rank_result,
|
|
|
- 'executeTime': (end_bottom - start_bottom) * 1000})
|
|
|
+
|
|
|
+ log_.info({
|
|
|
+ 'logTimestamp': int(time.time() * 1000),
|
|
|
+ 'request_id': request_id,
|
|
|
+ 'mid': mid,
|
|
|
+ 'uid': uid,
|
|
|
+ 'operation': 'bottom',
|
|
|
+ 'bottom_result': rank_result,
|
|
|
+ 'executeTime': (time.time() - start_bottom) * 1000
|
|
|
+ })
|
|
|
|
|
|
return rank_result, last_rov_recall_key
|
|
|
|
|
@@ -622,12 +631,15 @@ def video_homepage_recommend(request_id, mid, uid, size, app_type, algo_type, cl
|
|
|
param_st = time.time()
|
|
|
top_K, flow_pool_P, ab_code, rule_key, expire_time, no_op_flag, old_video_index = \
|
|
|
get_recommend_params(ab_exp_info=ab_exp_info)
|
|
|
- log_.info({'request_id': request_id,
|
|
|
- 'app_type': app_type,
|
|
|
- 'mid': mid,
|
|
|
- 'uid': uid,
|
|
|
- 'operation': 'get_recommend_params',
|
|
|
- 'executeTime': (time.time() - param_st) * 1000})
|
|
|
+ log_.info({
|
|
|
+ 'logTimestamp': int(time.time() * 1000),
|
|
|
+ 'request_id': request_id,
|
|
|
+ 'app_type': app_type,
|
|
|
+ 'mid': mid,
|
|
|
+ 'uid': uid,
|
|
|
+ 'operation': 'get_recommend_params',
|
|
|
+ 'executeTime': (time.time() - param_st) * 1000
|
|
|
+ })
|
|
|
|
|
|
|
|
|
get_result_st = time.time()
|
|
@@ -639,12 +651,15 @@ def video_homepage_recommend(request_id, mid, uid, size, app_type, algo_type, cl
|
|
|
rule_key=rule_key, no_op_flag=no_op_flag,
|
|
|
old_video_index=old_video_index,
|
|
|
params=params)
|
|
|
- log_.info({'request_id': request_id,
|
|
|
- 'app_type': app_type,
|
|
|
- 'mid': mid,
|
|
|
- 'uid': uid,
|
|
|
- 'operation': 'get_recommend_result',
|
|
|
- 'executeTime': (time.time() - get_result_st) * 1000})
|
|
|
+ log_.info({
|
|
|
+ 'logTimestamp': int(time.time() * 1000),
|
|
|
+ 'request_id': request_id,
|
|
|
+ 'app_type': app_type,
|
|
|
+ 'mid': mid,
|
|
|
+ 'uid': uid,
|
|
|
+ 'operation': 'get_recommend_result',
|
|
|
+ 'executeTime': (time.time() - get_result_st) * 1000
|
|
|
+ })
|
|
|
|
|
|
|
|
|
|
|
@@ -654,12 +669,15 @@ def video_homepage_recommend(request_id, mid, uid, size, app_type, algo_type, cl
|
|
|
update_redis_st = time.time()
|
|
|
update_redis_data(result=rank_result, app_type=app_type, mid=mid, last_rov_recall_key=last_rov_recall_key,
|
|
|
top_K=top_K)
|
|
|
- log_.info({'request_id': request_id,
|
|
|
- 'app_type': app_type,
|
|
|
- 'mid': mid,
|
|
|
- 'uid': uid,
|
|
|
- 'operation': 'update_redis_data',
|
|
|
- 'executeTime': (time.time() - update_redis_st) * 1000})
|
|
|
+ log_.info({
|
|
|
+ 'logTimestamp': int(time.time() * 1000),
|
|
|
+ 'request_id': request_id,
|
|
|
+ 'app_type': app_type,
|
|
|
+ 'mid': mid,
|
|
|
+ 'uid': uid,
|
|
|
+ 'operation': 'update_redis_data',
|
|
|
+ 'executeTime': (time.time() - update_redis_st) * 1000
|
|
|
+ })
|
|
|
|
|
|
return rank_result
|
|
|
|
|
@@ -682,12 +700,15 @@ def video_relevant_recommend(request_id, video_id, mid, uid, size, app_type, ab_
|
|
|
param_st = time.time()
|
|
|
top_K, flow_pool_P, ab_code, rule_key, expire_time, no_op_flag, old_video_index = \
|
|
|
get_recommend_params(ab_exp_info=ab_exp_info, page_type=page_type)
|
|
|
- log_.info({'request_id': request_id,
|
|
|
- 'app_type': app_type,
|
|
|
- 'mid': mid,
|
|
|
- 'uid': uid,
|
|
|
- 'operation': 'get_recommend_params',
|
|
|
- 'executeTime': (time.time() - param_st) * 1000})
|
|
|
+ log_.info({
|
|
|
+ 'logTimestamp': int(time.time() * 1000),
|
|
|
+ 'request_id': request_id,
|
|
|
+ 'app_type': app_type,
|
|
|
+ 'mid': mid,
|
|
|
+ 'uid': uid,
|
|
|
+ 'operation': 'get_recommend_params',
|
|
|
+ 'executeTime': (time.time() - param_st) * 1000
|
|
|
+ })
|
|
|
|
|
|
|
|
|
get_result_st = time.time()
|
|
@@ -699,12 +720,15 @@ def video_relevant_recommend(request_id, video_id, mid, uid, size, app_type, ab_
|
|
|
rule_key=rule_key, no_op_flag=no_op_flag,
|
|
|
old_video_index=old_video_index, video_id=video_id,
|
|
|
params=params)
|
|
|
- log_.info({'request_id': request_id,
|
|
|
- 'app_type': app_type,
|
|
|
- 'mid': mid,
|
|
|
- 'uid': uid,
|
|
|
- 'operation': 'get_recommend_result',
|
|
|
- 'executeTime': (time.time() - get_result_st) * 1000})
|
|
|
+ log_.info({
|
|
|
+ 'logTimestamp': int(time.time() * 1000),
|
|
|
+ 'request_id': request_id,
|
|
|
+ 'app_type': app_type,
|
|
|
+ 'mid': mid,
|
|
|
+ 'uid': uid,
|
|
|
+ 'operation': 'get_recommend_result',
|
|
|
+ 'executeTime': (time.time() - get_result_st) * 1000
|
|
|
+ })
|
|
|
|
|
|
|
|
|
|
|
@@ -714,12 +738,15 @@ def video_relevant_recommend(request_id, video_id, mid, uid, size, app_type, ab_
|
|
|
update_redis_st = time.time()
|
|
|
update_redis_data(result=rank_result, app_type=app_type, mid=mid, last_rov_recall_key=last_rov_recall_key,
|
|
|
top_K=top_K)
|
|
|
- log_.info({'request_id': request_id,
|
|
|
- 'app_type': app_type,
|
|
|
- 'mid': mid,
|
|
|
- 'uid': uid,
|
|
|
- 'operation': 'update_redis_data',
|
|
|
- 'executeTime': (time.time() - update_redis_st) * 1000})
|
|
|
+ log_.info({
|
|
|
+ 'logTimestamp': int(time.time() * 1000),
|
|
|
+ 'request_id': request_id,
|
|
|
+ 'app_type': app_type,
|
|
|
+ 'mid': mid,
|
|
|
+ 'uid': uid,
|
|
|
+ 'operation': 'update_redis_data',
|
|
|
+ 'executeTime': (time.time() - update_redis_st) * 1000
|
|
|
+ })
|
|
|
|
|
|
return rank_result
|
|
|
|