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

Introduce an iter_log method to iterate through logs of a same file #15

Merged
merged 3 commits into from
Aug 10, 2024

Conversation

mrguiman
Copy link
Contributor

Responding to the previously created issue #14, here's a first proposition.

We had to test this on our own sysdiags since we do not have yours available, so it'll need more testing on your end, but we noticed an improvement in peak memory usage from ~970mb to ~600mb when parsing the logs.

There's still improvements to be made of course, we introduced an iterator on the surface but it could potentially be iterators all the way down, however the changes required would be substantial.

Here you'll notice that we moved most of the logic from build_log to a new LogIterator structure that itself is used by build_log.
We didn't address the fact that all data is first loaded as a UnifiedLogData, which in our opinion constitutes most of the remainder of the memory usage, since we don't know if that is even possible at that point.

Let me know what you think !

Copy link

google-cla bot commented Apr 30, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jrouaix
Copy link
Contributor

jrouaix commented Apr 30, 2024

ho wow ! it's hell complicated to sign the CLA !

@mrguiman mrguiman force-pushed the log_iterator_v1 branch 2 times, most recently from 67e14da to deab1a7 Compare April 30, 2024 10:44
@jrouaix
Copy link
Contributor

jrouaix commented Aug 6, 2024

@puffyCid you think you can merge this PR ?

@puffyCid
Copy link
Collaborator

puffyCid commented Aug 6, 2024

hi @jrouaix I tested the changes, all the tests passed. However, there are a few conflicts between this PR/branch and main. Could you update the PR to sync with the latest changes?
thanks!

mrguiman and others added 3 commits August 7, 2024 10:34
the LogIterator struct iterates through catalog data
the build_log method now uses LogIterator to consolidate every log into a vector
@jrouaix
Copy link
Contributor

jrouaix commented Aug 7, 2024

updated & ready to merge @puffyCid

@puffyCid puffyCid merged commit 39c8b8b into mandiant:main Aug 10, 2024
1 check passed
@mrguiman mrguiman deleted the log_iterator_v1 branch August 11, 2024 04:22
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.

3 participants