108 /**
109 * Adds the given interval to the perf counter.
110 */
111 public void addTime(long interval) {
112 add(interval);
113 }
114
115 /**
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 /**
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 }
|
108 /**
109 * Adds the given interval to the perf counter.
110 */
111 public void addTime(long interval) {
112 add(interval);
113 }
114
115 /**
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 thrownThrowables = newPerfCounter("hotspot.runtime.thrownThrowables");
129 static final PerfCounter pdt = newPerfCounter("sun.classloader.parentDelegationTime");
130 static final PerfCounter lc = newPerfCounter("sun.classloader.findClasses");
131 static final PerfCounter lct = newPerfCounter("sun.classloader.findClassTime");
132 static final PerfCounter rcbt = newPerfCounter("sun.urlClassLoader.readClassBytesTime");
133 static final PerfCounter zfc = newPerfCounter("sun.zip.zipFiles");
134 static final PerfCounter zfot = newPerfCounter("sun.zip.zipFile.openTime");
135 }
136
137 static class WindowsClientCounters {
138 static final PerfCounter d3dAvailable = newConstantPerfCounter("sun.java2d.d3d.available");
139 }
140
141 /**
142 * Number of findClass calls
143 */
144 public static PerfCounter getFindClasses() {
145 return CoreCounters.lc;
146 }
147
148 /**
171 /**
172 * Number of zip files opened.
173 */
174 public static PerfCounter getZipFileCount() {
175 return CoreCounters.zfc;
176 }
177
178 /**
179 * Time (ns) spent in opening the zip files that
180 * includes building the entries hash table
181 */
182 public static PerfCounter getZipFileOpenTime() {
183 return CoreCounters.zfot;
184 }
185
186 /**
187 * D3D graphic pipeline available
188 */
189 public static PerfCounter getD3DAvailable() {
190 return WindowsClientCounters.d3dAvailable;
191 }
192
193 /**
194 * Number of Throwables Thrown
195 */
196 public static PerfCounter getThrownThrowables() {
197 return CoreCounters.thrownThrowables;
198 }
199 }
|