From 78aa2fae9f4705667f50e4df3af634c1fa05627e Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Wed, 13 Dec 2023 14:05:50 +0000 Subject: [PATCH] pagebench: getpage: WIP: when auto-discovering timelines, add ability to limit --- pageserver/pagebench/src/getpage_latest_lsn.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pageserver/pagebench/src/getpage_latest_lsn.rs b/pageserver/pagebench/src/getpage_latest_lsn.rs index 0aee0599f3..6cea13323d 100644 --- a/pageserver/pagebench/src/getpage_latest_lsn.rs +++ b/pageserver/pagebench/src/getpage_latest_lsn.rs @@ -37,6 +37,8 @@ pub(crate) struct Args { runtime: Option, #[clap(long)] per_target_rate_limit: Option, + #[clap(long)] + limit_to_first_n_targets: Option, targets: Option>, } @@ -218,23 +220,26 @@ async fn main_impl( async move { ( tenant_id, - mgmt_api_client.list_timelines(tenant_id).await.unwrap(), + mgmt_api_client.tenant_details(tenant_id).await.unwrap(), ) } }); } while let Some(res) = js.join_next().await { - let (tenant_id, tl_infos) = res.unwrap(); - for tl in tl_infos { + let (tenant_id, details) = res.unwrap(); + for timeline_id in details.timelines { timelines.push(TenantTimelineId { tenant_id, - timeline_id: tl.timeline_id, + timeline_id, }); } } } info!("timelines:\n{:?}", timelines); + info!("number of timelines:\n{:?}", timelines.len()); + + let mut js = JoinSet::new(); for timeline in &timelines {