13
0

Improve output quality
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2022-08-24 11:28:24 +02:00
Ursprung 583c4100c7
Commit a318065188
2 geänderte Dateien mit 22 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -37,11 +37,26 @@ public class Sampler {
omittedMethods.add("java.util.Iterator.forEachRemaining"); omittedMethods.add("java.util.Iterator.forEachRemaining");
omittedMethods.add("java.lang.Iterable.forEach"); omittedMethods.add("java.lang.Iterable.forEach");
omittedMethods.add("java.util.ArrayList.forEach"); omittedMethods.add("java.util.ArrayList.forEach");
omittedMethods.add("java.util.ArrayList$ArrayListSpliterator.forEachRemaining");
omittedMethods.add("java.util.Map.forEach"); omittedMethods.add("java.util.Map.forEach");
omittedMethods.add("java.util.HashMap$EntrySpliterator.forEachRemaining");
omittedMethods.add("java.util.Spliterators$IteratorSpliterator.forEachRemaining");
omittedMethods.add("java.util.Spliterators$ArraySpliterator.forEachRemaining");
omittedMethods.add("java.util.concurrent.ThreadPoolExecutor$Worker.run"); omittedMethods.add("java.util.concurrent.ThreadPoolExecutor$Worker.run");
omittedMethods.add("java.util.concurrent.ThreadPoolExecutor.runWorker"); omittedMethods.add("java.util.concurrent.ThreadPoolExecutor.runWorker");
omittedMethods.add("java.util.concurrent.CompletableFuture$Completion.run"); omittedMethods.add("java.util.concurrent.CompletableFuture$Completion.run");
omittedMethods.add("java.util.concurrent.CompletableFuture$AsyncSupply.run"); omittedMethods.add("java.util.concurrent.CompletableFuture$AsyncSupply.run");
omittedMethods.add("java.util.stream.ReferencePipeline.forEach");
omittedMethods.add("java.util.stream.ReferencePipeline$7$1.forEach");
omittedMethods.add("java.util.stream.ReferencePipeline$3$1.accept");
omittedMethods.add("java.util.stream.AbstractPipeline.evaluate");
omittedMethods.add("java.util.stream.AbstractPipeline.wrapAndCopyInto");
omittedMethods.add("java.util.stream.AbstractPipeline.copyInto");
omittedMethods.add("java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential");
omittedMethods.add("java.util.stream.ForEachOps$ForEachOp.evaluateSequential");
omittedMethods.add("java.util.stream.ReduceOps$ReduceOp.evaluateSequential");
omittedMethods.add("java.util.stream.ReduceOps$1ReducingSink.accept");
omittedMethods.add("java.util.stream.Streams$StreamBuilderImpl.forEachRemaining");
} }
private final Map<String, Trace> traces = new HashMap<>(); private final Map<String, Trace> traces = new HashMap<>();

Datei anzeigen

@ -40,7 +40,11 @@ public class Trace {
} }
private String percentage(int value) { private String percentage(int value) {
return df.format(value * 100.0 / sampler.getSampleRuns()); return df.format(value * 100.0 / ownSampleRuns());
}
private String time(int value) {
return df.format(value * Sampler.SAMPLING_SPEED / 1e9);
} }
public void toDot(OutputStreamWriter writer) throws IOException { public void toDot(OutputStreamWriter writer) throws IOException {
@ -59,13 +63,13 @@ public class Trace {
if (a > 255) if (a > 255)
a = 255; a = 255;
writer.append(String.valueOf(id)).append(" [fillcolor=\"#").append(String.format("%02X", r)).append(String.format("%02X", g)).append(String.format("%02X", b)).append(String.format("%02X", a)).append("\",label=\"").append(name).append("\\n").append(percentage(ownSampleRuns())).append("% ").append(df.format(ownSampleRuns() * Sampler.SAMPLING_SPEED / 1e9)).append("s\\nR").append(percentage(runnable)).append("% B").append(percentage(blocked)).append("% W").append(percentage(waiting)).append("%\"];\n"); writer.append(String.valueOf(id)).append(" [fillcolor=\"#").append(String.format("%02X", r)).append(String.format("%02X", g)).append(String.format("%02X", b)).append(String.format("%02X", a)).append("\",label=\"").append(name).append("\\n").append(time(ownSampleRuns())).append("s ").append(percentage(ownSampleRuns())).append("%\\nR").append(percentage(runnable)).append("% B").append(percentage(blocked)).append("% W").append(percentage(waiting)).append("%\"];\n");
for (Map.Entry<Trace, Integer> entry : predecessors.entrySet()) { for (Map.Entry<Trace, Integer> entry : predecessors.entrySet()) {
if (entry.getKey().filtered() || entry.getValue() < Sampler.FILTER) if (entry.getKey().filtered() || entry.getValue() < Sampler.FILTER)
continue; continue;
writer.append(String.valueOf(entry.getKey().id)).append(" -> ").append(String.valueOf(id)).append(" [label=\"").append(percentage(entry.getValue())).append("%\",weight=").append(String.valueOf(entry.getValue())).append("];\n"); writer.append(String.valueOf(entry.getKey().id)).append(" -> ").append(String.valueOf(id)).append(" [label=\"").append(time(entry.getValue())).append("s\\n").append(percentage(entry.getValue())).append("%\",weight=").append(String.valueOf(entry.getValue())).append("];\n");
} }
} }
} }