increase maximal allowed duration for 'parallel requests' plot

This commit is contained in:
2019-08-25 10:47:23 +02:00
parent da97a13ed8
commit a905c608aa
2 changed files with 2 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ package org.lucares.pdb.plot.api;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Collection; import java.util.Collection;
import java.util.concurrent.TimeUnit;
import org.lucares.recommind.logs.DataSeries; import org.lucares.recommind.logs.DataSeries;
@@ -36,7 +37,7 @@ public class ParallelRequestsAggregate implements AggregateHandler {
@Override @Override
public CustomAggregator createCustomAggregator(final Path tmpDir, final long fromEpochMilli, public CustomAggregator createCustomAggregator(final Path tmpDir, final long fromEpochMilli,
final long toEpochMilli) { final long toEpochMilli) {
if ((toEpochMilli - fromEpochMilli) <= 3600 * 1000) { if ((toEpochMilli - fromEpochMilli) <= TimeUnit.HOURS.toMillis(5)) {
return new ParallelRequestsAggregator(tmpDir, fromEpochMilli, toEpochMilli); return new ParallelRequestsAggregator(tmpDir, fromEpochMilli, toEpochMilli);
} else { } else {
return new NullCustomAggregator(); return new NullCustomAggregator();

View File

@@ -34,11 +34,6 @@ public class ParallelRequestsAggregator implements CustomAggregator {
this.fromEpochMilli = fromEpochMilli; this.fromEpochMilli = fromEpochMilli;
this.toEpochMilli = toEpochMilli; this.toEpochMilli = toEpochMilli;
if ((toEpochMilli - fromEpochMilli) > 3600 * 1000) {
throw new IllegalArgumentException("The " + ParallelRequestsAggregator.class.getSimpleName()
+ " must only be active for periods shorter than one hour, due to memory concerns.");
}
final int milliseconds = (int) (toEpochMilli - fromEpochMilli); final int milliseconds = (int) (toEpochMilli - fromEpochMilli);
increments = new short[milliseconds]; increments = new short[milliseconds];
} }