pagebench: getpage: WIP: when auto-discovering timelines, add ability to limit

This commit is contained in:
Christian Schwarz
2023-12-13 14:05:50 +00:00
parent 14b5b6d72f
commit 7ac6f54ee9

View File

@@ -36,6 +36,8 @@ pub(crate) struct Args {
runtime: Option<humantime::Duration>,
#[clap(long)]
per_target_rate_limit: Option<usize>,
#[clap(long)]
limit_to_first_n_targets: Option<usize>,
targets: Option<Vec<TenantTimelineId>>,
}
@@ -213,23 +215,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 {