소스 검색

coss diff的计算逻辑

wcc 3 년 전
부모
커밋
7d6ddc85e6

+ 1 - 1
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/process/CostHourProcess.java

@@ -245,7 +245,7 @@ public class CostHourProcess extends KeyedProcessFunction<Long, AdStatOfHourDWD,
         if (lastThreeHourMapping != null && !lastThreeHourMapping.isEmpty()) {
             AdStatOfHourDWD lastThreeHourDWD = lastThreeHourMapping.get(lastThreeHour);
             if (lastThreeHourDWD != null) {
-                costLastThreeTrend = lastThreeHourDWD.getCostHour();
+                costLastThreeTrend = costLastHourDiff > 0 && costDiff > 0 ? 1 : 0;
                 costLastTwoHourDiff = costLastTwoHour - lastThreeHourDWD.getCostHour();
             }
         }

+ 1 - 1
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/process/CostMinuteProcess.java

@@ -70,7 +70,7 @@ public class CostMinuteProcess extends KeyedProcessFunction<Long, AdStatOfMinute
         if (lastThreeHourMapping != null && !lastThreeHourMapping.isEmpty()) {
             AdStatOfMinuteDWD lastThreeHourDWD = lastThreeHourMapping.get(lastThreeHour);
             if (lastThreeHourDWD != null) {
-                costLastThreeTrend = lastThreeHourDWD.getCostHour();
+                costLastThreeTrend = costLastHourDiff > 0 && costDiff > 0 ? 1 : 0;
                 costLastTwoHourDiff = costLastTwoHour - lastThreeHourDWD.getCostHour();
             }
         }