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: Refactor to reduce memory usage and allow individual video subtitles #1637

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rafaellehmkuhl
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl commented Jan 29, 2025

The old pipeline was saving the entire log in memory, which was affecting the application's performance.

With this new approach, there's no more logs in memory. All log points are saved in the local database, and retrieved when the request to generate the log file is made.

I took the opportunity of this refactor to also address the problem of multiple log requesters interfering with each other. Now the system will not stop logging while there's an active log requester.

Fix #1446

The old pipeline was saving the entire log in memory, which was severely affecting the application's performance.

With this new approach, there's no more logs in memory. All log points are saved in the local database, and retrieved when the request to generate the log file is made.

I took the opportunity of this refactor to also address the problem of multiple log requesters interfering with each other. Now the system will not stop logging while there's an active log requester.
@ES-Alexander
Copy link
Contributor

Aware it's potentially out of scope, but would it make sense to include some of the #776 changes here?

That PR never got merged, and I think would likely need some rework to apply to the current codebase, but basic stuff like using loops for the largely repeated content of the subtitle lines seems like a good idea to reduce future maintenance load...

@rafaellehmkuhl
Copy link
Member Author

Aware it's potentially out of scope, but would it make sense to include some of the #776 changes here?

That PR never got merged, and I think would likely need some rework to apply to the current codebase, but basic stuff like using loops for the largely repeated content of the subtitle lines seems like a good idea to reduce future maintenance load...

I think it's out of scope. There were changes on that part of the code after the mentioned PR and they are unrelated to this patch.

Current patch fixes a open bug, while the other is a code improvement (that was actually adding bugs, as commented there).

@rafaellehmkuhl rafaellehmkuhl changed the title sensors-logging: Refactor system so no unnecessary memory is used sensors-logging: Refactor to reduce memory usage and allow individual video subtitles Jan 30, 2025
@ArturoManzoli
Copy link
Contributor

ArturoManzoli commented Jan 31, 2025

Does the branch name, in this case, means something to the PR?

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!

@rafaellehmkuhl
Copy link
Member Author

rafaellehmkuhl commented Jan 31, 2025

Does the branch name, in this case, means something to the PR?

Yes. The way that it is right now, if you have to records running, and stop one of them, all of the sensor logs stop, and you won't have sensors logs for the rest of the second recording.

With this patch, the logs stay running until there are no recordings left.

Can you check if it's working as it should for you as well? This is an important feature, so I don't want to risk breaking it. Same @ES-Alexander.

@ES-Alexander
Copy link
Contributor

Can you check if it's working as it should for you as well? This is an important feature, so I don't want to risk breaking it. Same @ES-Alexander.

I was trying to test, but BlueOS doesn't want to play ball with either of my cameras, so I can't set up two video stream sources to do recordings with (just one with the fake source) :(

I've spent the past hour+ on this, and need to get some sleep, so I think I'll have to leave it for next week unfortunately to try to test it properly :-\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If two recordings are happening and one is stopped, the second will lose it's sensor logs
3 participants