57 58 /** 59 * Checks the overall consistency of the results reported by the tool 60 */ 61 @Override 62 public void assertConsistency() { 63 64 assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); 65 66 int YGC = getIntValue("YGC"); 67 float YGCT = getFloatValue("YGCT"); 68 assertThat(YGCT >= 0, "Incorrect time value for YGCT"); 69 if (YGC > 0) { 70 assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0"); 71 } 72 73 float GCT = getFloatValue("GCT"); 74 assertThat(GCT >= 0, "Incorrect time value for GCT"); 75 assertThat(GCT >= YGCT, "GCT < YGCT (total garbage collection time < young generation garbage collection time)"); 76 77 int CGC = getIntValue("CGC"); 78 float CGCT = getFloatValue("CGCT"); 79 assertThat(CGCT >= 0, "Incorrect time value for CGCT"); 80 if (CGC > 0) { 81 assertThat(CGCT > 0, "Number of concurrent GC events is " + CGC + ", but CGCT is 0"); 82 } 83 84 int FGC = getIntValue("FGC"); 85 float FGCT = getFloatValue("FGCT"); 86 assertThat(FGCT >= 0, "Incorrect time value for FGCT"); 87 if (FGC > 0) { 88 assertThat(FGCT > 0, "Number of full GC events is " + FGC + ", but FGCT is 0"); 89 } 90 91 assertThat(GCT >= FGCT, "GCT < YGCT (total garbage collection time < full generation garbage collection time)"); 92 93 assertThat(checkFloatIsSum(GCT, YGCT, CGCT, FGCT), "GCT != (YGCT + CGCT + FGCT) " + "(GCT = " + GCT + ", YGCT = " + YGCT 94 + ", CGCT = " + CGCT + ", FGCT = " + FGCT + ", (YCGT + CGCT + FGCT) = " + (YGCT + CGCT + FGCT) + ")"); 95 } 96 } | 57 58 /** 59 * Checks the overall consistency of the results reported by the tool 60 */ 61 @Override 62 public void assertConsistency() { 63 64 assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); 65 66 int YGC = getIntValue("YGC"); 67 float YGCT = getFloatValue("YGCT"); 68 assertThat(YGCT >= 0, "Incorrect time value for YGCT"); 69 if (YGC > 0) { 70 assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0"); 71 } 72 73 float GCT = getFloatValue("GCT"); 74 assertThat(GCT >= 0, "Incorrect time value for GCT"); 75 assertThat(GCT >= YGCT, "GCT < YGCT (total garbage collection time < young generation garbage collection time)"); 76 77 int CGC = 0; 78 float CGCT = 0.0f; 79 try { 80 CGC = getIntValue("CGC"); 81 } catch (NumberFormatException e) { 82 if (!e.getMessage().equals("Unparseable number: \"-\"")) { 83 throw e; 84 } 85 } 86 if (CGC > 0) { 87 CGCT = getFloatValue("CGCT"); 88 assertThat(CGCT >= 0, "Incorrect time value for CGCT"); 89 assertThat(CGCT > 0, "Number of concurrent GC events is " + CGC + ", but CGCT is 0"); 90 } 91 92 int FGC = getIntValue("FGC"); 93 float FGCT = getFloatValue("FGCT"); 94 assertThat(FGCT >= 0, "Incorrect time value for FGCT"); 95 if (FGC > 0) { 96 assertThat(FGCT > 0, "Number of full GC events is " + FGC + ", but FGCT is 0"); 97 } 98 99 assertThat(GCT >= FGCT, "GCT < YGCT (total garbage collection time < full generation garbage collection time)"); 100 101 assertThat(checkFloatIsSum(GCT, YGCT, CGCT, FGCT), "GCT != (YGCT + CGCT + FGCT) " + "(GCT = " + GCT + ", YGCT = " + YGCT 102 + ", CGCT = " + CGCT + ", FGCT = " + FGCT + ", (YCGT + CGCT + FGCT) = " + (YGCT + CGCT + FGCT) + ")"); 103 } 104 } |