Skip to content

Conversation

adrian-kong
Copy link
Contributor

@adrian-kong adrian-kong commented Dec 13, 2022

removes logging thread, send smaller packets of changes,
defers the full state to the frontend.
we can also refactor this into the event receivers that was introduced in instant filter updates etc...

downside is we send whenever we receive a frame meaning it would be dependent on the stream of info - which we can do some batching if this happen (too many updates for frontend gui => laggy ?)

this is also to prepare for another ticket - record empty streams of data

@adrian-kong adrian-kong changed the title prep remove logging thread remove logging thread Dec 13, 2022
@adrian-kong
Copy link
Contributor Author

adrian-kong commented Dec 13, 2022

@john-michaelburke wanted to get some thoughts on these changes,

only broken thing atm with these changes is SBP_JSON does not accurately reflect bytes written (will create another PR in dencode / libsbp to reflect # of bytes sent when using send function in encoders)

These changes aims to allow for more "responsive" update via events rather than waiting thread,
This also removes the need to use threading as well as minimizing capnproto packet size by sending only what is needed and compute the rest in frontend (less resources and cleaner)

Using these changes ...

Screen.Recording.2022-12-13.at.4.16.06.pm.mov

Using main branch ...

Screen.Recording.2022-12-13.at.4.14.51.pm.mov

@adrian-kong adrian-kong changed the title remove logging thread event based recording status [CPP-843] Dec 13, 2022
@john-michaelburke
Copy link
Collaborator

john-michaelburke commented Dec 13, 2022

Definitely not opposed to moving the logic to the frontend/python. There are a few minor details that would get flagged by Stefan I imagine. I believe all of these were covered by the previous implementation (famous last words).
First, I see some wonky behavior if you delete the file or containing folder while it is still recording. Somehow the file size continues to grow but the file does not exist and does not get written to after stopping the recording.
Second, when stopping a recording the file duration/size from the previous recording lingers. Stefan had asked for this to get cleared whenever a recording was stopped.
Screencast from 12-13-2022 09:52:59 AM.webm
Third, (no video for this), if you start a recording from the command line, the dropdown selection does not reflect the type of recording that was requested. For example if you start an SBP log from the cli, the dropdown will show the default SBP_JSON selected. It does properly record the sbp file though so just a minor bug.

@john-michaelburke
Copy link
Collaborator

Also it appears the manual filename selector to select the filename for a recording is broken. I get this error:

qrc:/Constants/utils.js:9: TypeError: Cannot call method 'toString' of undefined

Copy link
Contributor

@silverjam silverjam left a comment

Choose a reason for hiding this comment

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

looks good, but I'll echo @john-michaelburke's concerns/requests

Base automatically changed from adrian/frame to main December 16, 2022 04:26
@silverjam
Copy link
Contributor

Failing code quality checks, what else is remaining for this PR?

@adrian-kong
Copy link
Contributor Author

Failing code quality checks, what else is remaining for this PR?

was working on other tickets this will need to go back into WIP from the received reviews

@adrian-kong adrian-kong marked this pull request as draft December 20, 2022 23:10
* refactoring sbp logger

* refactoring sbp logger

* serialize return bytes

* clippy + output correct data bytes

* More idiomatic

* fmt clippy

* remove stop recording

* fmt

* fix spamming close_sbp

* fmt

* pass and update current index [CPP-852] (#888)

* pass format index as field

* handle only init

* only init once for interactive components

* pylint

* should only reflect counters when sbp is logging

* fmt

* changed to SbpFileLogger

* fix test
@adrian-kong adrian-kong marked this pull request as ready for review January 9, 2023 00:04
@swiftnav-travis
Copy link

Frontend and Release Workflow Started here

@adrian-kong adrian-kong requested a review from silverjam January 9, 2023 01:01
@adrian-kong
Copy link
Contributor Author

all behaviours as mentioned should be resolved now 👍

@adrian-kong adrian-kong requested a review from a team January 12, 2023 02:53
@swiftnav-travis
Copy link

Frontend and Release Workflow Started here

@adrian-kong
Copy link
Contributor Author

will need to merge this in before re-releasing. (addresses some bugs & improvements, test if notarytool works)

@adrian-kong adrian-kong enabled auto-merge (squash) January 16, 2023 00:40
@swiftnav-travis
Copy link

Frontend and Release Workflow Started here

Copy link

@ziwift ziwift left a comment

Choose a reason for hiding this comment

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

lgtm

@adrian-kong adrian-kong merged commit 15f79c7 into main Jan 18, 2023
@adrian-kong adrian-kong deleted the adrian/remove_thread branch January 18, 2023 10:08
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.

5 participants