From 8a43dfd5733551221ee3d25f041e9b9b63e9f230 Mon Sep 17 00:00:00 2001 From: Bojan Serafimov Date: Wed, 14 Sep 2022 14:21:04 -0400 Subject: [PATCH] Hack read traces into NeonCompare --- test_runner/fixtures/compare_fixtures.py | 26 ++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/test_runner/fixtures/compare_fixtures.py b/test_runner/fixtures/compare_fixtures.py index ceeeffc785..ca4786143b 100644 --- a/test_runner/fixtures/compare_fixtures.py +++ b/test_runner/fixtures/compare_fixtures.py @@ -90,10 +90,24 @@ class NeonCompare(PgCompare): self._zenbenchmark = zenbenchmark self._pg_bin = pg_bin + self.tenant, _ = self.env.neon_cli.create_tenant( + conf={ + "trace_read_requests": "true", + } + ) + + # HACK enable request tracing, as an experiment + # NOTE This must be done before the pg starts pagestream + # TODO why does it not work? + # self.env.neon_cli.config_tenant(self.env.initial_tenant, conf={ + # "trace_read_requests": "true", + # }) + # We only use one branch and one timeline - self.env.neon_cli.create_branch(branch_name, "empty") - self._pg = self.env.postgres.create_start(branch_name) - self.timeline = self.pg.safe_psql("SHOW neon.timeline_id")[0][0] + # self.env.neon_cli.create_branch(branch_name, "empty", tenant_id=self.tenant) + # self.timeline = self.pg.safe_psql("SHOW neon.timeline_id")[0][0] + self.timeline = self.env.neon_cli.create_timeline(branch_name, tenant_id=self.tenant) + self._pg = self.env.postgres.create_start(branch_name, "main", self.tenant) # Long-lived cursor, useful for flushing self.psconn = self.env.pageserver.connect() @@ -112,10 +126,10 @@ class NeonCompare(PgCompare): return self._pg_bin def flush(self): - self.pscur.execute(f"do_gc {self.env.initial_tenant} {self.timeline} 0") + self.pscur.execute(f"do_gc {self.tenant} {self.timeline} 0") def compact(self): - self.pscur.execute(f"compact {self.env.initial_tenant} {self.timeline}") + self.pscur.execute(f"compact {self.tenant} {self.timeline}") def report_peak_memory_use(self) -> None: self.zenbenchmark.record( @@ -127,7 +141,7 @@ class NeonCompare(PgCompare): def report_size(self) -> None: timeline_size = self.zenbenchmark.get_timeline_size( - self.env.repo_dir, self.env.initial_tenant, self.timeline + self.env.repo_dir, self.tenant, self.timeline ) self.zenbenchmark.record( "size", timeline_size / (1024 * 1024), "MB", report=MetricReport.LOWER_IS_BETTER