|
@@ -30,7 +30,8 @@ public class FeatureService {
|
|
|
|
|
|
|
|
public Feature getFeature(Collection<String> cidList, Collection<String> adVerIdList, List<Long> skuIdList, ScoreParam param) {
|
|
public Feature getFeature(Collection<String> cidList, Collection<String> adVerIdList, List<Long> skuIdList, ScoreParam param) {
|
|
|
AdRequestContext context = param.getRequestContext();
|
|
AdRequestContext context = param.getRequestContext();
|
|
|
-
|
|
|
|
|
|
|
+ log.info("getFeature, cidListSize:{}, adVerIdListSize:{}, skuIdListSize:{}", cidList.size(), adVerIdList.size(), skuIdList.size());
|
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
List<FeatureKeyProto> protos = new ArrayList<>();
|
|
List<FeatureKeyProto> protos = new ArrayList<>();
|
|
|
for (String cidStr : cidList) {
|
|
for (String cidStr : cidList) {
|
|
|
|
|
|
|
@@ -63,7 +64,8 @@ public class FeatureService {
|
|
|
protos.add(genWithCidAndVid("alg_cid_feature_vid_cf", cidStr, param.getVideoId().toString()));
|
|
protos.add(genWithCidAndVid("alg_cid_feature_vid_cf", cidStr, param.getVideoId().toString()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ long stage1 = System.currentTimeMillis();
|
|
|
|
|
+ log.info("getFeature, protosSize:{}, 耗时1:{}", protos.size(), stage1 - start);
|
|
|
// skuid
|
|
// skuid
|
|
|
for (Long skuId : skuIdList) {
|
|
for (Long skuId : skuIdList) {
|
|
|
if (StringUtils.isNotEmpty(param.getMid())) {
|
|
if (StringUtils.isNotEmpty(param.getMid())) {
|
|
@@ -93,7 +95,11 @@ public class FeatureService {
|
|
|
protos.add(genWithMid("mid_return_video_cate", param.getMid()));
|
|
protos.add(genWithMid("mid_return_video_cate", param.getMid()));
|
|
|
protos.add(genWithMid("mid_share_video_cate", param.getMid()));
|
|
protos.add(genWithMid("mid_share_video_cate", param.getMid()));
|
|
|
}
|
|
}
|
|
|
- return this.invokeFeatureService(protos);
|
|
|
|
|
|
|
+ long stage2 = System.currentTimeMillis();
|
|
|
|
|
+ log.info("getFeature, protosSize:{}, 耗时2:{}", protos.size(), stage2 - stage1);
|
|
|
|
|
+ Feature feature = this.invokeFeatureService(protos);
|
|
|
|
|
+ log.info("getFeature, 耗时3:{}", System.currentTimeMillis() - stage2);
|
|
|
|
|
+ return feature;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Feature getPredictFeature(PredictContext context) {
|
|
public Feature getPredictFeature(PredictContext context) {
|