Class EnumeratedInts
java.lang.Object
io.nosqlbench.virtdata.library.curves4.discrete.int_int.IntToIntDiscreteCurve
io.nosqlbench.virtdata.library.curves4.discrete.int_int.EnumeratedInts
- All Implemented Interfaces:
IntUnaryOperator
Create a sampler based on enumeration of integer values an sample over them
using the EnumeratedInts distribution curve provided by Apache Commons Math.
This version will roughly produce the distribution, but since it also relies on
interpolation by default, non-step values may appear at low frequencies. If this
is a desired effect, then this function is suitable. For example: consider this
result:
nb5 run driver=stdout op="{{EnumeratedInts('10:10 20:20 30:30 40:40')}}\n" cycles=10000 | sort -n | uniq -c
1 STDOUT0 (pending,current,complete)=(0,0,10000) 100.00% (last report)
1 9
1036 10
2 11
2 13
1 14
3 15
2 16
1 18
1 19
1937 20
1 21
1 23
1 24
1 25
1 28
1 29
3077 30
1 31
1 33
1 34
2 35
1 37
1 39
3924 40
The values here which are not multiples of 10 are not specified, yet the appear. For some testing, this is
helpful as a fuzzer, but for more precise step-value sampling, see
invalid reference
AliasSampler
-
Field Summary
Fields inherited from class io.nosqlbench.virtdata.library.curves4.discrete.int_int.IntToIntDiscreteCurve
COMPUTE, HASH, INTERPOLATE, MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]parseDoubleWeights(String input) static int[]parseIntLabels(String input) Methods inherited from class io.nosqlbench.virtdata.library.curves4.discrete.int_int.IntToIntDiscreteCurve
applyAsIntMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.IntUnaryOperator
andThen, compose
-
Constructor Details
-
EnumeratedInts
-
-
Method Details
-
parseIntLabels
-
parseDoubleWeights
-