예제 #1
0
    def start(self):
        """
        Initialize, spawn, and start the processes
        """

        # initialize the processes
        p_write = ProcessGroup(name='write_blocks', target=self.write_blocks)

        # start the processes
        p_write.start()
예제 #2
0
    def start(self):
        """
        Initialize, spawn, and start the processes
        """

        # initialize the processes
        p_write = ProcessGroup(name='write_blocks', target=self.write_blocks)

        # start the processes
        p_write.start()
예제 #3
0
def run_load(args):
    bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
    logger.info("Starting %s processes", args.multiprocess)
    stats = logstats.Logstats()
    logstats.thread.start(stats)

    tx_left = None
    if args.count > 0:
        tx_left = int(args.count / args.multiprocess)

    workers = ProcessGroup(concurrency=args.multiprocess, target=_run_load, args=(tx_left, stats.get_child()))
    workers.start()
예제 #4
0
def run_load(args):
    bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
    logger.info('Starting %s processes', args.multiprocess)
    stats = logstats.Logstats()
    logstats.thread.start(stats)

    tx_left = None
    if args.count > 0:
        tx_left = int(args.count / args.multiprocess)

    workers = ProcessGroup(concurrency=args.multiprocess,
                           target=_run_load,
                           args=(tx_left, stats.get_child()))
    workers.start()
예제 #5
0
def test_process_group_instantiates_and_start_processes(mock_process):
    from bigchaindb.util import ProcessGroup

    def noop():
        pass

    concurrency = 10

    pg = ProcessGroup(concurrency=concurrency, group='test_group', target=noop)
    pg.start()

    mock_process.assert_has_calls([call(group='test_group', target=noop,
                                        name=None, args=(), kwargs={},
                                        daemon=None)
                                  for i in range(concurrency)], any_order=True)

    for process in pg.processes:
        process.start.assert_called_with()
예제 #6
0
    def _start(self):
        """
        Initialize, spawn, and start the processes
        """

        # initialize the processes
        p_filter = ProcessGroup(name='filter_transactions', target=self.filter_by_assignee)
        p_validate = ProcessGroup(name='validate_transactions', target=self.validate_transactions)
        p_blocks = ProcessGroup(name='create_blocks', target=self.create_blocks)
        p_write = ProcessGroup(name='write_blocks', target=self.write_blocks)
        p_delete = ProcessGroup(name='delete_transactions', target=self.delete_transactions)

        # start the processes
        p_filter.start()
        p_validate.start()
        p_blocks.start()
        p_write.start()
        p_delete.start()
예제 #7
0
def run_add_backlog(args):
    tx_left = args.num_transactions // mp.cpu_count()
    workers = ProcessGroup(target=create_write_transaction, args=(tx_left,))
    workers.start()
예제 #8
0
    def _start(self):
        """
        Initialize, spawn, and start the processes
        """

        # initialize the processes
        p_filter = ProcessGroup(name='filter_transactions',
                                target=self.filter_by_assignee)
        p_validate = ProcessGroup(name='validate_transactions',
                                  target=self.validate_transactions)
        p_blocks = ProcessGroup(name='create_blocks',
                                target=self.create_blocks)
        p_write = ProcessGroup(name='write_blocks', target=self.write_blocks)
        p_delete = ProcessGroup(name='delete_transactions',
                                target=self.delete_transactions)

        # start the processes
        p_filter.start()
        p_validate.start()
        p_blocks.start()
        p_write.start()
        p_delete.start()