|
@@ -4,10 +4,11 @@ import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.google.common.collect.Sets;
|
|
import com.google.common.collect.Sets;
|
|
import com.tzld.commons.aliyun.log.AliyunLogManager;
|
|
import com.tzld.commons.aliyun.log.AliyunLogManager;
|
|
-import com.tzld.piaoquan.ad.engine.commons.score.ScoreParam;
|
|
|
|
-import com.tzld.piaoquan.ad.engine.service.log.LogHubService;
|
|
|
|
import com.tzld.piaoquan.ad.engine.commons.dto.AdPlatformCreativeDTO;
|
|
import com.tzld.piaoquan.ad.engine.commons.dto.AdPlatformCreativeDTO;
|
|
import com.tzld.piaoquan.ad.engine.commons.param.RecommendRequestParam;
|
|
import com.tzld.piaoquan.ad.engine.commons.param.RecommendRequestParam;
|
|
|
|
+import com.tzld.piaoquan.ad.engine.commons.score.ScoreParam;
|
|
|
|
+import com.tzld.piaoquan.ad.engine.service.log.LogHubService;
|
|
|
|
+import com.tzld.piaoquan.ad.engine.service.predict.v2.PredictContext;
|
|
import com.tzld.piaoquan.recommend.feature.domain.ad.base.AdRankItem;
|
|
import com.tzld.piaoquan.recommend.feature.domain.ad.base.AdRankItem;
|
|
import com.tzld.piaoquan.recommend.feature.domain.ad.base.AdRequestContext;
|
|
import com.tzld.piaoquan.recommend.feature.domain.ad.base.AdRequestContext;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -30,10 +31,13 @@ public class LogHubServiceImpl implements LogHubService {
|
|
TimeUnit.MINUTES, new LinkedBlockingDeque<>(), new ThreadPoolExecutor.CallerRunsPolicy());
|
|
TimeUnit.MINUTES, new LinkedBlockingDeque<>(), new ThreadPoolExecutor.CallerRunsPolicy());
|
|
|
|
|
|
@Value("${aliyun.log.logstore.statistics}")
|
|
@Value("${aliyun.log.logstore.statistics}")
|
|
- private String logStore;
|
|
|
|
|
|
+ private String scoreStatisticsLogStore;
|
|
@Value("${aliyun.log.project}")
|
|
@Value("${aliyun.log.project}")
|
|
private String project;
|
|
private String project;
|
|
|
|
|
|
|
|
+ @Value("${aliyun.log.logstore.crowdChooseStatistics}")
|
|
|
|
+ private String crowdChooseStatisticsLogStore;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private AliyunLogManager aliyunLogManager;
|
|
private AliyunLogManager aliyunLogManager;
|
|
|
|
|
|
@@ -54,6 +58,7 @@ public class LogHubServiceImpl implements LogHubService {
|
|
logMap.put("abcode", param.getAdAbGroup());
|
|
logMap.put("abcode", param.getAdAbGroup());
|
|
logMap.put("expid", abCode);
|
|
logMap.put("expid", abCode);
|
|
logMap.put("apptype", context.getApptype());
|
|
logMap.put("apptype", context.getApptype());
|
|
|
|
+ logMap.put("extractstrategy", "engine");
|
|
|
|
|
|
// 获取AB实验列表
|
|
// 获取AB实验列表
|
|
Set<String> abExpCode = new HashSet<>();
|
|
Set<String> abExpCode = new HashSet<>();
|
|
@@ -109,8 +114,31 @@ public class LogHubServiceImpl implements LogHubService {
|
|
logMap.put("allfeature", JSON.toJSONString(top1.getFeatureMap()));
|
|
logMap.put("allfeature", JSON.toJSONString(top1.getFeatureMap()));
|
|
logMap.put("metafeature", JSON.toJSONString(top1.getMetaFeatureMap()));
|
|
logMap.put("metafeature", JSON.toJSONString(top1.getMetaFeatureMap()));
|
|
|
|
|
|
- aliyunLogManager.sendLog(project, logStore, "", logMap);
|
|
|
|
|
|
+ aliyunLogManager.sendLog(project, scoreStatisticsLogStore, "", logMap);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void crowdChooseLogUpload(PredictContext context) {
|
|
|
|
+ logUploadThreadPool.execute(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ Map<String, Object> logMap = new HashMap<>();
|
|
|
|
+ logMap.put("mid", context.getMid());
|
|
|
|
+ logMap.put("vid", context.getVideoId());
|
|
|
|
+ logMap.put("apptype", context.getAppType());
|
|
|
|
+ logMap.put("abcode", context.getAdAbCode());
|
|
|
|
+ logMap.put("pqtid", context.getPqtId());
|
|
|
|
+ logMap.put("isshowad", context.getLogParam().isAIsShowAd());
|
|
|
|
+ logMap.put("expid", context.getLogParam().getExpId());
|
|
|
|
+ logMap.put("score", context.getLogParam().getScore());
|
|
|
|
+ logMap.put("allfeature", JSON.toJSONString(context.getLogParam().getAllFeature()));
|
|
|
|
+ logMap.put("metafeature", JSON.toJSONString(context.getLogParam().getMetaFeature()));
|
|
|
|
+ logMap.put("scoremap", JSON.toJSONString(context.getLogParam().getScoreMap()));
|
|
|
|
+
|
|
|
|
+ aliyunLogManager.sendLog(project, crowdChooseStatisticsLogStore, "", logMap);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|