Class SimFrameCapture
java.lang.Object
io.nosqlbench.scenarios.simframe.capture.SimFrameCapture
- All Implemented Interfaces:
SimFrameResults
- Direct Known Subclasses:
SimFrameValueData
This is a helper class that makes it easy to bundle up a combination of measurable
factors and get a windowed sample from them. To use it, add your named data sources
with their coefficients, and optionally a frameStartCallback which resets the measurement
buffers for the next time. When you call
getValue(), all callbacks
are used after the value computation is complete.
This is NOT thread safe!
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDeltaTime(String name, DoubleSupplier supplier, double weight) voidaddDeltaTime(String name, DoubleSupplier supplier, double weight, Runnable callback) voidaddDeltaTime(String name, LongSupplier supplier, double weight) Delta Time values are taken as the differential of the first and last values with respect to time passing.voidaddDirect(String name, DoubleSupplier supplier, double weight) Direct values are simply measured at the end of a frame.voidaddRemix(String name, ToDoubleFunction<BasisValues> remix) voidaddRemix(String name, ToDoubleFunction<BasisValues> remix, double weight) voidaddRemix(String name, ToDoubleFunction<BasisValues> remix, double weight, Runnable callback) A remix function takes as its input the computed raw values of the other functions, irrespective of their weights or weighting functions.voiddoublegetValue()history()last()voidvoidrestartWindow(long now) intsize()voidvoidstartWindow(long now) voidvoidstopWindow(long now) toString()
-
Constructor Details
-
SimFrameCapture
public SimFrameCapture()
-
-
Method Details
-
awaitSteadyState
public void awaitSteadyState() -
addDirect
Direct values are simply measured at the end of a frame.- Parameters:
name- measure namesupplier- source of measurementweight- coefficient of weight for this measure
-
addDeltaTime
-
addDeltaTime
-
addDeltaTime
Delta Time values are taken as the differential of the first and last values with respect to time passing.- Parameters:
name-supplier-weight-
-
addRemix
public void addRemix(String name, ToDoubleFunction<BasisValues> remix, double weight, Runnable callback) A remix function takes as its input the computed raw values of the other functions, irrespective of their weights or weighting functions. At the end of a frame, each defined value is computed in the order it was added for capture and then added to the results view, where it can be referenced by subsequent functions. Thus, any remix values must be added after those value on which it depends.- Parameters:
name- The name of the remix valueremix- A function which relies on previously computed raw values.weight- The weight to apply to the samples of this value for the final frame sample value.callback- An optional callback to invoke when the frame starts
-
addRemix
-
history
- Specified by:
historyin interfaceSimFrameResults
-
getValue
public double getValue()- Specified by:
getValuein interfaceSimFrameResults
-
size
public int size()- Specified by:
sizein interfaceSimFrameResults
-
toString
-
startWindow
public void startWindow() -
restartWindow
public void restartWindow() -
restartWindow
public void restartWindow(long now) -
startWindow
public void startWindow(long now) -
stopWindow
public void stopWindow() -
stopWindow
public void stopWindow(long now) -
last
-
addRemix
-
activeSample
-