|
@@ -2,6 +2,7 @@ package com.tzld.longarticle.recommend.server.service.recommend.score;
|
|
|
|
|
|
|
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
+import com.tzld.longarticle.recommend.server.common.CostMonitor;
|
|
|
import com.tzld.longarticle.recommend.server.common.ThreadPoolFactory;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.recommend.ScoreStrategyEnum;
|
|
@@ -57,7 +58,10 @@ public class ScoreService implements ApplicationContextAware {
|
|
|
for (final ScoreStrategy strategy : strategies) {
|
|
|
Future<List<Score>> future = pool.submit(() -> {
|
|
|
try {
|
|
|
+ long t1 = System.currentTimeMillis();
|
|
|
List<Score> result = strategy.score(param);
|
|
|
+ long t2 = System.currentTimeMillis();
|
|
|
+ CostMonitor.logCost("Score", strategy.getClass().getSimpleName(), t2 - t1);
|
|
|
return result;
|
|
|
} catch (Exception e) {
|
|
|
log.error("scoreService error:{}", e.getMessage(), e);
|