Class BenchmarkResult
java.lang.Object
com.github.rlacher.sortbench.results.BenchmarkResult
Represents the raw, per-iteration result of a benchmark run.
This class encapsulates the profiling metrics and contextual information
collected during a single execution of a sorting algorithm.
Instances of this class are created by the BenchmarkRunner.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBenchmarkResult(BenchmarkContext context, Benchmarker.ProfilingMode profilingMode, double value) Constructs a new BenchmarkResult object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.Gets the benchmark context.Gets the profiling mode.doublegetValue()Gets the benchmark metric value.inthashCode()Returns a hash code value for the object.toString()Returns a string representation of the BenchmarkResult object.
-
Constructor Details
-
BenchmarkResult
public BenchmarkResult(BenchmarkContext context, Benchmarker.ProfilingMode profilingMode, double value) Constructs a new BenchmarkResult object.- Parameters:
context- The benchmark context. Must not benull.profilingMode- The profiling mode. Must not benull.value- The benchmark metric value. Must not be negative.- Throws:
IllegalArgumentException- If context or profilingMode arenull, or value is negative.
-
-
Method Details
-
getContext
Gets the benchmark context.- Returns:
- The benchmark context object.
-
getProfilingMode
Gets the profiling mode.- Returns:
- The profiling mode.
-
getValue
public double getValue()Gets the benchmark metric value.- Returns:
- The benchmark metric value.
-
toString
Returns a string representation of the BenchmarkResult object. -
equals
Indicates whether some other object is "equal to" this one. -
hashCode
public int hashCode()Returns a hash code value for the object.
-