Skip to content

Commit 251578b

Browse files
authored
Minor consmetic updates to Federation and Caches panels (#102)
* Minor consmetic updates to Federation and Caches panels * Additional fixes for machine * Minor sonarcloud
1 parent 15e1dcd commit 251578b

File tree

15 files changed

+69
-49
lines changed

15 files changed

+69
-49
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -624,7 +624,7 @@ public SortedMap<String, Integer> getInitialMachineMap()
624624
{
625625
for (Entry<Object, Data> entry : m_mapCollectedData.get(DataType.MEMBER))
626626
{
627-
initialMachineMap.putIfAbsent(((String) entry.getValue().getColumn(MemberData.ADDRESS)),
627+
initialMachineMap.putIfAbsent(((String) entry.getValue().getColumn(MemberData.MACHINE_NAME)),
628628
(Integer) entry.getValue().getColumn(MemberData.NODE_ID));
629629
}
630630
}
@@ -1533,7 +1533,8 @@ public String[] getMetadata()
15331533
*/
15341534
private static final String[] MEMBER_LABELS = new String[]
15351535
{
1536-
Localization.getLocalText(LBL_NODE_ID), Localization.getLocalText("LBL_unicast_address"),
1536+
Localization.getLocalText(LBL_NODE_ID), Localization.getLocalText("LBL_machine_name"),
1537+
Localization.getLocalText("LBL_unicast_address"),
15371538
Localization.getLocalText("LBL_port"), Localization.getLocalText("LBL_role"),
15381539
Localization.getLocalText("LBL_publisher_rate"), Localization.getLocalText("LBL_receiver_rate"),
15391540
Localization.getLocalText("LBL_send_q"), Localization.getLocalText("LBL_max_memory"),

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceClusterSnapshotPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -332,7 +332,7 @@ private String membersOverview()
332332
{
333333
sb.append("<tr>")
334334
.append(td(entry.getValue().getColumn(MemberData.NODE_ID).toString()))
335-
.append(td(entry.getValue().getColumn(MemberData.ADDRESS).toString()))
335+
.append(td(entry.getValue().getColumn(MemberData.MACHINE_NAME).toString()))
336336
.append(td(entry.getValue().getColumn(MemberData.PORT).toString()))
337337
.append(td(entry.getValue().getColumn(MemberData.ROLE_NAME).toString()))
338338
.append(td(getPublisherValue(entry.getValue().getColumn(MemberData.PUBLISHER_SUCCESS).toString())))

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceMemberPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,8 @@ private String generateHeader(int nNode)
677677
// this is the node
678678
sb.append(asColumns[MemberData.NODE_ID]).append(": ")
679679
.append(entry.getValue().getColumn(MemberData.NODE_ID).toString()).append("\n")
680-
.append(asColumns[MemberData.ADDRESS]).append(": ")
681-
.append(entry.getValue().getColumn(MemberData.ADDRESS).toString()).append("\n")
680+
.append(asColumns[MemberData.MACHINE_NAME]).append(": ")
681+
.append(entry.getValue().getColumn(MemberData.MACHINE_NAME).toString()).append("\n")
682682
.append(asColumns[MemberData.PORT]).append(": ")
683683
.append(entry.getValue().getColumn(MemberData.PORT).toString()).append("\n")
684684
.append(asColumns[MemberData.ROLE_NAME]).append(": ")

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

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -88,7 +88,7 @@ public List<Map.Entry<Object, Data>> getJMXData(RequestSender requestSender, Vis
8888

8989
AttributeList listAttr = requestSender.getAttributes(nodeNameObjName,
9090
new String[] { ATTR_PUB_SUCCESS_RATE, ATTR_REC_SUCCESS_RATE, ATTR_MEM_MAX_MB,
91-
ATTR_MEM_AVAIL_MB, ATTR_SEND_Q_SIZE, ATTR_UNICAST_ADDR,
91+
ATTR_MEM_AVAIL_MB, ATTR_SEND_Q_SIZE, ATTR_MACHINE_NAME, ATTR_UNICAST_ADDRESS,
9292
ATTR_ROLE_NAME, ATTR_UNICAST_PORT, ATTR_PRODUCT_EDITION });
9393

9494
data.setColumn(MemberData.NODE_ID, nodeId);
@@ -102,10 +102,11 @@ public List<Map.Entry<Object, Data>> getJMXData(RequestSender requestSender, Vis
102102
(Integer) data.getColumn(MemberData.MAX_MEMORY)
103103
- (Integer) data.getColumn(MemberData.FREE_MEMORY));
104104

105-
data.setColumn(MemberData.ADDRESS, (String) getAttributeValueAsString(listAttr, ATTR_UNICAST_ADDR));
105+
data.setColumn(MemberData.MACHINE_NAME, getAttributeValueAsString(listAttr, ATTR_MACHINE_NAME));
106+
data.setColumn(MemberData.UNICAST_ADDRESS,getAttributeValueAsString(listAttr, ATTR_UNICAST_ADDRESS));
106107

107-
data.setColumn(MemberData.ROLE_NAME, (String) getAttributeValueAsString(listAttr, ATTR_ROLE_NAME));
108-
data.setColumn(MemberData.PRODUCT_EDITION, (String) getAttributeValueAsString(listAttr, ATTR_PRODUCT_EDITION));
108+
data.setColumn(MemberData.ROLE_NAME, getAttributeValueAsString(listAttr, ATTR_ROLE_NAME));
109+
data.setColumn(MemberData.PRODUCT_EDITION, getAttributeValueAsString(listAttr, ATTR_PRODUCT_EDITION));
109110
data.setColumn(MemberData.PORT, Integer.parseInt(getAttributeValueAsString(listAttr, ATTR_UNICAST_PORT)));
110111
data.setColumn(MemberData.STORAGE_ENABLED, "true");
111112

@@ -146,7 +147,8 @@ public Data processReporterData(Object[] aoColumns, VisualVMModel model)
146147
(Integer) data.getColumn(MemberData.MAX_MEMORY)
147148
- (Integer) data.getColumn(MemberData.FREE_MEMORY));
148149

149-
data.setColumn(MemberData.ADDRESS, aoColumns[8].toString());
150+
data.setColumn(MemberData.MACHINE_NAME, aoColumns[11].toString());
151+
data.setColumn(MemberData.UNICAST_ADDRESS, aoColumns[8].toString());
150152

151153
data.setColumn(MemberData.ROLE_NAME, aoColumns[9].toString());
152154
data.setColumn(MemberData.PORT, Integer.valueOf(getNumberValue(aoColumns[10].toString())));
@@ -189,7 +191,8 @@ public SortedMap<Object, Data> getAggregatedDataFromHttpQuerying(VisualVMModel m
189191
data.setColumn(MemberData.USED_MEMORY,
190192
(Integer) data.getColumn(MemberData.MAX_MEMORY)
191193
- (Integer) data.getColumn(MemberData.FREE_MEMORY));
192-
data.setColumn(MemberData.ADDRESS, clusterMember.get("unicastAddress").asText());
194+
data.setColumn(MemberData.MACHINE_NAME, clusterMember.get("machineName").asText());
195+
data.setColumn(MemberData.UNICAST_ADDRESS, clusterMember.get("uncasstAddress").asText());
193196
data.setColumn(MemberData.ROLE_NAME, clusterMember.get("roleName").asText());
194197
data.setColumn(MemberData.PRODUCT_EDITION, clusterMember.get("productEdition").asText());
195198
data.setColumn(MemberData.PORT, Integer.valueOf(getNumberValue(clusterMember.get("unicastPort").asText())));
@@ -207,62 +210,67 @@ public SortedMap<Object, Data> getAggregatedDataFromHttpQuerying(VisualVMModel m
207210
/**
208211
* Array index for node id.
209212
*/
210-
public static int NODE_ID = 0;
213+
public static final int NODE_ID = 0;
214+
215+
/**
216+
* Array index for machine name.
217+
*/
218+
public static final int MACHINE_NAME = 1;
211219

212220
/**
213221
* Array index for address.
214222
*/
215-
public static int ADDRESS = 1;
223+
public static final int UNICAST_ADDRESS = 2;
216224

217225
/**
218226
* Array index for port.
219227
*/
220-
public static int PORT = 2;
228+
public static final int PORT = 3;
221229

222230
/**
223231
* Array index for role name.
224232
*/
225-
public static int ROLE_NAME = 3;
233+
public static final int ROLE_NAME = 4;
226234

227235
/**
228236
* Array index for publisher success rate.
229237
*/
230-
public static int PUBLISHER_SUCCESS = 4;
238+
public static final int PUBLISHER_SUCCESS = 5;
231239

232240
/**
233241
* Array index for receiver success rate.
234242
*/
235-
public static int RECEIVER_SUCCESS = 5;
243+
public static final int RECEIVER_SUCCESS = 6;
236244

237245
/**
238246
* Array index for send queue size.
239247
*/
240-
public static int SENDQ_SIZE = 6;
248+
public static final int SENDQ_SIZE = 7;
241249

242250
/**
243251
* Array index for max memory.
244252
*/
245-
public static int MAX_MEMORY = 7;
253+
public static final int MAX_MEMORY = 8;
246254

247255
/**
248256
* Array index for used memory.
249257
*/
250-
public static int USED_MEMORY = 8;
258+
public static final int USED_MEMORY = 9;
251259

252260
/**
253261
* Array index for free memory.
254262
*/
255-
public static int FREE_MEMORY = 9;
263+
public static final int FREE_MEMORY = 10;
256264

257265
/**
258266
* Array index for storage-enabled.
259267
*/
260-
public static int STORAGE_ENABLED = 10;
268+
public static final int STORAGE_ENABLED = 11;
261269

262270
/**
263271
* Array index for ProductEdition.
264272
*/
265-
public static int PRODUCT_EDITION = 11;
273+
public static final int PRODUCT_EDITION = 12;
266274

267275
/**
268276
* The logger object to use.
@@ -302,7 +310,12 @@ public SortedMap<Object, Data> getAggregatedDataFromHttpQuerying(VisualVMModel m
302310
/**
303311
* JMX attribute name for Unicast Address.
304312
*/
305-
private static final String ATTR_UNICAST_ADDR = "UnicastAddress";
313+
private static final String ATTR_MACHINE_NAME = "MachineName";
314+
315+
/**
316+
* JMX attribute name for Unicast Address.
317+
*/
318+
private static final String ATTR_UNICAST_ADDRESS = "UnicastAddress";
306319

307320
/**
308321
* JMX attribute name for Role Name.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
4242
*
4343
* @author tam 2024.03.03
4444
*/
45-
public class CacheSizeProbe
45+
public class CacheCountProbe
4646
extends AbstractCoherenceMonitorProbe
4747
{
4848
// ----- constructors ---------------------------------------------------
@@ -51,7 +51,7 @@ public class CacheSizeProbe
5151
* Construct the probe.
5252
* @param resolver {@link MonitoredDataResolver}.
5353
*/
54-
public CacheSizeProbe(MonitoredDataResolver resolver)
54+
public CacheCountProbe(MonitoredDataResolver resolver)
5555
{
5656
super(1, createItemDescriptors(), resolver);
5757
}

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/CacheMonitorPackage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public CacheMonitorPackage(Application application)
6565
@Override
6666
public TracerProbeDescriptor[] getProbeDescriptors() {
6767
m_memorySizeProbeDescriptor = CacheMemorySizeProbe.createDescriptor(f_model != null);
68-
m_SizeProbeDescriptor = CacheSizeProbe.createDescriptor(f_model != null);
68+
m_SizeProbeDescriptor = CacheCountProbe.createDescriptor(f_model != null);
6969

7070
return new TracerProbeDescriptor[] {
7171
m_memorySizeProbeDescriptor,
@@ -88,7 +88,7 @@ else if (descriptor == m_SizeProbeDescriptor)
8888
{
8989
if (m_SizeProbe == null)
9090
{
91-
m_SizeProbe = new CacheSizeProbe(this);
91+
m_SizeProbe = new CacheCountProbe(this);
9292
}
9393
return m_SizeProbe;
9494
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
*
4444
* @author tam 2024.03.13
4545
*/
46-
public class SelectedCacheSizeProbe
46+
public class SelectedCacheCountProbe
4747
extends AbstractCoherenceMonitorProbe
4848
{
4949
// ----- constructors ---------------------------------------------------
@@ -52,7 +52,7 @@ public class SelectedCacheSizeProbe
5252
* Construct the probe.
5353
* @param resolver {@link MonitoredDataResolver}.
5454
*/
55-
public SelectedCacheSizeProbe(MonitoredDataResolver resolver)
55+
public SelectedCacheCountProbe(MonitoredDataResolver resolver)
5656
{
5757
super(1, createItemDescriptors(), resolver);
5858
}

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/SelectedCacheMonitorPackage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public SelectedCacheMonitorPackage(Application application)
6363

6464
@Override
6565
public TracerProbeDescriptor[] getProbeDescriptors() {
66-
m_sizeProbeDescriptor = SelectedCacheSizeProbe.createDescriptor(f_model != null);
66+
m_sizeProbeDescriptor = SelectedCacheCountProbe.createDescriptor(f_model != null);
6767
m_memoryProbeDescriptor = SelectedCacheMemoryProbe.createDescriptor(f_model != null);
6868
m_listenersProbeDescriptor = SelectedCacheListenersProbe.createDescriptor(f_model != null);
6969
m_queryProbeDescriptor = SelectedCacheQueryProbe.createDescriptor(f_model != null);
@@ -83,7 +83,7 @@ public TracerProbe<Application> getProbe(TracerProbeDescriptor descriptor)
8383
{
8484
if (m_sizeProbe == null)
8585
{
86-
m_sizeProbe = new SelectedCacheSizeProbe(this);
86+
m_sizeProbe = new SelectedCacheCountProbe(this);
8787
}
8888
return m_sizeProbe;
8989
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ LBL_total_applications=Total Applications
250250
LBL_max_reap_duration=Maximum Reap Duration (ms)
251251

252252
# CoherenceFederationPanel
253-
TAB_inbound=Inbound
254-
TAB_outbound=Outbound
253+
TAB_inbound=Incoming
254+
TAB_outbound=Outgoing
255255
LBL_max_bandwidth=Maximum Bandwidth (Mbps)
256256
LBL_send_time_out=Send Timeout Millis (ms)
257257
LBL_geo_ip=Geo IP
@@ -424,9 +424,9 @@ LBL_reconnect_timeout=Reconnect Timeout
424424
LBL_reconnect_wait=Reconnect Wait
425425
LBL_subscribers=Subscribers
426426
LBL_service_cache_name=Service / Cache Name
427-
LBL_size=Size
428-
LBL_memory_bytes=Memory (bytes)
429-
LBL_memory_mb=Memory (MB)
427+
LBL_size=Count
428+
LBL_memory_bytes=Memory Size (bytes)
429+
LBL_memory_mb=Memory Size (MB)
430430
LBL_average_object_size=Avg object Size (bytes)
431431
LBL_unit_calculator=Unit Calculator
432432
LBL_view_cache=View Cache
@@ -744,7 +744,7 @@ LBL_ramjournal_memory_desc=Monitors the committed and used ram journal memory.
744744
LBL_ramjournal_files_desc=Monitors the used and committed ram journal files.
745745
LBL_flashjournal_files_desc=Monitors the used and committed flash journal files.
746746
LBL_flashjournal_size_desc=Monitors the committed and used ram journal space.
747-
LBL_cache_size_desc=Monitors the total number of cache entries in all caches across all partitioned services and participants.
747+
LBL_cache_size_desc=Monitors the total number of cache entries in all caches across all partitioned services.
748748
LBL_federation_bytes_sent_desc=Monitors the current bytes sent/ second across all federated services and participants.
749749
LBL_federation_bytes_rec_desc=Monitors the current bytes received/ second across all federated services and participants.
750750
LBL_federation_msgs_sent_desc=Monitors the current msgs sent/ second across all federated services and participants.
@@ -773,8 +773,8 @@ LBL_selected_service_task_backlog=Selected Service - Task Backlog
773773
LBL_selected_service_task_backlog_desc=Monitors the total task backlog for the currently selected service.
774774
LBL_selected_service_partitions=Selected Service - Partitions
775775
LBL_selected_service_partitions_desc=Monitors the partition information for the currently selected service.
776-
LBL_selected_cache_size=Selected Cache - Size
777-
LBL_selected_cache_size_desc=Monitors the cache size for the currently selected cache.
776+
LBL_selected_cache_size=Selected Cache - Count
777+
LBL_selected_cache_size_desc=Monitors the number of entries for the currently selected cache.
778778
LBL_selected_cache_memory=Selected Cache - Memory
779779
LBL_selected_cache_memory_desc=Monitors the total cache memory and index memory for the currently selected cache for all members.
780780
LBL_selected_cache_index=Selected Cache - Index

help/help.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
33
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44

55
This code is free software; you can redistribute it and/or modify it
@@ -92,6 +92,7 @@ All attributes are from `Node MBean` (`Coherence:type=Node,nodeId=n`).
9292
!===
9393
|**Column** | **Source / Comment**
9494
|Node Id| nodeId (key)
95+
|Machine Name | MachineName
9596
|Unicast Address | UnicastAddress
9697
|Port | UnicastPort
9798
|Publisher Success Rate | PublisherSuccessRate

0 commit comments

Comments
 (0)