Package org.iq80.leveldb.benchmark
Class DbBenchmark
java.lang.Object
org.iq80.leveldb.benchmark.DbBenchmark
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumprivate static enum(package private) static enumprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate final doubleprivate final Fileprivate DBprivate intprivate final DBFactoryprivate final DbBenchmark.RandomGeneratorprivate intprivate doubleprivate Stringprivate intprivate final intprivate Stringprivate final Randomprivate intprivate longprivate final booleanprivate final intprivate final Integer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidcompact()private static SlicecompressibleString(Random rnd, double compressionRatio, int len) private voidprivate voidprivate voidstatic byte[]formatNumber(long n) private static SlicegenerateRandomSlice(Random random, int length) private voidstatic voidprivate voidopen()(package private) voidprivate voidprivate void(package private) static voidprivate voidreadHot()private voidprivate voidprivate voidprivate voidrun()private voidprivate voidprivate voidprivate voidstart()private voidprivate voidwrite(WriteOptions writeOptions, DbBenchmark.Order order, DbBenchmark.DBState state, int numEntries, int valueSize, int entriesPerBatch)
-
Field Details
-
useExisting
private final boolean useExisting -
writeBufferSize
-
databaseDir
-
compressionRatio
private final double compressionRatio -
startTime
private long startTime -
benchmarks
-
db
-
num
private final int num -
reads
private int reads -
valueSize
private final int valueSize -
heapCounter
private int heapCounter -
lastOpFinish
private double lastOpFinish -
bytes
private long bytes -
message
-
postMessage
-
generator
-
random
-
done
private int done -
nextReport
private int nextReport -
factory
-
-
Constructor Details
-
DbBenchmark
- Throws:
Exception
-
-
Method Details
-
run
- Throws:
IOException
-
printHeader
- Throws:
IOException
-
printWarnings
static void printWarnings() -
printEnvironment
- Throws:
IOException
-
open
- Throws:
IOException
-
start
private void start() -
stop
-
write
private void write(WriteOptions writeOptions, DbBenchmark.Order order, DbBenchmark.DBState state, int numEntries, int valueSize, int entriesPerBatch) throws IOException - Throws:
IOException
-
formatNumber
public static byte[] formatNumber(long n) -
finishedSingleOp
private void finishedSingleOp() -
readSequential
private void readSequential() -
readReverse
private void readReverse() -
readRandom
private void readRandom() -
readHot
private void readHot() -
compact
- Throws:
IOException
-
crc32c
-
acquireLoad
private void acquireLoad() -
snappyCompress
private void snappyCompress() -
snappyUncompressArray
private void snappyUncompressArray() -
snappyUncompressDirectBuffer
private void snappyUncompressDirectBuffer() -
heapProfile
private void heapProfile() -
destroyDb
private void destroyDb() -
printStats
private void printStats() -
main
- Throws:
Exception
-
compressibleString
-
generateRandomSlice
-