Package org.openjdk.jmh.results
Class Result<T extends Result<T>>
java.lang.Object
org.openjdk.jmh.results.Result<T>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AverageTimeResult
,LinuxPerfProfiler.PerfResult
,PausesProfiler.PausesProfilerResult
,SafepointsProfiler.SafepointProfilerResult
,SampleTimeResult
,ScalarDerivativeResult
,ScalarResult
,SingleShotResult
,StackProfiler.StackResult
,TextResult
,ThroughputResult
Base class for all types of results that can be returned by a benchmark.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Deduplicator
<String> protected final String
protected final AggregationPolicy
protected final ResultRole
private static final long
protected final Statistics
protected final String
-
Constructor Summary
ConstructorsConstructorDescriptionResult
(ResultRole role, String label, Statistics s, String unit, AggregationPolicy policy) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Print extended result informationprotected Collection
<? extends Result> protected abstract Aggregator
<T> Iteration aggregator combines the iteration results into benchmar result.getLabel()
Return the result label.getRole()
Return the result role.long
Get number of samples in the current result.double
getScore()
The score for this result.double[]
The score confidence interval for this result.double
The score error for this result.final String
The unit of the score for this result.Return the statistics holding the subresults' values.protected abstract Aggregator
<T> Thread aggregator combines the thread results into iteration result.protected T
Returns "0" result.protected static Statistics
of
(double v) private void
printHisto
(Statistics stats, StringBuilder sb) private void
printPercentiles
(Statistics stats, StringBuilder sb) protected String
toString()
Result as represented by a String.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
DEDUP
-
role
-
label
-
unit
-
statistics
-
policy
-
-
Constructor Details
-
Result
-
-
Method Details
-
of
-
getLabel
Return the result label.- Returns:
- result label
-
getRole
Return the result role.- Returns:
- result role
-
getStatistics
Return the statistics holding the subresults' values.This method returns raw samples. The aggregation policy decides how to get the score out of these raw samples. Use
getScore()
,getScoreError()
, andgetScoreConfidence()
for scalar results.- Returns:
- statistics
-
getScoreUnit
The unit of the score for this result.- Returns:
- String representation of the unit
-
getScore
public double getScore()The score for this result.- Returns:
- double representing the score
- See Also:
-
getScoreError
public double getScoreError()The score error for this result.- Returns:
- score error, if available
- See Also:
-
getScoreConfidence
public double[] getScoreConfidence()The score confidence interval for this result.- Returns:
- score confidence interval, if available; if not, the CI will match
getScore()
- See Also:
-
getSampleCount
public long getSampleCount()Get number of samples in the current result.- Returns:
- number of samples
-
getThreadAggregator
Thread aggregator combines the thread results into iteration result.- Returns:
- thread aggregator
-
getIterationAggregator
Iteration aggregator combines the iteration results into benchmar result.- Returns:
- iteration aggregator
-
getZeroResult
Returns "0" result. This is used for un-biased aggregation of secondary results. For instance, profilers might omit results in some iterations, thus we should pretend there were 0 results.- Returns:
- result that represents "empty" result, null if no sensible "empty" result can be created
-
getDerivativeResults
- Returns:
- derivative results for this result. These do not participate in aggregation, and computed on the spot from the aggregated result.
-
toString
Result as represented by a String. -
extendedInfo
Print extended result information- Returns:
- String with extended info
-
simpleExtendedInfo
-
distributionExtendedInfo
-
printPercentiles
-
printHisto
-