-
Notifications
You must be signed in to change notification settings - Fork 978
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
Fix for negative promotion calculation #237
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,4 +180,32 @@ public void testPauseYoungConcurrentStartMetadataGcThreshold() throws Exception | |
assertThat("event type", model.get(0).getExtendedType().getType(), is(Type.UJL_PAUSE_YOUNG)); | ||
assertThat("total heap", model.get(0).getTotal(), is(256 * 1024)); | ||
} | ||
|
||
@Test | ||
public void testPauseNoPromotion() throws IOException { | ||
TestLogHandler handler = new TestLogHandler(); | ||
handler.setLevel(Level.WARNING); | ||
GCResource gcResource = new GcResourceFile("byteArray"); | ||
gcResource.getLogger().addHandler(handler); | ||
InputStream in = new ByteArrayInputStream( | ||
("[12.029s][info][gc,start ] GC(9) Pause Young (Normal) (G1 Evacuation Pause)\n" + | ||
"[12.029s][info][gc,task ] GC(9) Using 8 workers of 8 for evacuation\n" + | ||
"[12.034s][info][gc,phases ] GC(9) Pre Evacuate Collection Set: 0.0ms\n" + | ||
"[12.034s][info][gc,phases ] GC(9) Evacuate Collection Set: 4.4ms\n" + | ||
"[12.034s][info][gc,phases ] GC(9) Post Evacuate Collection Set: 0.5ms\n" + | ||
"[12.034s][info][gc,phases ] GC(9) Other: 0.2ms\n" + | ||
"[12.034s][info][gc,heap ] GC(9) Eden regions: 143->0(142)\n" + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think your test data is not correct. At least the parser does not read it correctly. If you add following lines top your test you will see that pre used of young is 0 but should be 143M.
Your example would not produce the desired error if parsed correctly:
Edit: The formats are the same. The test does still not correctly parse the entry. Maybe it is missing some header like |
||
"[12.034s][info][gc,heap ] GC(9) Survivor regions: 10->11(20)\n" + | ||
"[12.034s][info][gc,heap ] GC(9) Old regions: 8->8\n" + | ||
"[12.034s][info][gc,heap ] GC(9) Humongous regions: 2->2\n" + | ||
"[12.034s][info][gc,metaspace ] GC(9) Metaspace: 40737K->40737K(1085440K)\n" + | ||
"[12.034s][info][gc ] GC(9) Pause Young (Normal) (G1 Evacuation Pause) 162M->19M(256M) 5.351ms\n" + | ||
"[12.034s][info][gc,cpu ] GC(9) User=0.00s Sys=0.00s Real=0.01s") | ||
.getBytes()); | ||
|
||
DataReader reader = new DataReaderUnifiedJvmLogging(gcResource, in); | ||
GCModel model = reader.read(); | ||
|
||
assertThat("promotion", model.getPromotion().getSum(), is(0L)); | ||
} | ||
} |
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.
This will probably only hide the error and still not produce correct promotion numbers.