xiaohui-sun commented on a change in pull request #4190: [TE] pass predicted 
time series thought out the detection pipeline
URL: https://github.com/apache/incubator-pinot/pull/4190#discussion_r282160661
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/wrapper/AnomalyDetectorWrapper.java
 ##########
 @@ -201,8 +206,58 @@ public DetectionPipelineResult run() throws Exception {
       anomaly.getProperties().put(PROP_DETECTOR_COMPONENT_NAME, 
this.detectorName);
     }
     long lastTimeStamp = this.getLastTimeStamp();
-    return new DetectionPipelineResult(anomalies.stream().filter(anomaly -> 
anomaly.getEndTime() <= lastTimeStamp).collect(
-        Collectors.toList()), lastTimeStamp);
+    List<MergedAnomalyResultDTO> anomalyResults = 
anomalies.stream().filter(anomaly -> anomaly.getEndTime() <= 
lastTimeStamp).collect(
+        Collectors.toList());
+    PredictionResult predictedTimeSeries = new 
PredictionResult(this.detectorName, this.metricUrn, 
predictedResult.getDataFrame());
+    return new DetectionPipelineResult(anomalyResults, lastTimeStamp, 
Collections.singletonList(predictedTimeSeries));
+  }
+
+  /**
+   * Join two time series, including current, baseline, lower bound and upper 
bound. If two time series have overlapped region, take the average
+   * @param ts1 timeseries 1
+   * @param ts2 timeseries 2
+   * @return the consolidated time series
+   */
+  static TimeSeries consolidateTimeSeries(TimeSeries ts1, TimeSeries ts2) {
 
 Review comment:
   Is it better to put this join into TimeSeries object?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to