Class OnionPerfAnalysisConverter
java.lang.Object
org.torproject.descriptor.onionperf.OnionPerfAnalysisConverter
public class OnionPerfAnalysisConverter
extends java.lang.Object
Converter that takes an OnionPerf analysis document as input and provides one
or more
TorperfResult
instances as output.
This conversion matches tgen
transfers and tor
streams by
stream port and transfer/stream end timestamps. This is different from the
approach taken in OnionPerf's analyze mode which only matches by stream
port. The result is that converted Torperf results might contain different
path or build time information as Torperf results written by OnionPerf.
-
Constructor Summary
Constructors Constructor Description OnionPerfAnalysisConverter(byte[] rawDescriptorBytes, java.io.File descriptorFile)
Construct a new instance from the given bytes and file reference. -
Method Summary
Modifier and Type Method Description java.util.List<Descriptor>
asTorperfResults()
Parse the OnionPerf analysis JSON document, do some basic verification, and convert its contents toTorperfResult
descriptors.
-
Constructor Details
-
OnionPerfAnalysisConverter
public OnionPerfAnalysisConverter(byte[] rawDescriptorBytes, java.io.File descriptorFile)Construct a new instance from the given bytes and file reference.- Parameters:
rawDescriptorBytes
- Uncompressed document bytes.descriptorFile
- Document file reference.
-
-
Method Details
-
asTorperfResults
Parse the OnionPerf analysis JSON document, do some basic verification, and convert its contents toTorperfResult
descriptors.- Returns:
- Converted transfers.
- Throws:
DescriptorParseException
- Thrown if something goes wrong while parsing, verifying, or converting the OnionPerf analysis file to Torperf results.
-