<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def run_benchmark(monitor):
    '''Run the benchmarks
    '''
    url = urlparse(monitor.cfg.test_url)
    name = slugify(url.path) or 'home'
    name = '%s_%d.csv' % (name, monitor.cfg.workers)
    monitor.logger.info('WRITING RESULTS ON "%s"', name)
    total = REQUESTS//monitor.cfg.workers

    with open(name, 'w') as csvfile:
        writer = csv.DictWriter(csvfile, fieldnames=FIELDNAMES)
        writer.writeheader()
        for pool_size in POOL_SIZES:
            size = pool_size//monitor.cfg.workers
            if size*monitor.cfg.workers != pool_size:
                monitor.logger.error('Adjust workes so that pool sizes '
                                     'can be evenly shared across them')
                monitor._loop.stop()

            # WORMUP
            requests = [monitor.send(worker, 'run', wormup, size, total) for
                        worker in monitor.managed_actors]
            yield from wait(requests)

            # BENCHMARK
            requests = [monitor.send(worker, 'run', bench) for
                        worker in monitor.managed_actors]
            results, pending = yield from wait(requests)
            assert not pending, 'Pending requets!'
            results = [r.result() for r in results]

            summary = {'concurrency': pool_size}
            for name in results[0]:
                summary[name] = reduce(add(name), results, 0)
            writer.writerow(summary)

            persec = summary['requests']/summary['time']
            monitor.logger.info('%d concurrency - %d requests - '
                                '%d errors - %.3f seconds - '
                                '%.2f requests/sec',
                                pool_size,
                                summary['requests'],
                                summary['errors'],
                                summary['time'],
                                persec)