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

Buffer Logcat instructions #58

Merged
merged 9 commits into from
Apr 15, 2022
Merged

Buffer Logcat instructions #58

merged 9 commits into from
Apr 15, 2022

Conversation

jmatsu
Copy link
Contributor

@jmatsu jmatsu commented Apr 14, 2022

This changeset serializes the instruction for sending Logcat data to the remove service.

ref: #48

Buffering Overview

We should buffer the instruction for sending one chunk of lines to the remote service but not for starting Logcat process because Logcat is launchable regardless of the client app's availability.

sequenceDiagram
    participant Logcat
    participant Reader (SDK)
    participant Serializer (SDK)
    participant ClientApp

Reader (SDK)->>Logcat: Create a process
Logcat->>Logcat: Generate the bundle id

loop Streaming
    Logcat->>Reader (SDK): Read and pack lines as a chunk
end

    Reader (SDK)-->>Serializer (SDK): Enqueue the send-instruction on every chunk
    Serializer (SDK)->>Serializer (SDK): Serialize and process the instructions
    Serializer (SDK)->>ClientApp: Emit chunks one by one
Loading

In this case, the bundle id is the one-to-one relation with the process id of Logcat.

Retry

Buffering Logcat requires the special retry mechanism that splits larger AIDL transaction into smaller serialized transactions.

Todo

Refactor these redundant code.

@jmatsu jmatsu force-pushed the refactor/logcat_worker branch from 4a650ae to e2924bc Compare April 14, 2022 16:37
@jmatsu jmatsu changed the base branch from master to feat/unique_id April 14, 2022 16:39
@jmatsu jmatsu force-pushed the refactor/logcat_worker branch from bf1c477 to 85e351b Compare April 15, 2022 02:51
fix: missing tid in send logcat request

wip
@jmatsu jmatsu force-pushed the refactor/logcat_worker branch from 85e351b to 1113844 Compare April 15, 2022 03:42
@jmatsu
Copy link
Contributor Author

jmatsu commented Apr 15, 2022

@jmatsu jmatsu requested a review from tnj April 15, 2022 04:01
@jmatsu jmatsu marked this pull request as ready for review April 15, 2022 04:01
Copy link
Member

@tnj tnj left a comment

Choose a reason for hiding this comment

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

Looks great to me! 🚀

Base automatically changed from feat/unique_id to master April 15, 2022 08:02
@jmatsu
Copy link
Contributor Author

jmatsu commented Apr 15, 2022

Thank you so much.

@jmatsu jmatsu merged commit fb0d19f into master Apr 15, 2022
@jmatsu jmatsu deleted the refactor/logcat_worker branch April 15, 2022 08:03
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.

2 participants