Hack read traces into NeonCompare

This commit is contained in:
Bojan Serafimov
2022-09-14 14:21:04 -04:00
parent 065adcf75b
commit 8a43dfd573

View File

@@ -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