github.com/myafeier/fabric@v1.0.1-0.20170722181825-3a4b1f2bce86/test/regression/daily/ledger_lte.py (about)

     1  # Copyright IBM Corp. All Rights Reserved.
     2  #
     3  # SPDX-License-Identifier: Apache-2.0
     4  #
     5  
     6  import unittest
     7  import subprocess
     8  
     9  tool_directory = '../../tools/LTE/scripts'
    10  
    11  class perf_goleveldb(unittest.TestCase):
    12  
    13      def test_FAB_3790_VaryNumParallelTxPerChain(self):
    14          '''
    15           In this Performance test, we observe the performance (time to
    16           complete a set number of Ledger operations) of the Ledger component,
    17           with goleveldb as the state database. We vary the number of parallel
    18           transactions per chain and observe the performance.
    19  
    20           Passing criteria: Underlying LTE test completed successfully with
    21           exit code 0
    22          '''
    23          logfile = open("output_VaryNumParallelTxPerChain.log", "w")
    24          returncode = subprocess.call(
    25                  "./runbenchmarks.sh -f parameters_daily_CI.sh varyNumParallelTxPerChain",
    26                  shell=True, stderr=subprocess.STDOUT, stdout=logfile,
    27                  cwd=tool_directory)
    28          logfile.close()
    29          self.assertEqual(returncode, 0, msg="VaryNumParallelTxPerChain "
    30                  "performance test failed. \nPlease check the logfile "
    31                  +logfile.name+" for more details.")
    32  
    33      def test_FAB_3795_VaryNumChains(self):
    34          '''
    35           In this Performance test, we observe the performance (time to
    36           complete a set number of Ledger operations) of the Ledger component,
    37           with goleveldb as the state database. We vary the number of chains
    38           (ledgers).
    39  
    40           Passing criteria: Underlying LTE test completed successfully with
    41           exit code 0
    42          '''
    43          logfile = open("output_VaryNumChains.log", "w")
    44          returncode = subprocess.call(
    45                  "./runbenchmarks.sh -f parameters_daily_CI.sh varyNumChains",
    46                  shell=True, stderr=subprocess.STDOUT, stdout=logfile,
    47                  cwd=tool_directory)
    48          logfile.close()
    49          self.assertEqual(returncode, 0, msg="VaryNumChains performance test"
    50                  " failed. \nPlease check the logfile "+logfile.name+" for more "
    51                  "details.")
    52  
    53      def test_FAB_3798_VaryNumParallelTxWithSingleChain(self):
    54          '''
    55           In this Performance test, we observe the performance (time to
    56           complete a set number of Ledger operations) of the Ledger component,
    57           with goleveldb as the state database. We vary the number of parallel
    58           transactions on a single chain.
    59  
    60           Passing criteria: Underlying LTE test completed successfully with
    61           exit code 0
    62          '''
    63          logfile = open("output_VaryNumParallelTxWithSingleChain.log", "w")
    64          returncode = subprocess.call(
    65                  "./runbenchmarks.sh -f parameters_daily_CI.sh varyNumParallelTxWithSingleChain",
    66                  shell=True, stderr=subprocess.STDOUT, stdout=logfile,
    67                  cwd=tool_directory)
    68          logfile.close()
    69          self.assertEqual(returncode, 0, msg="VaryNumParallelTxWithSingleChain "
    70                  "performance test failed. \nPlease check the logfile "
    71                  +logfile.name+" for more details.")
    72  
    73      def test_FAB_3799_VaryNumChainsWithNoParallelism(self):
    74          '''
    75           In this Performance test, we observe the performance (time to
    76           complete a set number of Ledger operations) of the Ledger component,
    77           with goleveldb as the state database. We vary the number of chains
    78           without any parallelism within a single chain.
    79  
    80           Passing criteria: Underlying LTE test completed successfully with
    81           exit code 0
    82          '''
    83          logfile = open("output_VaryNumChainsWithNoParallelism.log", "w")
    84          returncode = subprocess.call(
    85                  "./runbenchmarks.sh -f parameters_daily_CI.sh varyNumChainsWithNoParallelism",
    86                  shell=True, stderr=subprocess.STDOUT, stdout=logfile,
    87                  cwd=tool_directory)
    88          logfile.close()
    89          self.assertEqual(returncode, 0, msg="varyNumChainsWithNoParallelism "
    90                  "performance test failed. \nPlease check the logfile "
    91                  +logfile.name+" for more details.")
    92  
    93      def test_FAB_3801_VaryKVSize(self):
    94          '''
    95           In this Performance test, we observe the performance (time to
    96           complete a set number of Ledger operations) of the Ledger component,
    97           with goleveldb as the state database. We vary the size of key-value.
    98  
    99           Passing criteria: Underlying LTE test completed successfully with
   100           exit code 0
   101          '''
   102          logfile = open("output_VaryKVSize.log", "w")
   103          returncode = subprocess.call(
   104                  "./runbenchmarks.sh -f parameters_daily_CI.sh varyKVSize",
   105                  shell=True, stderr=subprocess.STDOUT, stdout=logfile,
   106                  cwd=tool_directory)
   107          logfile.close()
   108          self.assertEqual(returncode, 0, msg="varyKVSize performance test"
   109                  " failed. \nPlease check the logfile "+logfile.name+" for more "
   110                  "details.")
   111  
   112      def test_FAB_3802_VaryBatchSize(self):
   113          '''
   114           In this Performance test, we observe the performance (time to
   115           complete a set number of Ledger operations) of the Ledger component,
   116           with goleveldb as the state database. We vary the value of the batch
   117           size
   118  
   119           Passing criteria: Underlying LTE test completed successfully with
   120           exit code 0
   121          '''
   122          logfile = open("output_VaryBatchSize.log", "w")
   123          returncode = subprocess.call(
   124                  "./runbenchmarks.sh -f parameters_daily_CI.sh varyBatchSize",
   125                  shell=True, stderr=subprocess.STDOUT, stdout=logfile,
   126                  cwd=tool_directory)
   127          logfile.close()
   128          self.assertEqual(returncode, 0, msg="varyBatchSize performance test"
   129                  " failed. \nPlease check the logfile "+logfile.name+" for more "
   130                  "details.")
   131  
   132      def test_FAB_3800_VaryNumKeysInEachTx(self):
   133          '''
   134           In this Performance test, we observe the performance (time to
   135           complete a set number of Ledger operations) of the Ledger component,
   136           with goleveldb as the state database. We vary the number of keys in
   137           each transaction.
   138  
   139           Passing criteria: Underlying LTE test completed successfully with
   140           exit code 0
   141          '''
   142          logfile = open("output_VaryNumKeysInEachTx.log", "w")
   143          returncode = subprocess.call(
   144                  "./runbenchmarks.sh -f parameters_daily_CI.sh varyNumKeysInEachTx",
   145                  shell=True, stderr=subprocess.STDOUT, stdout=logfile,
   146                  cwd=tool_directory)
   147          logfile.close()
   148          self.assertEqual(returncode, 0, msg="varyNumKeysInEachTx performance "
   149                  "test failed. \nPlease check the logfile "+logfile.name
   150                  +" for more details.")
   151  
   152      def test_FAB_3803_VaryNumTxs(self):
   153          '''
   154           In this Performance test, we observe the performance (time to
   155           complete a set number of Ledger operations) of the Ledger component,
   156           with goleveldb as the state database. We vary the number of
   157           transactions carried out.
   158  
   159           Passing criteria: Underlying LTE test completed successfully with
   160           exit code 0
   161          '''
   162          logfile = open("output_VaryNumTxs.log", "w")
   163          returncode = subprocess.call(
   164                  "./runbenchmarks.sh -f parameters_daily_CI.sh varyNumTxs",
   165                  shell=True, stderr=subprocess.STDOUT, stdout=logfile,
   166                  cwd=tool_directory)
   167          logfile.close()
   168          self.assertEqual(returncode, 0, msg="varyNumTxs performance test"
   169                  " failed. \nPlease check the logfile "+logfile.name+" for more "
   170                  "details.")
   171  
   172  
   173  class perf_couchdb(unittest.TestCase):
   174      @unittest.skip("WIP, skipping")
   175      def test_FAB_3870_VaryNumParallelTxPerChain(self):
   176          '''
   177           In this Performance test, we observe the performance (operations
   178           per second) of the Ledger component, with CouchDB as the state
   179           database, as we vary the number of parallel transactions per chain.
   180          '''
   181          self.assertTrue(True)
   182  
   183      @unittest.skip("WIP, skipping")
   184      def test_FAB_3871_VaryNumChain(self):
   185          '''
   186           In this Performance test, we observe the performance (operations
   187           per second) of the Ledger component, with CouchDB as the state
   188           database, as we vary the number of chains (ledgers).
   189          '''
   190          self.assertTrue(True)
   191  
   192      @unittest.skip("WIP, skipping")
   193      def test_FAB_3872_VaryNumParallelTxWithSingleChain(self):
   194          '''
   195           In this Performance test, we observe the performance (operations
   196           per second) of the Ledger component, with CouchDB as the state
   197           database, vary the number of parallel transactions on a single chain.
   198          '''
   199          self.assertTrue(True)
   200  
   201      @unittest.skip("WIP, skipping")
   202      def test_FAB_3873_VaryNumChainWithNoParallelism(self):
   203          '''
   204           In this Performance test, we observe the performance (operations
   205           per second) of the Ledger component, with CouchDB as the state
   206           database, as we vary the number of chains without any parallelism.
   207           within a single chain.
   208          '''
   209          self.assertTrue(True)
   210  
   211      @unittest.skip("WIP, skipping")
   212      def test_FAB_3874_VaryKVSize(self):
   213          '''
   214           In this Performance test, we observe the performance (operations
   215           per second) of the Ledger component, with CouchDB as the state
   216           database, varying the size of key-value.
   217          '''
   218          self.assertTrue(True)
   219  
   220      @unittest.skip("WIP, skipping")
   221      def test_FAB_3875_VaryBatchSize(self):
   222          '''
   223           In this Performance test, we observe the performance (operations
   224           per second) of the Ledger component, with CouchDB as the state
   225           database, as we vary the value of the batch size.
   226          '''
   227          self.assertTrue(True)
   228  
   229      @unittest.skip("WIP, skipping")
   230      def test_FAB_3876_VaryNumKeysInEachTX(self):
   231          '''
   232           In this Performance test, we observe the performance (operations
   233           per second) of the Ledger component, with CouchDB as the state
   234           database, as we vary the number of keys in each transaction.
   235          '''
   236          self.assertTrue(True)
   237  
   238      @unittest.skip("WIP, skipping")
   239      def test_FAB_3877_VaryNumTxs(self):
   240          '''
   241           In this Performance test, we observe the performance (operations
   242           per second) of the Ledger component, with CouchDB as the state
   243           database, as we vary the number of transactions carried out.
   244          '''
   245          self.assertTrue(True)