|
@@ -2,6 +2,7 @@ package com.tzld.longarticle.recommend.server.service.recommend;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
+import com.tzld.longarticle.recommend.server.common.CostMonitor;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticleTypeEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.aigc.PushTypeEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
|
|
@@ -92,15 +93,17 @@ public class RecommendService {
|
|
|
|
|
|
RecallResult recallResult = recallService.recall(convertToRecallParam(param));
|
|
|
long t2 = System.currentTimeMillis();
|
|
|
- log.info("recommendCost param:{} recall cost:{}", JSONObject.toJSONString(request), t2 - start);
|
|
|
+ CostMonitor.logCost("Recommend", "Recall", t2 - start);
|
|
|
RankResult rankResult = rankService.rank(convertToRankParam(param, recallResult));
|
|
|
long t3 = System.currentTimeMillis();
|
|
|
- log.info("recommendCost param:{} rank cost:{}", JSONObject.toJSONString(request), t3 - t2);
|
|
|
+ CostMonitor.logCost("Recommend", "Rank", t3 - t2);
|
|
|
saveSortLog(param, rankResult);
|
|
|
|
|
|
RecommendResponse response = buildRecommendResponse(recallResult, rankResult, param.getPublishNum());
|
|
|
- log.info("recommendCost param:{} response {} cost:{}", JSONObject.toJSONString(request), JSONObject.toJSONString(response),
|
|
|
- System.currentTimeMillis() - start);
|
|
|
+ long t4 = System.currentTimeMillis();
|
|
|
+ log.info("recommendCost param:{} total cost:{} recall:{} rank:{} response: {}", JSONObject.toJSONString(request),
|
|
|
+ t4 - start, t2 - start, t3 - t2, JSONObject.toJSONString(response));
|
|
|
+ CostMonitor.logCost("Recommend", "Total", t4 - start);
|
|
|
return response;
|
|
|
}
|
|
|
|