mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-17 02:12:56 +00:00
Parameterize workload
This commit is contained in:
@@ -1,12 +1,25 @@
|
||||
from contextlib import closing
|
||||
|
||||
import pytest
|
||||
|
||||
from fixtures.zenith_fixtures import ZenithEnv, PgBin, ZenithEnvBuilder, DEFAULT_BRANCH_NAME, PsbenchBin
|
||||
from fixtures.benchmark_fixture import MetricReport, ZenithBenchmarker
|
||||
|
||||
|
||||
@pytest.mark.slow
|
||||
@pytest.mark.parametrize(
|
||||
"workload",
|
||||
[
|
||||
"hot-page",
|
||||
"pgbench",
|
||||
"pgbench-big",
|
||||
"pgbench-long",
|
||||
])
|
||||
def test_get_page(zenith_env_builder: ZenithEnvBuilder,
|
||||
zenbenchmark: ZenithBenchmarker,
|
||||
pg_bin: PgBin,
|
||||
psbench_bin: PsbenchBin):
|
||||
psbench_bin: PsbenchBin,
|
||||
workload: str):
|
||||
zenith_env_builder.pageserver_config_override = "emit_wal_metadata=true"
|
||||
env = zenith_env_builder.init_start()
|
||||
|
||||
@@ -21,10 +34,7 @@ def test_get_page(zenith_env_builder: ZenithEnvBuilder,
|
||||
|
||||
with closing(pg.connect()) as conn:
|
||||
with conn.cursor() as cur:
|
||||
workload = "pgbench"
|
||||
|
||||
print(f"Running workload {workload}")
|
||||
if workload == "hot page":
|
||||
if workload == "hot-page":
|
||||
cur.execute('create table t (i integer);')
|
||||
cur.execute('insert into t values (0);')
|
||||
for i in range(100000):
|
||||
@@ -32,10 +42,10 @@ def test_get_page(zenith_env_builder: ZenithEnvBuilder,
|
||||
elif workload == "pgbench":
|
||||
pg_bin.run_capture(['pgbench', '-s5', '-i', pg.connstr()])
|
||||
pg_bin.run_capture(['pgbench', '-c1', '-t5000', pg.connstr()])
|
||||
elif workload == "pgbench big":
|
||||
elif workload == "pgbench-big":
|
||||
pg_bin.run_capture(['pgbench', '-s100', '-i', pg.connstr()])
|
||||
pg_bin.run_capture(['pgbench', '-c1', '-t100000', pg.connstr()])
|
||||
elif workload == "pgbench long":
|
||||
elif workload == "pgbench-long":
|
||||
pg_bin.run_capture(['pgbench', '-s100', '-i', pg.connstr()])
|
||||
pg_bin.run_capture(['pgbench', '-c1', '-t1000000', pg.connstr()])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user