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

Add support for ZGC logging #216

Merged
merged 34 commits into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
81dcfcf
Include GC Phases from ZGC for parsing
Marysunithajoseph Jan 13, 2019
dda185a
Corrected phase name
Marysunithajoseph Jan 14, 2019
9643bd8
Parsing Phases for ZGC
Marysunithajoseph Jan 15, 2019
84205d6
Removed unnecessary print outs
Marysunithajoseph Jan 15, 2019
1a05f67
Added test cases for default and memory matchers
yanqilee Jan 15, 2019
d7e2405
Added tests for gc all logging
yanqilee Jan 15, 2019
66e9c1b
fixed formatting
yanqilee Jan 15, 2019
75f83bb
Fixed a typo
yanqilee Jan 15, 2019
1256031
Seperating GC Causes and its memory info
Marysunithajoseph Jan 16, 2019
238050f
Merge branch 'feature/fullstackZGCintegration' of https://github.com/…
yanqilee Jan 18, 2019
9b7aad5
Gc causes no longer show total sum percentage
yanqilee Jan 21, 2019
8b00e90
Fixed up gc causes model
yanqilee Jan 21, 2019
b3fc7f6
Fixed some formatting
yanqilee Jan 21, 2019
5a9b562
Fixed up comment for build
yanqilee Jan 21, 2019
1f681bd
Fixed maven javadoc plugin failing on jdk 11.0.2
yanqilee Jan 21, 2019
1fdb0a0
initial code refactor
yanqilee Jan 22, 2019
52b4111
refactored addGcEvent
yanqilee Jan 22, 2019
ba10ced
Remove unused imports
yanqilee Jan 22, 2019
03284fc
Fixed Codacy issues
yanqilee Jan 22, 2019
70598e9
No longer alter event parameter in method
yanqilee Jan 22, 2019
2576e5d
Added missed null check on isParseablePhaseEvent
yanqilee Jan 23, 2019
18d4275
Refactored tests and updated method params
yanqilee Jan 23, 2019
8925464
update method naming
yanqilee Jan 23, 2019
d29aa3c
Added percentage assertions to test cases
yanqilee Jan 23, 2019
2cb14fb
Removed ZGC phase parsing rule and commented out warning assertion
yanqilee Mar 1, 2019
75c7f6e
Fixed parentheses variable names
yanqilee Mar 1, 2019
e8ea44e
Removed memory capture and added phases start exclusion
yanqilee Mar 1, 2019
ad1ca4b
Fixed comments and code style
yanqilee Mar 1, 2019
0eb52d4
Added notion of phases in AbstractGcEvent
yanqilee Mar 1, 2019
53355b4
Changed test names to be more general
yanqilee Mar 1, 2019
3ecd294
Added phases to parser, model and UI
yanqilee Mar 4, 2019
ac4f08b
Minor changes for styles, etc
yanqilee Mar 4, 2019
907a3be
Single line import on TestGCEventUJL
yanqilee Mar 4, 2019
4793b3d
Made GCEventUJL private in test class
yanqilee Mar 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@
<links>
<link>http://docs.oracle.com/javase/8/docs/api/</link>
</links>
<source>${jdk.source.version}</source>
Copy link
Owner

Choose a reason for hiding this comment

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

Ah, this fixes the build failure on the develop branch - thank you very much!

</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ public ExtendedType parseTypeWithCause(String typeName) {
typeName = typeName.trim();
ExtendedType extendedType = null;
String lookupTypeName = getLookupTypeName(typeName);

AbstractGCEvent.Type gcType = AbstractGCEvent.Type.lookup(lookupTypeName);
// the gcType may be null because there was a PrintGCCause flag enabled - if so, reparse it with the first paren set stripped
if (gcType == null) {
// try to parse it again with the parens removed
Matcher parenMatcher = parenthesesPattern.matcher(lookupTypeName);
if (parenMatcher.find()) {
gcType = AbstractGCEvent.Type.lookup(parenMatcher.replaceFirst(""));
// try to parse it again with the parents removed
Copy link
Owner

Choose a reason for hiding this comment

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

Is "parents" an established abbrevation for "parenthesis"? If not, I'd prefer the renaming to go to "parenthesisMatcher" to avoid confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I think we got confused too while renaming this, will fix this.

Matcher parentMatcher = parenthesesPattern.matcher(lookupTypeName);
if (parentMatcher.find()) {
gcType = AbstractGCEvent.Type.lookup(parentMatcher.replaceFirst(""));
}
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public abstract class AbstractGCEvent<T extends AbstractGCEvent<T>> implements S
private int preUsed;
/** Used after GC in KB */
private int postUsed;
/** Percentage used before GC */
private int preUsedPercent;
Copy link
Owner

Choose a reason for hiding this comment

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

Is it really worthwhile to store this information? Can't it be calculated, if needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I don't think it's worthwhile to have this, I will remove this.

/** Percentage used after GC */
private int postUsedPercent;
/** Capacity in KB */
private int total;
/** end of gc event (after pause) */
Expand Down Expand Up @@ -209,6 +213,14 @@ public void setPostUsed(int postUsed) {
this.postUsed = postUsed;
}

public void setPreUsedPercent(int preUsedPercent) {
this.preUsedPercent = preUsedPercent;
}

public void setPostUsedPercent(int postUsedPercent) {
this.postUsedPercent = postUsedPercent;
}

public void setTotal(int total) {
this.total = total;
}
Expand All @@ -221,6 +233,14 @@ public int getPostUsed() {
return postUsed;
}

public int getPreUsedPercent() {
return preUsedPercent;
}

public int getPostUsedPercent() {
return postUsedPercent;
}

public int getTotal() {
return total;
}
Expand Down Expand Up @@ -306,6 +326,10 @@ public boolean hasPause() {
|| getExtendedType().getPattern().equals(GcPattern.GC_PAUSE_DURATION);
}

public boolean isCycleStart() {
return Type.UJL_ZGC_GARBAGE_COLLECTION.equals(getExtendedType().getType());
}

public double getPause() {
return pause;
}
Expand Down Expand Up @@ -649,6 +673,20 @@ public String toString() {
public static final Type UJL_SHEN_CONCURRENT_CONC_UPDATE_REFS = new Type("Concurrent update references", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_MEMORY_PAUSE);
public static final Type UJL_SHEN_CONCURRENT_PRECLEANING = new Type("Concurrent precleaning", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_MEMORY_PAUSE);

// unified jvm logging ZGC event types
public static final Type UJL_ZGC_GARBAGE_COLLECTION = new Type("Garbage Collection", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_MEMORY_PERCENTAGE);
public static final Type UJL_ZGC_PAUSE_MARK_START = new Type("Pause Mark Start", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE);
public static final Type UJL_ZGC_PAUSE_MARK_END = new Type("Pause Mark End", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE);
public static final Type UJL_ZGC_PAUSE_RELOCATE_START = new Type("Pause Relocate Start", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE);
public static final Type UJL_ZGC_CONCURRENT_MARK = new Type("Concurrent Mark", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE);
public static final Type UJL_ZGC_CONCURRENT_NONREF = new Type("Concurrent Process Non-Strong References", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE);
public static final Type UJL_ZGC_CONCURRENT_RESET_RELOC_SET = new Type("Concurrent Reset Relocation Set", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE);
public static final Type UJL_ZGC_CONCURRENT_DETATCHED_PAGES = new Type("Concurrent Destroy Detached Pages", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE);
public static final Type UJL_ZGC_CONCURRENT_SELECT_RELOC_SET = new Type("Concurrent Select Relocation Set", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE);
public static final Type UJL_ZGC_CONCURRENT_PREPARE_RELOC_SET = new Type("Concurrent Prepare Relocation Set", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE);
public static final Type UJL_ZGC_CONCURRENT_RELOCATE = new Type("Concurrent Relocate", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE);
public static final Type UJL_ZGC_HEAP_CAPACITY = new Type("Capacity", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_HEAP_MEMORY_PERCENTAGE);

// IBM Types
// TODO: are scavenge always young only??
public static final Type IBM_AF = new Type("af", Generation.YOUNG);
Expand Down Expand Up @@ -689,17 +727,21 @@ public enum GcPattern {
GC_MEMORY_PAUSE,
/** "GC type": "# regions before"-&gt;"# regions after"[("#total regions")] ("total regions" is optional; needs a region size to calculate memory usage)*/
GC_REGION,
/** "Garbage Collection (Reason)" "memory before"("percentage of total")-&gt;"memory after"("percentage of total") */
GC_MEMORY_PERCENTAGE,
/** "Heap memory type" "memory current"("memory percentage") */
GC_HEAP_MEMORY_PERCENTAGE
}

public enum Concurrency { CONCURRENT, SERIAL };
public enum Concurrency { CONCURRENT, SERIAL }

public enum Generation { YOUNG,
TENURED,
/** also used for "metaspace" that is introduced with java 8 */
PERM,
ALL,
/** special value for vm operations that are not collections */
OTHER };
OTHER }

public enum CollectionType {
/** plain GC pause collection garbage */
Expand All @@ -712,5 +754,5 @@ public enum CollectionType {
*/
VM_OPERATION,
/** stop the world pause but used to prepare concurrent collection, might not collect garbage */
CONCURRENCY_HELPER };
CONCURRENCY_HELPER }
}
Loading