jihaozh commented on a change in pull request #3842: [TE] detection - time
series provider loading cache
URL: https://github.com/apache/incubator-pinot/pull/3842#discussion_r258691510
##########
File path:
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DefaultDataProvider.java
##########
@@ -84,27 +87,38 @@ public DefaultDataProvider(MetricConfigManager metricDAO,
DatasetConfigManager d
this.timeseriesLoader = timeseriesLoader;
this.aggregationLoader = aggregationLoader;
this.loader = loader;
- this.timeseriesCache = CacheBuilder.newBuilder()
- .maximumSize(100)
- .expireAfterWrite(30, TimeUnit.MINUTES)
- .build(new CacheLoader<MetricSlice, DataFrame>() {
- @Override
- public DataFrame load(MetricSlice slice) {
- return fetchTimeseries(Collections.singleton(slice)).get(slice);
- }
- });
- }
+ if (DETECTION_TIME_SERIES_CACHE == null) {
+ LOG.info("initializing detection timeseries cache");
+ DETECTION_TIME_SERIES_CACHE = CacheBuilder.newBuilder()
+ // don't use more than one third of memory for detection time series
+ .maximumWeight(Runtime.getRuntime().freeMemory() / 3)
+ .expireAfterWrite(15, TimeUnit.MINUTES)
Review comment:
added
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]