Move parsing to zenbenchmark

This commit is contained in:
Bojan Serafimov
2022-04-14 00:51:10 -04:00
parent 2ca920e4cb
commit 7fc488ff4b
2 changed files with 11 additions and 7 deletions

View File

@@ -245,6 +245,16 @@ class ZenithBenchmarker:
'',
MetricReport.TEST_PARAM)
def record_psbench_result(self, psbench_output):
"""Record results from pageserver benchmarker."""
for line in psbench_output.split("\n"):
tokens = line.split(" ")
report = tokens[0]
name = tokens[1]
value = tokens[2]
unit = tokens[3] if len(tokens) > 3 else ""
self.record(name, value, unit, report=report)
def get_io_writes(self, pageserver) -> int:
"""
Fetch the "cumulative # of bytes written" metric from the pageserver

View File

@@ -42,10 +42,4 @@ def test_get_page(zenith_env_builder: ZenithEnvBuilder,
pscur.execute(f"checkpoint {env.initial_tenant.hex} {timeline} 0")
output = psbench_bin.run(env.initial_tenant.hex, timeline)
for line in output.split("\n"):
tokens = line.split(" ")
report = tokens[0]
name = tokens[1]
value = tokens[2]
unit = tokens[3] if len(tokens) > 3 else ""
zenbenchmark.record(name, value, unit, report=report)
zenbenchmark.record_psbench_result(output)