-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#22] Implemented simple CMS gc logs parser #23
Conversation
private static final Logger logger = LoggerFactory.getLogger(CmsLogParser.class); | ||
|
||
private int currentThread; | ||
private Map<Integer, String> threadToIncompleteLine = new LinkedHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why you choose LinkedHashMap for this data-structure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No special reason. I would change it HashMap.
assertEquals(sys, event.getSysTime(), 0.0001); | ||
assertEquals(real, event.getRealTime(), 0.0001); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I have changed parsing implementation to PEG. All tests passed. |
github가 아직 익숙치 않은데 이제는 commit 첫번째꺼는 리뷰하지 않아도 되는 건가요? |
} | ||
|
||
@Test | ||
public void testParseFullGc() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사용자가 실행한 System.gc()는 FullGCSystem이라고 하죠. testParseFullGCSystem이라고 이름을 바꾸면 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@habals |
final String log = "<writer thread='11779'/>\n" | ||
+ "126.743: [GC (Allocation Failure) 126.743: [ParNew: 30719K->30719K(30720K), 0.0000574 secs]126.743: [CMS" | ||
+ ": 66466K->45817K(68288K), 0.2277434 secs] 97186K->45817K(99008K), [Metaspace: 60953K->60953K(1105920K)], 0.2280550 secs] [Times: user=0.23 sys=0.00, real=0.22 secs]\n" | ||
+ "127.029: [Full GC 127.029: [CMS: 49837K->38462K(68288K), 0.1817762 secs] 65053K->38462K(99008K), [Metaspace: 60946K->60946K(1105920K)], 0.1819922 secs] [Times: user=0.18 sys=0.00, real=0.18 secs]";; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two semicolons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. Thanks!
LGTM. |
👍 |
parboiled is PEG (Parsing Expression Grammar) implementation. PEG is more concise than regex, and regex could not handle recursive structure well. GcEventNode is added to access the parsed data easily. Its concrete class is generated by Auto Value library which utilizes annotation processing. IDE setup is required and the instruction can be found here: google/auto#106
@JeOhLee |
@ducky-hong This PR is vanished!! Is this Github Bug????? 😱 |
This is the simple CMS gc logs parser. It parses Full GC, CMS Initial Mark, CMS Final Remark, ParNew (Minor GC), ParNew -> Full GC. It does not support CMS-concurrent things yet.
Also changed gc_model.proto (user, sys, real type changed from float to double) by @JeOhLee 's request.