Class DbBenchmark

java.lang.Object
org.iq80.leveldb.benchmark.DbBenchmark

public class DbBenchmark extends Object
  • Field Details

    • useExisting

      private final boolean useExisting
    • writeBufferSize

      private final Integer writeBufferSize
    • databaseDir

      private final File databaseDir
    • compressionRatio

      private final double compressionRatio
    • startTime

      private long startTime
    • benchmarks

      private final List<String> benchmarks
    • db

      private DB 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

      private String message
    • postMessage

      private String postMessage
    • generator

      private final DbBenchmark.RandomGenerator generator
    • random

      private final Random random
    • done

      private int done
    • nextReport

      private int nextReport
    • factory

      private final DBFactory factory
  • Constructor Details

  • Method Details

    • run

      private void run() throws IOException
      Throws:
      IOException
    • printHeader

      private void printHeader() throws IOException
      Throws:
      IOException
    • printWarnings

      static void printWarnings()
    • printEnvironment

      void printEnvironment() throws IOException
      Throws:
      IOException
    • open

      private void open() throws IOException
      Throws:
      IOException
    • start

      private void start()
    • stop

      private void stop(String benchmark)
    • 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

      private void compact() throws IOException
      Throws:
      IOException
    • crc32c

      private void crc32c(int blockSize, String message)
    • 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

      public static void main(String[] args) throws Exception
      Throws:
      Exception
    • compressibleString

      private static Slice compressibleString(Random rnd, double compressionRatio, int len)
    • generateRandomSlice

      private static Slice generateRandomSlice(Random random, int length)