jihaozh commented on a change in pull request #4149: [TE] support monitoring
granularity for Holt Winters
URL: https://github.com/apache/incubator-pinot/pull/4149#discussion_r277109385
##########
File path:
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/components/HoltWintersDetector.java
##########
@@ -137,15 +149,20 @@ public TimeSeries computePredictedTimeSeries(MetricSlice
slice) {
@Override
public List<MergedAnomalyResultDTO> runDetection(Interval window, String
metricUrn) {
MetricEntity metricEntity = MetricEntity.fromURN(metricUrn);
- DateTime trainStart = window.getStart().minus(lookbackPeriod);
+ DateTime trainStart;
+ if (!timeGranularity.equals(MetricSlice.NATIVE_GRANULARITY) &&
timeGranularity.getUnit() == TimeUnit.DAYS) {
Review comment:
Suggest putting this condition into a helper function. For example:
```
private boolean isMultiDayGranularity(){
return !timeGranularity.equals(MetricSlice.NATIVE_GRANULARITY) &&
timeGranularity.getUnit() == TimeUnit.DAYS;
}
```
----------------------------------------------------------------
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]