fix: pipeline stats API now shows VLM summary progress

- Added trace_profiles query to compute vlm_done/vlm_total
- vlm_summary stage now shows actual progress (e.g. 312/4829)
- Status shows 'running' while in progress, 'completed' when done
This commit is contained in:
Accusys
2026-08-24 19:40:00 +08:00
parent 9f12e835b8
commit b2378a219b
+32
View File
@@ -1303,6 +1303,38 @@ async fn get_pipeline_progress_handler(
);
}
// Check VLM summary progress from trace_profiles
let tp_table = schema::table_name("trace_profiles");
let vlm_total: i64 = sqlx::query_scalar::<_, i64>(&format!(
"SELECT COUNT(*) FROM {tp_table} WHERE file_uuid = $1"
))
.bind(&file_uuid)
.fetch_one(pool)
.await
.unwrap_or(0);
let vlm_done: i64 = sqlx::query_scalar::<_, i64>(&format!(
"SELECT COUNT(*) FROM {tp_table} WHERE file_uuid = $1 AND vlm_description IS NOT NULL AND vlm_description != ''"
))
.bind(&file_uuid)
.fetch_one(pool)
.await
.unwrap_or(0);
if vlm_total > 0 {
let vlm_progress = if vlm_done > 0 {
vlm_done as f64 / vlm_total as f64
} else {
0.0
};
let status = if vlm_done == vlm_total { "completed" } else { "running" };
pp.update_stage(
"vlm_summary",
vlm_progress,
status,
Some(format!("{}/{}", vlm_done, vlm_total)),
);
}
// Check face dedup from actual face_cluster.json content
if processors_done && tkg_node_count > 0 {
let output_dir = crate::core::config::OUTPUT_DIR.as_str();