116 * Adds the elapsed time from the given start time (ns) to the perf counter. 117 */ 118 public void addElapsedTimeFrom(long startTime) { 119 add(System.nanoTime() - startTime); 120 } 121 122 @Override 123 public String toString() { 124 return name + " = " + get(); 125 } 126 127 static class CoreCounters { 128 static final PerfCounter pdt = newPerfCounter("sun.classloader.parentDelegationTime"); 129 static final PerfCounter lc = newPerfCounter("sun.classloader.findClasses"); 130 static final PerfCounter lct = newPerfCounter("sun.classloader.findClassTime"); 131 static final PerfCounter rcbt = newPerfCounter("sun.urlClassLoader.readClassBytesTime"); 132 static final PerfCounter zfc = newPerfCounter("sun.zip.zipFiles"); 133 static final PerfCounter zfot = newPerfCounter("sun.zip.zipFile.openTime"); 134 } 135 136 static class WindowsClientCounters { 137 static final PerfCounter d3dAvailable = newConstantPerfCounter("sun.java2d.d3d.available"); 138 } 139 140 /** 141 * Number of findClass calls 142 */ 143 public static PerfCounter getFindClasses() { 144 return CoreCounters.lc; 145 } 146 147 /** 148 * Time (ns) spent in finding classes that includes 149 * lookup and read class bytes and defineClass 150 */ 151 public static PerfCounter getFindClassTime() { 152 return CoreCounters.lct; 153 } 154 155 /** 156 * Time (ns) spent in finding classes 157 */ 158 public static PerfCounter getReadClassBytesTime() { 159 return CoreCounters.rcbt; 165 */ 166 public static PerfCounter getParentDelegationTime() { 167 return CoreCounters.pdt; 168 } 169 170 /** 171 * Number of zip files opened. 172 */ 173 public static PerfCounter getZipFileCount() { 174 return CoreCounters.zfc; 175 } 176 177 /** 178 * Time (ns) spent in opening the zip files that 179 * includes building the entries hash table 180 */ 181 public static PerfCounter getZipFileOpenTime() { 182 return CoreCounters.zfot; 183 } 184 185 /** 186 * D3D graphic pipeline available 187 */ 188 public static PerfCounter getD3DAvailable() { 189 return WindowsClientCounters.d3dAvailable; 190 } 191 } | 116 * Adds the elapsed time from the given start time (ns) to the perf counter. 117 */ 118 public void addElapsedTimeFrom(long startTime) { 119 add(System.nanoTime() - startTime); 120 } 121 122 @Override 123 public String toString() { 124 return name + " = " + get(); 125 } 126 127 static class CoreCounters { 128 static final PerfCounter pdt = newPerfCounter("sun.classloader.parentDelegationTime"); 129 static final PerfCounter lc = newPerfCounter("sun.classloader.findClasses"); 130 static final PerfCounter lct = newPerfCounter("sun.classloader.findClassTime"); 131 static final PerfCounter rcbt = newPerfCounter("sun.urlClassLoader.readClassBytesTime"); 132 static final PerfCounter zfc = newPerfCounter("sun.zip.zipFiles"); 133 static final PerfCounter zfot = newPerfCounter("sun.zip.zipFile.openTime"); 134 } 135 136 /** 137 * Number of findClass calls 138 */ 139 public static PerfCounter getFindClasses() { 140 return CoreCounters.lc; 141 } 142 143 /** 144 * Time (ns) spent in finding classes that includes 145 * lookup and read class bytes and defineClass 146 */ 147 public static PerfCounter getFindClassTime() { 148 return CoreCounters.lct; 149 } 150 151 /** 152 * Time (ns) spent in finding classes 153 */ 154 public static PerfCounter getReadClassBytesTime() { 155 return CoreCounters.rcbt; 161 */ 162 public static PerfCounter getParentDelegationTime() { 163 return CoreCounters.pdt; 164 } 165 166 /** 167 * Number of zip files opened. 168 */ 169 public static PerfCounter getZipFileCount() { 170 return CoreCounters.zfc; 171 } 172 173 /** 174 * Time (ns) spent in opening the zip files that 175 * includes building the entries hash table 176 */ 177 public static PerfCounter getZipFileOpenTime() { 178 return CoreCounters.zfot; 179 } 180 181 } |