jihaozh commented on a change in pull request #4988: [TE] Support weekly 
anomaly detection
URL: https://github.com/apache/incubator-pinot/pull/4988#discussion_r367154967
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/components/PercentageChangeRuleDetector.java
 ##########
 @@ -76,16 +80,34 @@
 
   @Override
   public DetectionResult runDetection(Interval window, String metricUrn) {
+    long startMillis = window.getStartMillis();
+
+    // align start day to the user specified week start
+    if (Objects.nonNull(this.weekStart)) {
+      startMillis = 
window.getStart().withDayOfWeek(weekStart.getValue()).minusWeeks(1).getMillis();
 
 Review comment:
   Yes. This is to ensure that the window is aligned to the specified boundary 
because in preview it can be adjusted to any day.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to