Class CipherBenchmark.Report
java.lang.Object
moe.kyokobot.koe.experimental.crypto.CipherBenchmark.Report
- Enclosing class:
- CipherBenchmark
Results of a benchmark run, which can be stored as JSON to avoid running it on every start.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBumped on significant changes to the encryption modes, which make older results misleading, and on incompatible changes to the JSON format. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull CipherBenchmark.Report@NotNull Instant@NotNull List<CipherBenchmark.Measurement>intboolean@NotNull StringtoJson()@NotNull CipherPreferencePolicytoPolicy()toString()
-
Field Details
-
VERSION
public static final int VERSIONBumped on significant changes to the encryption modes, which make older results misleading, and on incompatible changes to the JSON format.fromJson(String)rejects reports with another version.- See Also:
-
-
Method Details
-
getCreatedAt
-
getEnvironment
- See Also:
-
getPayloadSize
public int getPayloadSize()- Returns:
- the size of the payload encrypted in every packet, in bytes
-
getMeasurements
- Returns:
- measurements from the fastest to the slowest mode
-
isFromCurrentEnvironment
public boolean isFromCurrentEnvironment()- Returns:
- whether the results were measured on the same JVM, OS and CPU, otherwise they may not apply anymore and the benchmark should run again
-
toPolicy
- Returns:
- a policy preferring modes from the fastest to the slowest
-
toJson
-
fromJson
- Parameters:
json- a report fromtoJson()- Returns:
- the parsed report
- Throws:
IllegalArgumentException- if the JSON is malformed or the report has anotherVERSION
-
toString
-