akshayrai commented on a change in pull request #4900: [TE][detection]
Implement anomalies cache to speed up detection
URL: https://github.com/apache/incubator-pinot/pull/4900#discussion_r359165436
##########
File path:
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/algorithm/DimensionWrapper.java
##########
@@ -308,6 +314,33 @@ public DetectionPipelineResult run() throws Exception {
predictionResults,
calculateEvaluationMetrics(predictionResults)).setDiagnostics(diagnostics);
}
+ private DatasetConfigDTO retrieveDatasetConfig(List<MetricEntity>
nestedMetrics) {
+ // All nested metrics after dimension explore belong to the same dataset
+ long metricId = nestedMetrics.get(0).getId();
+ MetricConfigDTO metricConfigDTO =
this.provider.fetchMetrics(Collections.singletonList(metricId)).get(metricId);
+
+ return
this.provider.fetchDatasets(Collections.singletonList(metricConfigDTO.getDataset()))
+ .get(metricConfigDTO.getDataset());
+ }
+
+ private void warmUpAnomaliesCache(List<MetricEntity> nestedMetrics) {
+ DatasetConfigDTO dataset = retrieveDatasetConfig(nestedMetrics);
+ long cachingPeriodLookback =
config.getProperties().containsKey(PROP_CACHE_PERIOD_LOOKBACK) ?
+ MapUtils.getLong(config.getProperties(), PROP_CACHE_PERIOD_LOOKBACK) :
ThirdEyeUtils
+ .getCachingPeriodLookback(dataset.bucketTimeGranularity());
+
+ long paddingBuffer = TimeUnit.DAYS.toMillis(1); // 100000
+ AnomalySlice anomalySlice = new AnomalySlice()
Review comment:
By default, fetchAnomalies will only return parent anomalies.
----------------------------------------------------------------
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]