Skip to content

Commit b66bca3

Browse files
committed
Updating Profiler to the latest NetBeans profiler features
- updating settings for CPU & Memory profiling - added JDBC profiling
1 parent b700a6e commit b66bca3

22 files changed

+1274
-319
lines changed

visualvm/profiler/manifest.mf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ OpenIDE-Module: com.sun.tools.visualvm.profiler/0
55
OpenIDE-Module-Layer: com/sun/tools/visualvm/profiler/resources/layer.xml
66
OpenIDE-Module-Localizing-Bundle: com/sun/tools/visualvm/profiler/Bundle.properties
77
OpenIDE-Module-Provides: org.netbeans.lib.profiler.common.Profiler
8-
OpenIDE-Module-Specification-Version: 1.5
8+
OpenIDE-Module-Specification-Version: 1.6
99

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
build.xml.data.CRC32=7374b11b
1+
build.xml.data.CRC32=fee5938e
22
build.xml.script.CRC32=03a7511e
33
build.xml.stylesheet.CRC32=[email protected]
44
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
55
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6-
nbproject/build-impl.xml.data.CRC32=7374b11b
6+
nbproject/build-impl.xml.data.CRC32=fee5938e
77
nbproject/build-impl.xml.script.CRC32=6c1a4403
88
nbproject/build-impl.xml.stylesheet.CRC32=[email protected]

visualvm/profiler/nbproject/project.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<compile-dependency/>
4848
<run-dependency>
4949
<release-version>0</release-version>
50-
<specification-version>1.3</specification-version>
50+
<specification-version>1.5</specification-version>
5151
</run-dependency>
5252
</dependency>
5353
<dependency>
@@ -83,7 +83,7 @@
8383
<compile-dependency/>
8484
<run-dependency>
8585
<release-version>1</release-version>
86-
<specification-version>1.140</specification-version>
86+
<specification-version>1.145</specification-version>
8787
</run-dependency>
8888
</dependency>
8989
<dependency>

visualvm/profiler/src/com/sun/tools/visualvm/profiler/ApplicationProfilerView.java

Lines changed: 96 additions & 39 deletions
Large diffs are not rendered by default.

visualvm/profiler/src/com/sun/tools/visualvm/profiler/Bundle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ LBL_Cpu=CPU
7676

7777
LBL_Memory=Memory
7878

79+
LBL_JDBC=JDBC
80+
7981
LBL_Stop=Stop
8082

8183
LBL_Status=Status:
@@ -101,6 +103,8 @@ LBL_Cpu_settings=CPU settings
101103

102104
LBL_Memory_settings=Memory settings
103105

106+
LBL_JDBC_settings=JDBC settings
107+
104108
CAP_Calibrate_java=Calibrate Java
105109
# Please select Java 7 64bit binary:
106110
MSG_Calibration_required_arch=The profiler will calibrate the Java platform to be used for profiling.<br>Please select {0} {1} binary:

visualvm/profiler/src/com/sun/tools/visualvm/profiler/CPULivePanel.java

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,6 @@ private void initUI(Application application) {
162162
// --- Results ---------------------------------------------------------
163163

164164
cpuView = new LiveCPUView(null) {
165-
// protected ProfilerClient getProfilerClient() {
166-
// return MethodsFeatureUI.this.getProfilerClient();
167-
// }
168-
// protected boolean isSampling() {
169-
// return MethodsFeatureUI.this.getProfilerClient().getCurrentInstrType() == ProfilerClient.INSTR_NONE_SAMPLING;
170-
// }
171-
// protected void requestResults() throws ClientUtils.TargetAppOrVMTerminated {
172-
// MethodsFeatureUI.this.getProfilerClient().forceObtainedResultsDump(true);
173-
// }
174-
// protected CPUResultsSnapshot getResults() throws ClientUtils.TargetAppOrVMTerminated, CPUResultsSnapshot.NoDataAvailableException {
175-
// ProfilerClient client = MethodsFeatureUI.this.getProfilerClient();
176-
// return client.getStatus().getInstrMethodClasses() == null ?
177-
// null : client.getCPUProfilingResultsSnapshot(false);
178-
// }
179165
protected boolean showSourceSupported() {
180166
return GoToSource.isAvailable();
181167
}
@@ -236,29 +222,30 @@ protected void foundInReverseCalls() {
236222
protected void fireItemStateChanged(ItemEvent event) {
237223
boolean paused = isSelected();
238224
updater.setPaused(paused);
225+
lrRefreshButton.setEnabled(paused);
239226
if (!paused) try {
240227
updater.setForceRefresh(true);
241228
updater.update();
242229
} catch (ClientUtils.TargetAppOrVMTerminated ex) {
243-
Exceptions.printStackTrace(ex);
230+
cleanup();
244231
}
245232
////// refreshToolbar(getSessionState());
246233
}
247234
};
248235
lrPauseButton.setToolTipText(Bundle.MethodsFeatureUI_pauseResults());
249-
lrPauseButton.setEnabled(false);
250-
236+
251237
lrRefreshButton = new JButton(Icons.getIcon(GeneralIcons.UPDATE_NOW)) {
252238
protected void fireActionPerformed(ActionEvent e) {
253239
try {
254240
updater.setForceRefresh(true);
255241
updater.update();
256242
} catch (ClientUtils.TargetAppOrVMTerminated ex) {
257-
Exceptions.printStackTrace(ex);
243+
cleanup();
258244
}
259245
}
260246
};
261247
lrRefreshButton.setToolTipText(Bundle.MethodsFeatureUI_updateResults());
248+
lrRefreshButton.setEnabled(false);
262249

263250
Icon icon = Icons.getIcon(ProfilerIcons.DELTA_RESULTS);
264251
lrDeltasButton = new JToggleButton(icon) {
@@ -281,7 +268,7 @@ protected void fireActionPerformed(ActionEvent e) {
281268
updater.setForceRefresh(true);
282269
updater.update();
283270
} catch (ClientUtils.TargetAppOrVMTerminated ex) {
284-
Exceptions.printStackTrace(ex);
271+
cleanup();
285272
}
286273
}
287274
};
@@ -301,7 +288,7 @@ protected void fireActionPerformed(ActionEvent e) {
301288
updater.setForceRefresh(true);
302289
updater.update();
303290
} catch (ClientUtils.TargetAppOrVMTerminated ex) {
304-
Exceptions.printStackTrace(ex);
291+
cleanup();
305292
}
306293
}
307294
};
@@ -321,7 +308,7 @@ protected void fireActionPerformed(ActionEvent e) {
321308
updater.setForceRefresh(true);
322309
updater.update();
323310
} catch (ClientUtils.TargetAppOrVMTerminated ex) {
324-
Exceptions.printStackTrace(ex);
311+
cleanup();
325312
}
326313
}
327314
};
@@ -420,11 +407,18 @@ public void run() {
420407

421408

422409
void refreshResults() {
423-
try {
424-
refreshData();
425-
} catch (ClientUtils.TargetAppOrVMTerminated ex) {
426-
cleanup();
427-
}
410+
RESULTS_PROCESSOR.post(new Runnable() {
411+
public void run() {
412+
try {
413+
refreshData();
414+
} catch (ClientUtils.TargetAppOrVMTerminated ex) {
415+
cleanup();
416+
} catch (Throwable t) {
417+
Exceptions.printStackTrace(t);
418+
cleanup();
419+
}
420+
}
421+
});
428422
}
429423

430424
}

0 commit comments

Comments
 (0)