diff options
author | Mark Wong | 2017-07-18 18:00:24 +0000 |
---|---|---|
committer | Mark Wong | 2017-08-04 04:51:09 +0000 |
commit | c4eb77754d712f06562d08aa3e8d5b8a2a180ff2 (patch) | |
tree | 65feb921fb83325baec795922ffbf179a78eb769 | |
parent | 60284eb4b0755c2a5b6e6559774690dddd369ee3 (diff) |
Fix handling of csv option
-rw-r--r-- | client/benchmarks/pgbench.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/client/benchmarks/pgbench.py b/client/benchmarks/pgbench.py index 2ddcc1b..2fba3c5 100644 --- a/client/benchmarks/pgbench.py +++ b/client/benchmarks/pgbench.py @@ -16,7 +16,7 @@ class PgBench(object): # read-write/read-only tests # TODO allow running 'prepared' mode - def __init__(self, bin_path, dbname, runs=3, duration=60): + def __init__(self, bin_path, dbname, runs=3, duration=60, csv=False): ''' bin_path - path to PostgreSQL binaries (dropdb, createdb, psql commands) @@ -26,11 +26,13 @@ class PgBench(object): ''' self._bin = bin_path + self._csv = csv self._dbname = dbname - self._results = {} self._duration = duration self._runs = runs + self._results = {} + @staticmethod def _configure(cpu_count, ram_mbs): 'derive the configurations to benchmark from CPU count and RAM size' @@ -193,7 +195,7 @@ class PgBench(object): return issues def _run(self, duration, nclients=1, njobs=1, read_only=False, - aggregate=True, csv_queue): + aggregate=True, csv_queue=None): 'run pgbench on the database (either a warmup or actual benchmark run)' args = ['pgbench', '-c', str(nclients), '-j', str(njobs), '-T', @@ -227,7 +229,7 @@ class PgBench(object): r.update({'start': start, 'end': end}) - if csv_queue: + if csv_queue is not None: csv_queue.put([start, end, r['scale'], nclients, njobs, mode, duration, latency, tps]) |