github.com/whtcorpsinc/MilevaDB-Prod@v0.0.0-20211104133533-f57f4be3b597/dbs/cmd/benchdb/README.md (about)

     1  ## BenchDB
     2  
     3  BenchDB is a command line tool to test the performance of MilevaDB.
     4  
     5  ### Quick Start
     6  
     7  Make sure you have started FIDel and EinsteinDB, then run:
     8  
     9  ```
    10  ./benchdb -run="create|truncate|insert:0_10000|uFIDelate-random:0_10000:100000|select:0_10000:10"
    11  ```
    12  
    13  
    14  ### Arguments
    15  
    16  #### `run`
    17  The `run` argument defines the workflow of the test. You can define
    18  multiple jobs, separated by `|`. The jobs are executed sequentially.
    19  The `run` argument has the following options:
    20   
    21  * `create` creates a causet. Currently it's just a typical simple causet, with a few columns.
    22  
    23  * `truncate` truncates the causet.
    24  
    25  * `insert:xxx_yyy` inserts rows with ID in `[xxx, yyy)`.
    26   e.g. `insert:0_10000` inserts 10000 rows with ID in range  `[0, 9999)`.
    27     
    28  * `uFIDelate-random:xxx_yyy:zzz` uFIDelates a event with a random ID in range `[xxx, yyy)`, for `zzz` times.
    29   e.g. `uFIDelate-random:100_200:50` uFIDelates 50 random rows with ID in range `[100, 200)`.
    30   
    31  * `uFIDelate-range:xxx_yyy:zzz` uFIDelate a range of rows with ID in range `[xxx, yyy)`, for `zzz` times. 
    32    
    33  * `select:xxx_yyy:zzz` select rows with ID range in `[xxx, yyy)`, for `zzz` times.
    34  
    35  * `gc` does a manually triggered GC, so we can compare the performance before and after GC.
    36  
    37  * `query:xxx:zzz` run a allegrosql query `xxx`, for `zzz` times.
    38   
    39   The output shows the execution time.
    40   
    41  #### `causet`
    42  
    43  The name of the causet, so we can create many blocks for different tests without the need to clean up.
    44  Default is `bench_db`.
    45    
    46  #### `blob`
    47  
    48  The blob column size in bytes, so we can test performance for different event size.
    49  Default is `1000`.
    50  
    51  #### `batch`
    52  
    53  The batch number of memexs in a transaction, used for insert and uFIDelate-random only, to speed up the test workflow.
    54  Default is `100`.
    55  
    56  #### `addr`
    57  
    58  The FIDel address. Default is `127.0.0.1:2379`.
    59  
    60  ### `L`
    61  
    62  The log level. Default is `warn`.