move scatter plot creation into an AggregateHandler

This commit is contained in:
2019-10-20 08:11:09 +02:00
parent 7c61686808
commit b7c4fe4c1f
19 changed files with 186 additions and 109 deletions

View File

@@ -5,6 +5,7 @@ import org.lucares.pdb.plot.api.NullAggregate;
import org.lucares.pdb.plot.api.ParallelRequestsAggregate;
import org.lucares.pdb.plot.api.CumulativeDistributionHandler;
import org.lucares.pdb.plot.api.PlotSettings;
import org.lucares.pdb.plot.api.ScatterAggregateHandler;
import org.lucares.pdb.plot.api.TimeRangeUnitInternal;
import org.lucares.pdbui.domain.Aggregate;
import org.lucares.pdbui.domain.PlotRequest;
@@ -61,6 +62,8 @@ class PlotSettingsTransformer {
return new CumulativeDistributionHandler();
case PARALLEL:
return new ParallelRequestsAggregate();
case SCATTER:
return new ScatterAggregateHandler();
}
throw new IllegalStateException("unhandled enum: " + aggregate);
}

View File

@@ -1,14 +1,19 @@
package org.lucares.pdbui.domain;
/**
* Note: The order in this enum defines the order in which the aggregates are drawn.
*/
public enum Aggregate {
NONE,
PARALLEL,
SCATTER,
/**
* Empirical cumulative distribution functions
*
* @see https://serialmentor.com/dataviz/ecdf-qq.html
*/
CUM_DISTRIBUTION,
PARALLEL
}

View File

@@ -784,6 +784,7 @@ Vue.component('search-bar', {
<option value="NONE">-</option>
<option value="CUM_DISTRIBUTION" title="cumulative distribution, see https://serialmentor.com/dataviz/ecdf-qq.html">cum. distribution</option>
<option value="PARALLEL">parallel requests</option>
<option value="SCATTER">scatter plot</option>
</select>
</div>

View File

@@ -16,7 +16,8 @@ public class CsvToEntryTransformerPerformanceTest {
private static final byte NEWLINE = '\n';
public static void main(final String[] args) throws Exception {
@SuppressWarnings("unused")
public static void main(final String[] args) throws Exception {
// final Path csvFile =
// Paths.get("/home/andi/ws/performanceDb/data/production/1k.csv");
final Path csvFile = Paths.get("/home/andi/ws/performanceDb/data/production/logs_2018-09-05_2018-09-05.csv");
@@ -40,7 +41,8 @@ public class CsvToEntryTransformerPerformanceTest {
// System.out.println("summary: " + summaryStatisticsPut);
}
private static void runtest(final Path csvFile) throws IOException, FileNotFoundException {
@SuppressWarnings("unused")
private static void runtest(final Path csvFile) throws IOException, FileNotFoundException {
final byte newline = NEWLINE;
byte[] line = new byte[4096]; // max line length
@@ -92,7 +94,8 @@ public class CsvToEntryTransformerPerformanceTest {
private static void handleLine(final byte[] line, final int bytesInLine) {
final String x = new String(line, 0, bytesInLine, StandardCharsets.UTF_8);
@SuppressWarnings("unused")
final String x = new String(line, 0, bytesInLine, StandardCharsets.UTF_8);
// System.out.println(">" + x + "<");
}
}