mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-19 14:10:37 +00:00
Add multiple clients
This commit is contained in:
@@ -232,7 +232,7 @@ class ZenithBenchmarker:
|
||||
'',
|
||||
MetricReport.TEST_PARAM)
|
||||
|
||||
def record_psbench_result(self, psbench_output):
|
||||
def record_psbench_result(self, prefix, psbench_output):
|
||||
"""Record results from pageserver benchmarker."""
|
||||
for line in psbench_output.split("\n"):
|
||||
tokens = line.split(" ")
|
||||
@@ -240,7 +240,7 @@ class ZenithBenchmarker:
|
||||
name = tokens[1]
|
||||
value = tokens[2]
|
||||
unit = tokens[3] if len(tokens) > 3 else ""
|
||||
self.record(name, value, unit, report=report)
|
||||
self.record(f"{prefix}_{name}", value, unit, report=report)
|
||||
|
||||
def get_io_writes(self, pageserver) -> int:
|
||||
"""
|
||||
|
||||
@@ -1271,13 +1271,15 @@ class PsbenchBin:
|
||||
"""A helper class for running the pageserver benchmarker tool."""
|
||||
wal_metadata_path: str
|
||||
|
||||
def test_latest_pages(self, tenant_hex: str, timeline: str) -> str:
|
||||
def test_latest_pages(self, tenant_hex: str, timeline: str, num_clients=None) -> str:
|
||||
num_clients = num_clients or 1
|
||||
psbench_binpath = os.path.join(str(zenith_binpath), 'psbench')
|
||||
args = [
|
||||
psbench_binpath,
|
||||
self.wal_metadata_path,
|
||||
tenant_hex,
|
||||
timeline,
|
||||
f"--num-clients={num_clients}",
|
||||
"get-latest-pages",
|
||||
]
|
||||
return subprocess.run(args, capture_output=True).stdout.decode("UTF-8").strip()
|
||||
|
||||
@@ -50,5 +50,8 @@ def test_get_page(zenith_env_builder: ZenithEnvBuilder,
|
||||
|
||||
pscur.execute(f"checkpoint {env.initial_tenant.hex} {timeline} 0")
|
||||
|
||||
output = psbench_bin.test_latest_pages(env.initial_tenant.hex, timeline)
|
||||
zenbenchmark.record_psbench_result(output)
|
||||
output = psbench_bin.test_latest_pages(env.initial_tenant.hex, timeline, num_clients=1)
|
||||
zenbenchmark.record_psbench_result("1_client", output)
|
||||
|
||||
output = psbench_bin.test_latest_pages(env.initial_tenant.hex, timeline, num_clients=8)
|
||||
zenbenchmark.record_psbench_result("8_clients", output)
|
||||
|
||||
Reference in New Issue
Block a user