Skip to content

Conversation

thisisharsh7
Copy link
Contributor

Summary

Fixes #939

Problem

Previously, when running cocoindex update, stats about processed documents were only printed once a full processing pass completed. For long-running updates, users had no visibility into ongoing progress, making it unclear if the process was still working.

Solution

Implemented continuous stats reporting by spawning a background task.

Example Output

Screenshot 2025-10-20 at 11 14 13 AM

@thisisharsh7
Copy link
Contributor Author

kindly review it and let me know for any changes thanks!

Copy link
Member

@georgeh0 georgeh0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR!

Comment on lines 349 to 356
if delta.has_any_change() {
// Print periodic progress (do NOT merge here, final report_stats will merge)
println!(
"{}.{} ({update_title_owned}): {}",
flow_name, import_op_name, delta
);
last_stats = current_stats;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to always show the latest stats (instead of the delta), and keep overwriting the stats line showing before? For users, they always see the last line showing the current stats.

Did a brief research, and indicatif crate seems good for this purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it wil check and apply the changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen.Recording.2025-10-21.at.6.30.13.PM.mov

is this right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's awesome! Thanks!

Please push your commits.

@thisisharsh7 thisisharsh7 force-pushed the fix/continuous-stats-reporting branch from 9c72aa6 to c002510 Compare October 22, 2025 02:49
@thisisharsh7
Copy link
Contributor Author

please check and lmk for any updates

Copy link
Member

@georgeh0 georgeh0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@georgeh0 georgeh0 merged commit e24d1e8 into cocoindex-io:main Oct 22, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Show processed document stats continuously

2 participants