Commit 955832fe authored by Ana Custura's avatar Ana Custura Committed by Iain Learmonth
Browse files

Discards circuits based on OnionPerf filters

parent f19e54b7
Pipeline #10092 passed with stage
in 2 minutes and 31 seconds
......@@ -164,6 +164,7 @@ public class OnionPerfAnalysisConverter {
: measurements.tgen.transfers.values()) {
TorperfResultsBuilder torperfResultsBuilder
= new TorperfResultsBuilder();
boolean isFiltered = false;
torperfResultsBuilder.addString("SOURCE", nickname);
torperfResultsBuilder.addString("SOURCEADDRESS", measurementIp);
this.formatTransferParts(torperfResultsBuilder, transfer);
......@@ -180,6 +181,8 @@ public class OnionPerfAnalysisConverter {
&& circuitsByCircuitId.containsKey(stream.circuitId)) {
ParsedOnionPerfAnalysis.Circuit circuit
= circuitsByCircuitId.get(stream.circuitId);
isFiltered = circuit.filteredOut != null
&& circuit.filteredOut.equalsIgnoreCase("TRUE");
this.formatCircuitParts(torperfResultsBuilder, circuit);
}
}
......@@ -187,7 +190,9 @@ public class OnionPerfAnalysisConverter {
}
}
}
formattedTorperfResults.append(torperfResultsBuilder.build());
if (!isFiltered) {
formattedTorperfResults.append(torperfResultsBuilder.build());
}
}
}
if (null != measurements.tgen.streams) {
......@@ -195,6 +200,7 @@ public class OnionPerfAnalysisConverter {
: measurements.tgen.streams.values()) {
TorperfResultsBuilder torperfResultsBuilder
= new TorperfResultsBuilder();
boolean isFiltered = false;
torperfResultsBuilder.addString("SOURCE", nickname);
torperfResultsBuilder.addString("SOURCEADDRESS", measurementIp);
this.formatTgenStreamParts(torperfResultsBuilder, stream);
......@@ -213,6 +219,8 @@ public class OnionPerfAnalysisConverter {
.containsKey(torStream.circuitId)) {
ParsedOnionPerfAnalysis.Circuit circuit
= circuitsByCircuitId.get(torStream.circuitId);
isFiltered = circuit.filteredOut != null
&& circuit.filteredOut.equalsIgnoreCase("TRUE");
this.formatCircuitParts(torperfResultsBuilder, circuit);
}
}
......@@ -220,7 +228,9 @@ public class OnionPerfAnalysisConverter {
}
}
}
formattedTorperfResults.append(torperfResultsBuilder.build());
if (!isFiltered) {
formattedTorperfResults.append(torperfResultsBuilder.build());
}
}
}
}
......
......@@ -498,6 +498,12 @@ public class ParsedOnionPerfAnalysis {
* Unix timestamp at the start of this circuit's lifetime.
*/
Double unixTsStart;
/**
* Whether the circuit matched the filter criteria defined at measurement
* runtime.
*/
String filteredOut;
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment