Merge branch 'test-template' of github.com:BigchainDB/bigchaindb into test-template

This commit is contained in:
Rodolphe Marques 2016-05-10 16:46:45 +02:00
commit 4dffeb2f55
3 changed files with 13 additions and 11 deletions

View File

@ -14,7 +14,8 @@ def create_write_transaction(tx_left):
b = Bigchain() b = Bigchain()
while tx_left > 0: while tx_left > 0:
# use uuid to prevent duplicate transactions (transactions with the same hash) # use uuid to prevent duplicate transactions (transactions with the same hash)
tx = b.create_transaction(b.me, b.me, None, 'CREATE', payload={'msg': str(uuid.uuid4())}) tx = b.create_transaction(b.me, b.me, None, 'CREATE',
payload={'msg': str(uuid.uuid4())})
tx_signed = b.sign_transaction(tx, b.me_private) tx_signed = b.sign_transaction(tx, b.me_private)
b.write_transaction(tx_signed) b.write_transaction(tx_signed)
tx_left -= 1 tx_left -= 1
@ -26,7 +27,7 @@ def run_add_backlog(args):
workers.start() workers.start()
def run_update_statsd(args): def run_set_statsd_host(args):
with open(expanduser('~') + '/.bigchaindb', 'r') as f: with open(expanduser('~') + '/.bigchaindb', 'r') as f:
conf = json.load(f) conf = json.load(f)
@ -45,9 +46,9 @@ def main():
backlog_parser.add_argument('num_transactions', metavar='num_transactions', type=int, default=0, backlog_parser.add_argument('num_transactions', metavar='num_transactions', type=int, default=0,
help='Number of transactions to add to the backlog') help='Number of transactions to add to the backlog')
# update statsd configuration # set statsd host
statsd_parser = subparsers.add_parser('update-statsd', statsd_parser = subparsers.add_parser('set-statsd-host',
help='Update statsd host') help='Set statsd host')
statsd_parser.add_argument('statsd_host', metavar='statsd_host', default='localhost', statsd_parser.add_argument('statsd_host', metavar='statsd_host', default='localhost',
help='Hostname of the statsd server') help='Hostname of the statsd server')

View File

@ -23,14 +23,14 @@ env.key_filename = 'pem/bigchaindb.pem'
@task @task
@parallel @parallel
def prepare_test(): def put_benchmark_utils():
put('benchmark_utils.py') put('benchmark_utils.py')
@task @task
@parallel @parallel
def update_statsd_conf(statsd_host='localhost'): def set_statsd_host(statsd_host='localhost'):
run('python3 benchmark_utils.py update-statsd {}'.format(statsd_host)) run('python3 benchmark_utils.py set-statsd-host {}'.format(statsd_host))
print('update configuration') print('update configuration')
run('bigchaindb show-config') run('bigchaindb show-config')

View File

@ -6,7 +6,8 @@ Measure how many blocks per second are created on the _bigchain_ with a pre fill
2. Copy `deploy-cluster-aws/hostlist.py` to `benchmarking-tests` 2. Copy `deploy-cluster-aws/hostlist.py` to `benchmarking-tests`
```bash ```bash
fab prepare_test fab put_benchmark_utils
fab update_statsd_conf:<hostname of the statsd server> fab set_statsd_host:<hostname of the statsd server>
fab prepare_backlog:<num txs per node> # wait for process to finish fab prepare_backlog:<num txs per node> # wait for process to finish
fab start_bigchaindb fab start_bigchaindb
```