fixup(#6893): report_size() still used pageserver_created_persistent_* metrics (#6909)

Use the remote_timeline_client metrics instead, they work for layer file
uploads and are reasonable close to what the
`pageserver_created_persistent_*` metrics were.

Should we wait for empty upload queue before calling `report_size()`?

part of https://github.com/neondatabase/neon/issues/6737
This commit is contained in:
Christian Schwarz
2024-02-26 17:28:00 +01:00
committed by GitHub
parent 75baf83fce
commit c4059939e6

View File

@@ -155,12 +155,23 @@ class NeonCompare(PgCompare):
"size", timeline_size / (1024 * 1024), "MB", report=MetricReport.LOWER_IS_BETTER
)
metric_filters = {"tenant_id": str(self.tenant), "timeline_id": str(self.timeline)}
metric_filters = {
"tenant_id": str(self.tenant),
"timeline_id": str(self.timeline),
"file_kind": "layer",
"op_kind": "upload",
}
# use `started` (not `finished`) counters here, because some callers
# don't wait for upload queue to drain
total_files = self.zenbenchmark.get_int_counter_value(
self.env.pageserver, "pageserver_created_persistent_files_total", metric_filters
self.env.pageserver,
"pageserver_remote_timeline_client_calls_started_total",
metric_filters,
)
total_bytes = self.zenbenchmark.get_int_counter_value(
self.env.pageserver, "pageserver_written_persistent_bytes_total", metric_filters
self.env.pageserver,
"pageserver_remote_timeline_client_bytes_started_total",
metric_filters,
)
self.zenbenchmark.record(
"data_uploaded", total_bytes / (1024 * 1024), "MB", report=MetricReport.LOWER_IS_BETTER