Class Perf
java.lang.Object
io.nosqlbench.nb.api.testutils.Perf
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a test result to this performance collector.Add a test result to this performance collector.double[]Get the differences between successive test runs for a given property.doublegetMaximumDelta(Function<Result, Double> resultProperty, int count) For the most recent test runs, measure the maximum difference in a given property.booleanisConverged(Function<Result, Double> resultProperty, double withinMargin, int count) Extract the double field value from the last results and return whether or not they are within some fractional margin between the minimum and maximum seen value.iterator()Reduce a number of independent and concurrent runs into a single summary.Sort the internal results according to some propertytoString()toStringDelta(Function<Result, Double> resultProperty, String deltaDescription, int... lastN) Summarize the last results in a tabular format, with row-by-row delta included for a given property.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Perf
-
-
Method Details
-
getDeltas
Get the differences between successive test runs for a given property. The values provided have the same size as the results, but the first result will always be Double.NaN. This makes it easy to takeUpTo the results in tabular form and display them "as of" a given result index.- Parameters:
resultProperty- A function that yields a double from a Result- Returns:
- an array of deltas of that property
-
add
-
add
Add a test result to this performance collector.- Parameters:
description- A description of the resultstart- The start time of the test runend- The end time of the test runops- The total number of iterations of the test run- Returns:
- this Perf, for method chaining
-
isConverged
Extract the double field value from the last results and return whether or not they are within some fractional margin between the minimum and maximum seen value.- Parameters:
resultProperty- A function to extract the double field valuewithinMargin- A value like 0.01f to represent "10 percent"count- The number of recent results that must be present- Returns:
- true if there are at least count results, and the min and max values are within that margin
-
getMaximumDelta
For the most recent test runs, measure the maximum difference in a given property.- Parameters:
resultProperty- A function that produces a property from aResultcount- The number of recent test runs to consider- Returns:
- The difference between the min and max values of the property
-
sort
-
toString
-
toStringDelta
public String toStringDelta(Function<Result, Double> resultProperty, String deltaDescription, int... lastN) Summarize the last results in a tabular format, with row-by-row delta included for a given property.- Parameters:
resultProperty- A function that extracts a property from aResultdeltaDescription- The description of the delta columnlastN- The number of recent test runs to include- Returns:
- A tabular representation of the test runs and the deltas for the property
-
getLastResult
- Returns:
- Returns the last result
-
reduceConcurrent
Reduce a number of independent and concurrent runs into a single summary.- Returns:
- A Perf with a single result
-
iterator
-
start
-