Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensors-logging: Find log by day prioritizing those from the last day #919

Conversation

rafaellehmkuhl
Copy link
Member

Telemetry logs are taking a lot of time to be processed, and looking more into it, I realized it is because we are accessing each log file individually and checking if it matches our criteria.

This patch fixes it with a quick and dirty solution: iterating first over the logs from the day of the video and the day before, and only them on the rest of the logs (which would be the case only for videos being recorded for more than 24 horus...).

The best solution would be to index the DB by timestamp, sort it and check the logs starting from the most recent one, with a proper cursor, but it is a more complex solution that I need to study more about, while the one here solves the problem already.

Fix #908

@rafaellehmkuhl rafaellehmkuhl changed the title sensors-logging: Find log by day prioritizing logs from the last day sensors-logging: Find log by day prioritizing those from the last day Apr 29, 2024
Copy link
Contributor

@ArturoManzoli ArturoManzoli left a comment

Choose a reason for hiding this comment

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

Nice solution. Works very well

@ArturoManzoli ArturoManzoli merged commit fa6637f into bluerobotics:master Apr 29, 2024
9 checks passed
@rafaellehmkuhl rafaellehmkuhl deleted the long-time-to-process-telemetry-logs branch April 29, 2024 14:51
@rafaellehmkuhl rafaellehmkuhl linked an issue May 1, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants