mirror of
https://github.com/maplibre/martin.git
synced 2024-12-19 04:41:46 +03:00
Better bounds debugging (#1180)
Add debug logging for bounds -- seems like this has been a big point of contention / slow startups
This commit is contained in:
parent
0f3cfaa1af
commit
8aa3dce8cf
@ -115,11 +115,17 @@ pub async fn table_to_query(
|
||||
if info.bounds.is_none() {
|
||||
match bounds_type {
|
||||
BoundsCalcType::Skip => {}
|
||||
BoundsCalcType::Quick | BoundsCalcType::Calc => {
|
||||
BoundsCalcType::Calc => {
|
||||
debug!("Computing {} table bounds for {id}", info.format_id());
|
||||
info.bounds = calc_bounds(&pool, &schema, &table, &geometry_column, srid).await?;
|
||||
}
|
||||
BoundsCalcType::Quick => {
|
||||
debug!(
|
||||
"Computing {} table bounds with {}s timeout for {id}",
|
||||
info.format_id(),
|
||||
DEFAULT_BOUNDS_TIMEOUT.as_secs()
|
||||
);
|
||||
let bounds = calc_bounds(&pool, &schema, &table, &geometry_column, srid);
|
||||
if bounds_type == BoundsCalcType::Calc {
|
||||
info.bounds = bounds.await?;
|
||||
} else {
|
||||
pin_mut!(bounds);
|
||||
if let Ok(bounds) = timeout(DEFAULT_BOUNDS_TIMEOUT, &mut bounds).await {
|
||||
info.bounds = bounds?;
|
||||
@ -131,6 +137,12 @@ pub async fn table_to_query(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(bounds) = info.bounds {
|
||||
debug!(
|
||||
"The computed bounds for {id} from {} are {bounds}",
|
||||
info.format_id()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user