Path: blob/master/test/hotspot/jtreg/serviceability/tmtools/jstat/utils/JstatGcNewResults.java
41159 views
/*1* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* Results of running the JstatGcTool ("jstat -gcnew <pid>")25*26* Output example:27* S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT28* 0.0 2048.0 0.0 1113.5 15 15 1024.0 4096.0 0.0 4 0.22829*30* Output description:31* S0C Current survivor space 0 capacity (KB).32* S1C Current survivor space 1 capacity (KB).33* S0U Survivor space 0 utilization (KB).34* S1U Survivor space 1 utilization (KB).35* TT Tenuring threshold.36* MTT Maximum tenuring threshold.37* DSS Desired survivor size (KB).38* EC Current eden space capacity (KB).39* EU Eden space utilization (KB).40* YGC Number of young generation GC events.41* YGCT Young generation garbage collection time.42*/43package utils;4445import common.ToolResults;4647public class JstatGcNewResults extends JstatResults {4849public JstatGcNewResults(ToolResults rawResults) {50super(rawResults);51}5253/**54* Checks the overall consistency of the results reported by the tool55*/56@Override57public void assertConsistency() {5859assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode());6061float S0C = getFloatValue("S0C");62float S0U = getFloatValue("S0U");6364assertThat(S0U <= S0C, "S0U > S0C (utilization > capacity)");6566float S1C = getFloatValue("S1C");67float S1U = getFloatValue("S1U");6869assertThat(S1U <= S1C, "S1U > S1C (utilization > capacity)");7071float EC = getFloatValue("EC");72float EU = getFloatValue("EU");7374assertThat(EU <= EC, "EU > EC (utilization > capacity)");7576int YGC = getIntValue("YGC");77float YGCT = getFloatValue("YGCT");7879int TT = getIntValue("TT");80int MTT = getIntValue("MTT");81assertThat(TT <= MTT, "TT > MTT (tenuring threshold > maximum tenuring threshold)");82}83}848586