increase maximal allowed duration for 'parallel requests' plot
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -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];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user