From 11d97ea65d082cfc1cd01d454b130f2a792316de Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 3 Jan 2024 14:45:31 +0000 Subject: [PATCH] pageserver_api: add a public version of TenantHistorySize --- libs/pageserver_api/src/models.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/pageserver_api/src/models.rs b/libs/pageserver_api/src/models.rs index 83412d4aae..4eb99c49aa 100644 --- a/libs/pageserver_api/src/models.rs +++ b/libs/pageserver_api/src/models.rs @@ -678,6 +678,17 @@ pub struct PagestreamDbSizeResponse { pub db_size: i64, } +// This is a cut-down version of TenantHistorySize from the pageserver crate, omitting fields +// that require pageserver-internal types. It is sufficient to get the total size. +#[derive(Serialize, Deserialize, Debug)] +pub struct TenantHistorySize { + pub id: TenantId, + /// Size is a mixture of WAL and logical size, so the unit is bytes. + /// + /// Will be none if `?inputs_only=true` was given. + pub size: Option, +} + impl PagestreamFeMessage { pub fn serialize(&self) -> Bytes { let mut bytes = BytesMut::new();