github.com/tenywen/fabric@v1.0.0-beta.0.20170620030522-a5b1ed380643/test/tools/LTE/README.md (about) 1 # Ledger Traffic Engine 2 3 This readme explains the working and the usage of Ledger Traffic Engine (LTE 4 test tool. 5 6 7 - What is the LTE Test Tool 8 - How to Run the Tests 9 - Where to View the Results 10 11 ## What is the LTE Test Tool 12 13 The LTE test tool is test harness that engages the Ledger APIs and benchmarks 14 the performance of the Ledger component. It contains the framework for creating 15 and managing chains, for transaction submission, block creation, and block 16 commit. It conducts benchmark tests for insert and read-write transactions 17 (transactions per second) and contains scripts for launching the benchmarks. An 18 insert benchmark followed by a readwrite benchmark on the same dataset is 19 considered to constitute a single test-run. 20 21 22 ## How to Run The tests 23 24 To run all the available tests with default parameters, run: 25 ``` 26 cd fabric/test/tools/LTE/scripts 27 ./runbenchmark.sh all 28 ``` 29 you can run individual tests without running all the available tests by giving 30 the name of the test as parameter, instead of `all`. You can get the available 31 test names by: 32 ``` 33 ./runbenchmark.sh help 34 ``` 35 36 ### What the Tests Do 37 38 Each test reads test parameters from the file `parameters_daily_CI.sh` and 39 conducts several test-runs by varying one or two of the parameters. The 40 parameters are: 41 * number of chains (ledger), 42 * number of parallel transactions in each chain, 43 * number of Key-value pairs, 44 * number of transactions, 45 * number of keys in each transaction, 46 * size of batch for ledger, 47 * size of Key-value 48 49 For example, the *varyNumChains* test reads the parameters and varies the 50 number of chains for each test-run while keeping the other parameters constant, 51 and generate result. Varying a specific parameter for each test-runs gives 52 insight into the parameter's influence on the Ledger performance. 53 54 Each test-run consists of two phases: benchmarking of ledger insert phase and 55 benchmarking of ledger read-write phase. 56 57 #### Insert Phase 58 59 The insert benchmark starts fresh chains and inserts the Key-values by 60 simulating writes-only transactions For each of the chains. It launches the 61 parallel clients (based on the configuration) and the clients simulate and 62 commit write-only transactions. The keys are divided among clients such that 63 one key is written only once and all the keys are inserted. For instance, if 64 this benchmark is invoked with the following parameters: 65 ``` 66 Number of chains=2, 67 Number of parallel transactions per chain=2, 68 Number of key-value pairs=100 69 ``` 70 then client_1 on chain_1 will insert Key_1 to key_25 and client_2 on chain_1 will 71 insert Key_26 to key_50. Similarly client_3 on chain_2 will insert Key_1 to 72 key_25 and client_4 on chain_2 will insert Key_26 to key_50 where, client_1 and 73 client_2 run in parallel on chain_1 and client_3 and client_4 run in parallel 74 on chain_2. 75 76 #### Read-write Phase 77 78 Subsequently, the Read-write benchmark step opens the existing chains and 79 modifies the Key-values by simulating read-write transactions For each of the 80 chains. It launches the parallel clients (based on the configuration) and the 81 clients simulate and commit read-write transactions. This test assumes the 82 pre-populated chain by previously running insert benchmark step (described 83 above). Each transaction simulated by this benchmark randomly selects a 84 configurable number of keys and modifies their values. For instance, if this 85 benchmark is invoked with the following test parameters: 86 ``` 87 Number of chains=2, 88 Number of parallel transactions per chain=2, 89 Number of key-value pairs=100, 90 Number of total transactions=200 91 ``` 92 then client_1, and client_2 both execute 50 transactions on 93 chain_1 in parallel. Similarly, client_3, and client_4 both execute 50 94 transactions on chain_2 in parallel In each of the transactions executed by any 95 client, the transaction expects and modifies any key(s) between Key_1 to key_50 96 (because, total keys are to be 100 across two chains). 97 98 ## How to View the Test Results 99 100 The test results can be viewed as in the stdout where it shows how long each 101 single operation took to complete in a test. These results are also saved in a 102 .csv file in the following directory: `/tmp/fabric/test/tools/LTE/results`