|
@@ -47,7 +47,6 @@ public class RankService687 extends RankStrategyXGBBasic {
|
|
|
scoreParam.getRequestContext().setMachineinfoBrand(brand + "-n");
|
|
|
}
|
|
|
|
|
|
- Stopwatch sw = Stopwatch.createStarted();
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
|
|
Feature feature = this.getFeature(scoreParam, request);
|
|
@@ -73,8 +72,7 @@ public class RankService687 extends RankStrategyXGBBasic {
|
|
|
Map<String, String> e2Feature = userFeature.getOrDefault("alg_mid_feature_share_tags", new HashMap<>());
|
|
|
|
|
|
Map<String, String> sceneFeatureMap = this.handleSceneFeature(ts);
|
|
|
- long time1 = sw.elapsed(TimeUnit.MILLISECONDS);
|
|
|
- sw.reset();
|
|
|
+ long time1 = System.currentTimeMillis();
|
|
|
|
|
|
List<AdRankItem> adRankItems = new ArrayList<>(request.getAdIdList().size());
|
|
|
for (AdPlatformCreativeDTO dto : request.getAdIdList()) {
|
|
@@ -120,8 +118,7 @@ public class RankService687 extends RankStrategyXGBBasic {
|
|
|
|
|
|
}
|
|
|
|
|
|
- long time2 = sw.elapsed(TimeUnit.MILLISECONDS);
|
|
|
- sw.reset();
|
|
|
+ long time2 = System.currentTimeMillis();
|
|
|
|
|
|
this.readBucketFile();
|
|
|
userFeatureMap = this.featureBucket(userFeatureMap);
|
|
@@ -136,8 +133,7 @@ public class RankService687 extends RankStrategyXGBBasic {
|
|
|
List<AdRankItem> result = ScorerUtils.getScorerPipeline(ScorerUtils.XGBOOST_SCORE_CONF_683)
|
|
|
.scoring(sceneFeatureMap, userFeatureMap, adRankItems);
|
|
|
|
|
|
- long time3 = sw.elapsed(TimeUnit.MILLISECONDS);
|
|
|
- sw.reset();
|
|
|
+ long time3 = System.currentTimeMillis();
|
|
|
for (AdRankItem item : result) {
|
|
|
item.setScore(item.getLrScore() * item.getCpa());
|
|
|
item.getScoreMap().put("cpa", item.getCpa());
|
|
@@ -177,10 +173,9 @@ public class RankService687 extends RankStrategyXGBBasic {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- long time4 = sw.elapsed(TimeUnit.MILLISECONDS);
|
|
|
- sw.reset();
|
|
|
+ long time4 = System.currentTimeMillis();
|
|
|
log.info("cost={}, feature1={}, feature2={}, getScorerPipeline={}, loop={}",
|
|
|
- System.currentTimeMillis() - start, time1, time2, time3, time4);
|
|
|
+ time4 - start, time1 - start, time2 - time1, time3 - time2, time4 - time3);
|
|
|
|
|
|
result.sort(ComparatorUtil.equalsRandomComparator());
|
|
|
|