Skip to content

Commit 9e33ba2

Browse files
author
Tim Middleton
committed
Minor udpates after testing
1 parent c5a9228 commit 9e33ba2

File tree

7 files changed

+54
-75
lines changed

7 files changed

+54
-75
lines changed
142 KB
Loading

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/CoherenceOptionsPanel.java

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444

4545
import org.openide.awt.Mnemonics;
4646

47+
import static com.oracle.coherence.plugin.visualvm.Localization.*;
48+
4749

4850
/**
4951
* A controller for Coherence options.
@@ -89,7 +91,6 @@ void load()
8991
m_disableMBeanCheck.setSelected(preferences.isMBeanCheckDisabled());
9092
m_restRequestTimout.setValue(preferences.getRestTimeout());
9193
m_enableRestDebug.setSelected(preferences.isRestDebugEnabled());
92-
m_enableHeatMap.setSelected(preferences.isHeatMapEnabled());
9394
m_enableZoom.setSelected(preferences.isZoomEnabled());
9495
m_enablePersistenceList.setSelected(preferences.isPersistenceListEnabled());
9596
m_enableClusterSnapshot.setSelected(preferences.isClusterSnapshotEnabled());
@@ -107,7 +108,6 @@ void store()
107108
preferences.setDisableMbeanCheck(m_disableMBeanCheck.isSelected());
108109
preferences.setRestDebugEnabled(m_enableRestDebug.isSelected());
109110
preferences.setRestTimeout((Integer) m_restRequestTimout.getValue());
110-
preferences.setHeatMapEnabled(m_enableHeatMap.isSelected());
111111
preferences.setZoomEnabled(m_enableZoom.isSelected());
112112
preferences.setPersistenceListEnabled(m_enablePersistenceList.isSelected());
113113
preferences.setClusterSnapshotEnabled(m_enableClusterSnapshot.isSelected());
@@ -145,7 +145,7 @@ private void initComponents()
145145

146146
// ---- Refresh Time Label ----
147147
JLabel plottersLabel = new JLabel();
148-
Mnemonics.setLocalizedText(plottersLabel, Localization.getLocalText("LBL_refresh_time"));
148+
Mnemonics.setLocalizedText(plottersLabel, getLocalText("LBL_refresh_time"));
149149
c = new GridBagConstraints();
150150
c.gridx = 0;
151151
c.gridy = 1;
@@ -155,6 +155,7 @@ private void initComponents()
155155

156156
// refresh time
157157
m_refreshTime = new JSpinner();
158+
m_refreshTime.setToolTipText(getLocalText("TTIP_refresh_time"));
158159
plottersLabel.setLabelFor(m_refreshTime);
159160
m_refreshTime.setModel(new SpinnerNumberModel(30, 5, 99999, 1));
160161
c = new GridBagConstraints();
@@ -166,7 +167,7 @@ private void initComponents()
166167

167168
// plottersUnits
168169
JLabel plottersUnits = new JLabel();
169-
Mnemonics.setLocalizedText(plottersUnits, Localization.getLocalText("LBL_seconds")); // NOI18N
170+
Mnemonics.setLocalizedText(plottersUnits, getLocalText("LBL_seconds")); // NOI18N
170171
c = new GridBagConstraints();
171172
c.gridx = 2;
172173
c.gridy = 1;
@@ -175,17 +176,19 @@ private void initComponents()
175176
add(plottersUnits, c);
176177

177178
m_logQueryTimes = new JCheckBox();
179+
m_logQueryTimes.setToolTipText(getLocalText("TTIP_log_query_times"));
178180
addCheckBox(2, "LBL_log_query_times", m_logQueryTimes);
179181

180182
m_disableMBeanCheck = new JCheckBox();
183+
m_disableMBeanCheck.setToolTipText(getLocalText("TTIP_disable_mbean_check"));
181184
addCheckBox(3, "LBL_disable_mbean_check", m_disableMBeanCheck);
182185

183186
// ---- REST ----
184187
addHeader(4, "LBL_rest");
185188

186189
// ---- REST Request Timeout ----
187190
JLabel lblRest = new JLabel();
188-
Mnemonics.setLocalizedText(lblRest, Localization.getLocalText("LBL_rest_request_timeout"));
191+
Mnemonics.setLocalizedText(lblRest, getLocalText("LBL_rest_request_timeout"));
189192
c = new GridBagConstraints();
190193
c.gridx = 0;
191194
c.gridy = 5;
@@ -194,6 +197,7 @@ private void initComponents()
194197
add(lblRest, c);
195198

196199
m_restRequestTimout = new JSpinner();
200+
m_restRequestTimout.setToolTipText(getLocalText("TTIP_rest_request_timeout"));
197201
lblRest.setLabelFor(m_restRequestTimout);
198202
m_restRequestTimout.setModel(new SpinnerNumberModel(30000, 1000, 99999999, 1000));
199203
c = new GridBagConstraints();
@@ -204,7 +208,7 @@ private void initComponents()
204208
add(m_restRequestTimout, c);
205209

206210
JLabel requestUnits = new JLabel();
207-
Mnemonics.setLocalizedText(requestUnits, Localization.getLocalText("LBL_millis")); // NOI18N
211+
Mnemonics.setLocalizedText(requestUnits, getLocalText("LBL_millis")); // NOI18N
208212
c = new GridBagConstraints();
209213
c.gridx = 2;
210214
c.gridy = 5;
@@ -213,30 +217,32 @@ private void initComponents()
213217
add(requestUnits, c);
214218

215219
m_enableRestDebug = new JCheckBox();
220+
m_enableRestDebug.setToolTipText(getLocalText("TTIP_rest_debug"));
216221
addCheckBox(6, "LBL_enable_rest_debug", m_enableRestDebug);
217222

218223
// ---- Other / Experimental ----
219224
addHeader(7, "LBL_other");
220225

221-
m_enableHeatMap = new JCheckBox();
222-
addCheckBox(8, "LBL_enable_heatmap", m_enableHeatMap);
223-
224226
m_enablePersistenceList = new JCheckBox();
225-
addCheckBox(9, "LBL_enable_persistence_list", m_enablePersistenceList);
227+
m_enablePersistenceList.setToolTipText(getLocalText("TTIP_persistence_list"));
228+
addCheckBox(8, "LBL_enable_persistence_list", m_enablePersistenceList);
226229

227230
m_enableZoom = new JCheckBox();
228-
addCheckBox(10, "LBL_enable_zoom", m_enableZoom);
231+
m_enableZoom.setToolTipText(getLocalText("TTIP_zoom_enabled"));
232+
addCheckBox(9, "LBL_enable_zoom", m_enableZoom);
229233

230234
m_enableClusterSnapshot = new JCheckBox();
231-
addCheckBox(11, "LBL_enable_cluster_snapshot", m_enableClusterSnapshot);
235+
m_enableClusterSnapshot.setToolTipText(getLocalText("TTIP_enable_cluster_snapshot"));
236+
addCheckBox(10, "LBL_enable_cluster_snapshot", m_enableClusterSnapshot);
232237

233238
m_adminFunctionsEnabled = new JCheckBox();
234-
addCheckBox(12, "LBL_enable_admin_functions", m_adminFunctionsEnabled);
239+
m_adminFunctionsEnabled.setToolTipText(getLocalText("TTIP_enable_cluster_head_dump"));
240+
addCheckBox(11, "LBL_enable_admin_functions", m_adminFunctionsEnabled);
235241

236242
JLabel appsLabel = new JLabel();
237-
Mnemonics.setLocalizedText(appsLabel, Localization.getLocalText("LBL_reconnect")); // NOI18N
243+
Mnemonics.setLocalizedText(appsLabel, getLocalText("LBL_reconnect")); // NOI18N
238244
c = new GridBagConstraints();
239-
c.gridy = 13;
245+
c.gridy = 12;
240246
c.gridwidth = GridBagConstraints.REMAINDER;
241247
c.anchor = GridBagConstraints.WEST;
242248
c.fill = GridBagConstraints.HORIZONTAL;
@@ -246,7 +252,7 @@ private void initComponents()
246252
// filler
247253
c = new GridBagConstraints();
248254
c.gridx = 0;
249-
c.gridy = 13;
255+
c.gridy = 12;
250256
c.weightx = 1;
251257
c.weighty = 1;
252258
c.anchor = GridBagConstraints.NORTHWEST;
@@ -265,7 +271,7 @@ private void initComponents()
265271
private void addCheckBox(int y, String sLabel, JCheckBox checkBox)
266272
{
267273
JLabel label = new JLabel();
268-
Mnemonics.setLocalizedText(label, Localization.getLocalText(sLabel));
274+
Mnemonics.setLocalizedText(label, getLocalText(sLabel));
269275
GridBagConstraints c = new GridBagConstraints();
270276
c.gridx = 0;
271277
c.gridy = y;
@@ -291,7 +297,7 @@ private void addCheckBox(int y, String sLabel, JCheckBox checkBox)
291297
*/
292298
private void addHeader(int y, String sLabel)
293299
{
294-
SectionSeparator sectionSeparator = UISupport.createSectionSeparator(Localization.getLocalText(sLabel));
300+
SectionSeparator sectionSeparator = UISupport.createSectionSeparator(getLocalText(sLabel));
295301
GridBagConstraints c = new GridBagConstraints();
296302
c.gridy = y;
297303
c.gridwidth = GridBagConstraints.REMAINDER;
@@ -312,7 +318,6 @@ private void startTrackingChanges()
312318
m_enableRestDebug.getModel().addChangeListener(changeListener);
313319
m_restRequestTimout.getModel().addChangeListener(changeListener);
314320
m_enableZoom.getModel().addChangeListener(changeListener);
315-
m_enableHeatMap.getModel().addChangeListener(changeListener);
316321
m_enablePersistenceList.getModel().addChangeListener(changeListener);
317322
m_enableClusterSnapshot.getModel().addChangeListener(changeListener);
318323
m_adminFunctionsEnabled.getModel().addChangeListener(changeListener);

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/GlobalPreferences.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,8 @@ private GlobalPreferences()
9797
isReporterDisabled();
9898
}
9999

100-
sValue = System.getProperty(PROP_HEATMAP_ENABLED);
101-
if (sValue != null)
102-
{
103-
setHeatMapEnabled(Boolean.parseBoolean(sValue));
104-
}
105-
else
106-
{
107-
isHeatMapEnabled();
108-
}
100+
// always set heat map enabled
101+
setHeatMapEnabled(true);
109102

110103
sValue = System.getProperty(PROP_ZOOM_ENABLED);
111104
if (sValue != null)

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMView.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,10 @@ protected DataViewComponent createComponent()
333333

334334
m_dvc.selectDetailsView(clusterOverview);
335335

336-
// create a timer that will refresh the TAB's as required
337-
m_timer = new Timer(GlobalPreferences.sharedInstance().getMonitoredDataPoll() * 1000, new ActionListener()
336+
// create a timer that will refresh the TAB's as required every 3 seconds
337+
// the reason for 3 seconds is so that with the min cluster data refresh time of
338+
// 5 seconds, the updates will be smoother
339+
m_timer = new Timer(3000, new ActionListener()
338340
{
339341
public void actionPerformed(ActionEvent e)
340342
{

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/datasource/CoherenceClusterDataSourceViewProvider.java

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,11 @@
2525

2626
package com.oracle.coherence.plugin.visualvm.datasource;
2727

28-
import com.fasterxml.jackson.databind.JsonNode;
29-
30-
import com.oracle.coherence.plugin.visualvm.Localization;
3128
import com.oracle.coherence.plugin.visualvm.VisualVMView;
3229

33-
import com.oracle.coherence.plugin.visualvm.helper.HttpRequestSender;
34-
import javax.swing.SwingUtilities;
3530
import org.graalvm.visualvm.core.ui.DataSourceView;
3631
import org.graalvm.visualvm.core.ui.DataSourceViewProvider;
3732
import org.graalvm.visualvm.core.ui.DataSourceViewsManager;
38-
import org.openide.DialogDisplayer;
39-
import org.openide.NotifyDescriptor;
40-
import org.openide.awt.StatusDisplayer;
41-
42-
import static com.oracle.coherence.plugin.visualvm.Localization.getLocalText;
4333

4434
/**
4535
* The {@link DataSourceViewProvider} for {@link CoherenceClusterDataSource}.
@@ -56,36 +46,8 @@ public class CoherenceClusterDataSourceViewProvider
5646
@Override
5747
protected boolean supportsViewFor(CoherenceClusterDataSource coherenceClusterDataSource)
5848
{
59-
String sUrl = coherenceClusterDataSource.getUrl();
60-
HttpRequestSender requestSender = new HttpRequestSender(sUrl);
61-
final StatusDisplayer.Message[] status = new StatusDisplayer.Message[1];
62-
63-
String sText = getLocalText("LBL_testing_connection", sUrl);
64-
SwingUtilities.invokeLater(()->status[0] = StatusDisplayer.getDefault().setStatusText(sText, 2400));
65-
66-
// BUG 29213475 - Check for a valid HttpRequestSender URL before we start the refresh
67-
String sMessage = Localization.getLocalText("ERR_Invalid_URL", sUrl);
68-
try
69-
{
70-
JsonNode rootClusterMembers = requestSender.getListOfClusterMembers();
71-
if (rootClusterMembers == null)
72-
{
73-
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(sMessage));
74-
}
75-
}
76-
catch (Exception e)
77-
{
78-
sMessage = sMessage + "\nError: " + e.getMessage();
79-
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(sMessage));
80-
return false;
81-
}
82-
finally
83-
{
84-
if (status[0] != null )
85-
{
86-
status[0].clear(1000);
87-
}
88-
}
49+
// we don't do the test here as this can cause delays and
50+
// confusion if a user clicks on a a URL that doesn't exist
8951
return true;
9052
}
9153

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tablemodel/model/ServiceMemberData.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ public Data processReporterData(Object[] aoColumns, VisualVMModel model)
177177
data.setColumn(ServiceMemberData.REQUEST_AVERAGE_DURATION, Float.valueOf(aoColumns[nStart++].toString()));
178178
data.setColumn(ServiceMemberData.TASK_AVERAGE_DURATION, Float.valueOf(aoColumns[nStart++].toString()));
179179

180+
if ((Integer) data.getColumn(ServiceMemberData.THREAD_IDLE_COUNT) == -1)
181+
{
182+
data.setColumn(ServiceMemberData.THREAD_IDLE_COUNT, 0);
183+
}
184+
if ((Float) data.getColumn(ServiceMemberData.TASK_AVERAGE_DURATION) == -1.0f)
185+
{
186+
data.setColumn(ServiceMemberData.TASK_AVERAGE_DURATION, 0);
187+
}
188+
180189
if ((Integer) data.getColumn(ServiceMemberData.THREAD_COUNT) > 0)
181190
{
182191
float threadUtil = ((float) ((Integer) data.getColumn(ServiceMemberData.THREAD_COUNT)

coherence-visualvm-plugin/src/main/resources/com/oracle/coherence/plugin/visualvm/Bundle.properties

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ LBL_refresh_date=Refresh Date
6464
LBL_cluster_statusha=Cluster StatusHA
6565
BTN_admin=Cluster Heap Dump
6666
TTIP_admin=Generate a heap dump across all members.
67-
LBL_heap_dump_completed=Please check the logs files for location of the heap dumps.
67+
LBL_heap_dump_completed=Please check the coherence logs files for location of the heap dumps.
6868
LBL_heap_dump_failed=Heap dump failed: {0}.
6969
LBL_heap_dump_question=WARNING: This operation will have a performance impact on your running Cluster. \nAre you sure you want to instruct the cluster to perform a head dump across all members?
7070
LBL_heap_dump_confirm=Please confirm heap dump
71-
LBL_testing_connection=Testing connection to {0}...
7271

7372
# CoherenceCachePanel (spaces before are for label spacing)
7473
LBL_total_caches=Total Caches
@@ -516,7 +515,7 @@ ERR_Failed_to_run_report=The report {0} failed to run with exception {1}. Fallin
516515
# Options
517516
OptionsCategory_Name_Coherence=Coherence
518517
LBL_general=General
519-
LBL_refresh_time=Refresh Time\:
518+
LBL_refresh_time=Data Refresh Time\:
520519
LBL_seconds=sec.
521520
LBL_log_query_times=Log Query Times\:
522521
LBL_disable_mbean_check=Disable MBean Check* \:
@@ -528,6 +527,15 @@ LBL_other=Other / Experimental
528527
LBL_enable_heatmap=Enable Heat Map* \:
529528
LBL_enable_zoom=Enable Zoom on Graphs* \:
530529
LBL_enable_cluster_snapshot=Enable Cluster Snapshot Tab* \:
531-
LBL_enable_admin_functions=Enable Admin Functions* \:
530+
LBL_enable_admin_functions=Enable Cluster Heap Dump* \:
532531
LBL_enable_persistence_list=Enable Persistence List* \:
533-
LBL_reconnect=Items marked with (*) take effect when you reconnect to a Coherence cluster.
532+
LBL_reconnect=Items marked with (*) take effect when you reconnect to a Coherence cluster.
533+
TTIP_refresh_time=Time (in seconds) between refreshing data from the cluster. Do not set too low as this could adversely affect performance in large clusters.
534+
TTIP_log_query_times=Enables logging of query times to the VisualVM logfile when retrieving data.
535+
TTIP_disable_mbean_check=Disables the MBean check when connecting to WebLogic Server. This allows the plugin to startup without checking for Cluster MBean.
536+
TTIP_rest_request_timeout=The request timeout (in ms) when using REST to connect to a cluster.
537+
TTIP_rest_debug=Enables HTTP request debugging when using REST to connect to a cluster.
538+
TTIP_persistence_list=Enables dropdown list of snapshots rather than having to enter the snapshot when performing snapshot operations.
539+
TTIP_zoom_enabled=Enables additional zoom function for all graphs.
540+
TTIP_enable_cluster_snapshot=Enables experimental cluster snapshot tab.
541+
TTIP_enable_cluster_head_dump=Enables the cluster heap dump button on the Cluster Overview tab.

0 commit comments

Comments
 (0)