diff --git a/.github/workflows/test-against-released.yml b/.github/workflows/test-against-released.yml
index cdc6889..99b9926 100644
--- a/.github/workflows/test-against-released.yml
+++ b/.github/workflows/test-against-released.yml
@@ -47,6 +47,7 @@ jobs:
- 22.06.6
- 23.09
- 23.09.1
+ - 23.09.2
steps:
- name: Checkout
@@ -59,6 +60,17 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
+ - name: Set up JDK 8 for Tracer Build
+ uses: actions/setup-java@v3
+ with:
+ java-version: '8'
+ distribution: 'temurin'
+
+ - name: Build Tracer
+ shell: bash
+ run: |
+ cd ./scripts && ./install-tracer-library.sh && cd ..
+
- name: Set up JDK 11 for Build
uses: actions/setup-java@v3
with:
diff --git a/.github/workflows/test-against-snapshot-1440.yml b/.github/workflows/test-against-snapshot-1440.yml
index d563060..2e8faa9 100644
--- a/.github/workflows/test-against-snapshot-1440.yml
+++ b/.github/workflows/test-against-snapshot-1440.yml
@@ -57,11 +57,16 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-snapshots
- - name: Set up JDK 8 for Build
+ - name: Set up JDK 8 for Tracer Build
uses: actions/setup-java@v3
with:
- java-version: 8
- distribution: 'zulu'
+ java-version: '8'
+ distribution: 'temurin'
+
+ - name: Build Tracer
+ shell: bash
+ run: |
+ cd ./scripts && ./install-tracer-library.sh && cd ..
- name: Print Versions
run: mvn -version && ant -version
diff --git a/.github/workflows/test-against-snapshot.yml b/.github/workflows/test-against-snapshot.yml
index 9cbd8bf..37bd2df 100644
--- a/.github/workflows/test-against-snapshot.yml
+++ b/.github/workflows/test-against-snapshot.yml
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@ jobs:
fail-fast: false
matrix:
coherenceVersion:
- - 23.09.2-SNAPSHOT
+ - 23.09.3-SNAPSHOT
- 22.06.8-SNAPSHOT
steps:
@@ -58,6 +58,17 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-snapshots
+ - name: Set up JDK 8 for Tracer Build
+ uses: actions/setup-java@v3
+ with:
+ java-version: '8'
+ distribution: 'temurin'
+
+ - name: Build Tracer
+ shell: bash
+ run: |
+ cd ./scripts && ./install-tracer-library.sh && cd ..
+
- name: Set up JDK 17 for Build
uses: actions/setup-java@v3
with:
diff --git a/README.md b/README.md
index 73bdc58..02380ab 100644
--- a/README.md
+++ b/README.md
@@ -26,13 +26,14 @@ NOTE: The most current version of the Plugin requires VisualVM release 2.1 or la
3. [Connecting to a Coherence Cluster](#connect)
4. [Changing the Plugin Behaviour via the Options Tab](#prefs)
5. [Monitoring Capabilities](#capabilities)
-6. [Building the Plugin](#build)
+6. [Using Coherence with the Tracer framework](#tracer)
+7. [Building the Plugin](#build)
## Supported Coherence Versions
The Plugin will connect to and display data for the following Coherence versions:
-* **Community Editions**: 22.06.x, 21.12.x (*), 14.1.1.0.x
+* **Community Editions**: 24.03.x, 23.09.x, 22.06.x, 21.12.x (*), 14.1.1.0.x
* **Commercial Editions**: 14.1.1.2206.x, 14.1.1.0.x, 12.2.1.5.x, 12.2.1.4.x 12.1.3.x and 12.1.2.x
@@ -192,6 +193,57 @@ Depending upon the edition and functionality you are using, the following option
* **gRPC Proxies** – If your cluster is configured with gRPC Proxies, this tab displays information about the requests sent and received as well as successful and failed requests. A Graph of message rates and durations is also displayed. This tab will only show when connected via JMX and is not supported for REST connections. See [here](https://github.com/oracle/coherence-visualvm/blob/main/help/help.adoc#GrpcProxyTableModel) for more details.
* **Health** – If your cluster supports the Health Check API, this tab displays information regarding the status of all health endpoints. See [here](https://github.com/oracle/coherence-visualvm/blob/main/help/help.adoc#HealthSummaryTableModel) for more details.
+## Using Coherence with the Tracer framework
+
+Version 1.7.0 of the Coherence VisualVM Plugin introduces initial integration with the VisualVM Tracer framework.
+
+From the VisualVM website
+
+> The VisualVM Tracer framework provides detailed monitoring and analyzing Java applications. Using various probes,
+> the Tracer gathers metrics from an application and displays the data in a timeline. The data are
+> displayed both graphically and in a table and can be exported to common formats for further processing
+> by external tools.
+
+When you connect to a cluster via JMX, you will see the `Tracer` tab as shown below:
+
+ 
+
+Each of the probes areas can be expanded to reveal the individual probes. You can select the probes and then
+click `Start` to display the information.
+
+The supported Coherence probes are:
+
+*Cluster Overview*
+
+ 
+
+*Services*
+
+ 
+
+*Caches*
+
+ 
+
+*Proxy Servers*
+
+ 
+
+*Persistence*
+
+ 
+
+*Federation*
+
+ 
+
+*Elastic Data*
+
+ 
+
+> Note: In the initial release of this integration, only summary information can to be plotted. We may include
+> additional functionality in future releases to allow for specific services or caches to be monitored.
+> There are no timelines for these releases. If you would like specific information included, please raise an issue.
## Building the Plugin
@@ -204,6 +256,11 @@ You must have the following:
1. Java JDK 11+ - To build and test the plugin
2. Maven 3.6.3+
3. Git
+
+Note:
+To install the tracer support, you must also run the script `./scrips/install-tracer-library.sh`
+
+Ensure you set your environment to JDK 1.8 to run this script.
### Clone the Repository
diff --git a/assets/probes-caches.png b/assets/probes-caches.png
new file mode 100644
index 0000000..586069e
Binary files /dev/null and b/assets/probes-caches.png differ
diff --git a/assets/probes-cluster-overview.png b/assets/probes-cluster-overview.png
new file mode 100644
index 0000000..6ab4ebd
Binary files /dev/null and b/assets/probes-cluster-overview.png differ
diff --git a/assets/probes-elastic-data.png b/assets/probes-elastic-data.png
new file mode 100644
index 0000000..cfb44a9
Binary files /dev/null and b/assets/probes-elastic-data.png differ
diff --git a/assets/probes-federation.png b/assets/probes-federation.png
new file mode 100644
index 0000000..c4a4828
Binary files /dev/null and b/assets/probes-federation.png differ
diff --git a/assets/probes-persistence.png b/assets/probes-persistence.png
new file mode 100644
index 0000000..6b0022f
Binary files /dev/null and b/assets/probes-persistence.png differ
diff --git a/assets/probes-proxies.png b/assets/probes-proxies.png
new file mode 100644
index 0000000..c5656e2
Binary files /dev/null and b/assets/probes-proxies.png differ
diff --git a/assets/probes-services.png b/assets/probes-services.png
new file mode 100644
index 0000000..40dd014
Binary files /dev/null and b/assets/probes-services.png differ
diff --git a/assets/probes.png b/assets/probes.png
new file mode 100644
index 0000000..8ec1638
Binary files /dev/null and b/assets/probes.png differ
diff --git a/coherence-visualvm-plugin/pom.xml b/coherence-visualvm-plugin/pom.xml
index ebb36e1..75d4222 100644
--- a/coherence-visualvm-plugin/pom.xml
+++ b/coherence-visualvm-plugin/pom.xml
@@ -33,7 +33,7 @@
com.oracle.coherence.plugin.visualvm
coherence-visualvm-main
- 1.6.3-SNAPSHOT
+ 1.7.0-SNAPSHOT
../pom.xml
@@ -107,6 +107,11 @@
org-graalvm-visualvm-lib-ui
+
+ org.graalvm.visualvm.modules
+ org-graalvm-visualvm-modules-tracer
+
+
com.fasterxml.jackson.core
jackson-annotations
@@ -164,6 +169,10 @@
${java.version}
${java.version}
${java.version.release}
+
+ --add-opens
+ jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
+
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMInstaller.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMInstaller.java
index d862d3b..a4315c3 100644
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMInstaller.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMInstaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,20 @@
import com.oracle.coherence.plugin.visualvm.impl.CoherenceClusterProvider;
+import com.oracle.coherence.plugin.visualvm.tracer.cache.CacheMonitorPackage;
+import com.oracle.coherence.plugin.visualvm.tracer.cluster.ClusterMonitorPackage;
+import com.oracle.coherence.plugin.visualvm.tracer.elasticdata.ElasticDataMonitorPackage;
+import com.oracle.coherence.plugin.visualvm.tracer.federation.FederationMonitorPackage;
+import com.oracle.coherence.plugin.visualvm.tracer.persistence.PersistenceMonitorPackage;
+import com.oracle.coherence.plugin.visualvm.tracer.proxy.ProxyMonitorPackage;
+import com.oracle.coherence.plugin.visualvm.tracer.service.ServiceMonitorPackage;
+
+import org.graalvm.visualvm.application.Application;
+
+import org.graalvm.visualvm.modules.tracer.TracerPackage;
+import org.graalvm.visualvm.modules.tracer.TracerPackageProvider;
+import org.graalvm.visualvm.modules.tracer.TracerSupport;
+
import org.openide.modules.ModuleInstall;
/**
@@ -56,6 +70,14 @@ public void restored()
CoherenceClusterDataSourceViewProvider.register();
CoherenceClusterProvider.initCoherenceClustersDataSource();
CoherenceApplicationTypeFactory.initialize();
+
+ // register the tracer probes
+ if (m_provider == null)
+ {
+ m_provider = new TracerPackageProviderImpl();
+ }
+
+ TracerSupport.getInstance().registerPackageProvider(m_provider);
}
/**
@@ -69,5 +91,42 @@ public void uninstalled()
CoherenceClusterDataSourceDescriptorProvider.unregister();
CoherenceClusterDataSourceViewProvider.unregister();
CoherenceApplicationTypeFactory.shutdown();
+
+ // un-register the tracer probes
+ if (m_provider == null)
+ {
+ m_provider = new TracerPackageProviderImpl();
+ }
+
+ TracerSupport.getInstance().unregisterPackageProvider(m_provider);
}
+
+ /**
+ * Provider of Coherence tracer probes.
+ */
+ private static class TracerPackageProviderImpl
+ extends TracerPackageProvider
+ {
+
+ TracerPackageProviderImpl()
+ {
+ super(Application.class);
+ }
+
+ public TracerPackage[] getPackages(Application application)
+ {
+ return new TracerPackage[]
+ {
+ new ClusterMonitorPackage(application),
+ new ProxyMonitorPackage(application),
+ new ServiceMonitorPackage(application),
+ new CacheMonitorPackage(application),
+ new FederationMonitorPackage(application),
+ new ElasticDataMonitorPackage(application),
+ new PersistenceMonitorPackage(application)
+ };
+ }
+ }
+
+ private transient TracerPackageProviderImpl m_provider;
}
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMModel.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMModel.java
index ea3bd2e..4cd0d5f 100644
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMModel.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMModel.java
@@ -63,6 +63,7 @@
import com.oracle.coherence.plugin.visualvm.tablemodel.model.TopicSubscriberData;
import com.oracle.coherence.plugin.visualvm.tablemodel.model.TopicSubscriberGroupsData;
import com.oracle.coherence.plugin.visualvm.tablemodel.model.Tuple;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.ViewData;
import java.io.BufferedReader;
import java.io.Closeable;
@@ -173,6 +174,7 @@ private void init()
f_mapDataRetrievers.put(ExecutorData.class, new ExecutorData());
f_mapDataRetrievers.put(GrpcProxyData.class, new GrpcProxyData());
f_mapDataRetrievers.put(HealthData.class, new HealthData());
+ f_mapDataRetrievers.put(ViewData.class, new ViewData());
// Loop through each data retriever and initialize the map of
// report XML. Doing it this way we load it only once
@@ -1035,6 +1037,17 @@ public boolean isFederationCongfigured()
return m_fIsFederationAvailable;
}
+ /**
+ * Return if View caches are configured.
+ *
+ * @return true if view caches are configured.
+ */
+ public boolean isViewCacheCongfigured()
+ {
+ return m_mapCollectedData.get(DataType.VIEW) != null
+ && !m_mapCollectedData.get(DataType.VIEW).isEmpty();
+ }
+
/**
* Returns if Elastic Data is configured.
*
@@ -1329,9 +1342,10 @@ public enum DataType
HOTCACHE_PERCACHE(HotCachePerCacheData.class, HOTCACHE_PERCACHE_LABELS),
EXECUTOR(ExecutorData.class, EXECUTOR_LABELS),
GRPC_PROXY(GrpcProxyData.class, GRPC_PROXY_LABELS),
- HEALTH(HealthData.class, HEALTH_LABELS);
+ HEALTH(HealthData.class, HEALTH_LABELS),
+ VIEW(ViewData.class, VIEW_LABELS);
- private DataType(Class> clz, String[] asMeta)
+ DataType(Class> clz, String[] asMeta)
{
f_clazz = clz;
f_asMetadata = asMeta;
@@ -1469,6 +1483,17 @@ public String[] getMetadata()
Localization.getLocalText(LBL_CACHE_MISSES), Localization.getLocalText("LBL_hit_probability")
};
+ /**
+ * Labels for views table.
+ */
+ private static final String[] VIEW_LABELS = new String[]
+ {
+ Localization.getLocalText(LBL_NODE_ID), Localization.getLocalText(LBL_SIZE),
+ Localization.getLocalText("LBL_reconnect_Interval"), Localization.getLocalText("LBL_filter"),
+ Localization.getLocalText("LBL_transformed"), Localization.getLocalText("LBL_transformer"),
+ Localization.getLocalText("LBL_read_only"), Localization.getLocalText("LBL_cache_values")
+ };
+
/**
* Labels for front cache detail table.
*/
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMView.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMView.java
index 05b49db..dd28840 100644
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMView.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMView.java
@@ -62,6 +62,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -157,6 +158,14 @@ protected DataViewComponent createComponent()
{
final VisualVMModel model = VisualVMModel.getInstance();
+ m_model = model;
+
+ // only add the tracer if we are connecting via JMX
+ if (m_application != null)
+ {
+ addModelForApplication(m_application, model);
+ }
+
boolean fClusterSnapshotEnabled = com.oracle.coherence.plugin.visualvm.GlobalPreferences
.sharedInstance().isClusterSnapshotEnabled();
@@ -418,6 +427,9 @@ public void run()
protected void removed()
{
m_timer.stop();
+
+ // remove this application and the mapped VisualVmModel
+ f_visualVmModels.remove(m_application);
}
/**
@@ -430,6 +442,28 @@ public void dataRemoved(Application app)
m_timer.stop();
}
+ /**
+ * Returns the model that is being used for the application.
+ *
+ * @param application {@link Application} to associate with {@link VisualVMModel}
+ * @return the {@link VisualVMModel}
+ */
+ public static VisualVMModel getModelForApplication(Application application)
+ {
+ return f_visualVmModels.get(application);
+ }
+
+ /**
+ * Add the model that is being used for the application.
+ *
+ * @param application {@link Application} to associate with {@link VisualVMModel}
+ * @param model {@link VisualVMModel}
+ */
+ public static void addModelForApplication(Application application, VisualVMModel model)
+ {
+ f_visualVmModels.put(application, model);
+ }
+
// ----- constants ------------------------------------------------------
/**
@@ -447,8 +481,11 @@ public void dataRemoved(Application app)
*/
private static final Logger LOGGER = Logger.getLogger(VisualVMView.class.getName());
+ private static final ConcurrentHashMap f_visualVmModels = new ConcurrentHashMap<>();
+
// ----- data members ---------------------------------------------------
+ private VisualVMModel m_model;
/**
* Component used to display the tabs.
*/
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/GraphHelper.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/GraphHelper.java
index 30eaea6..49dcf14 100755
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/GraphHelper.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/GraphHelper.java
@@ -1229,9 +1229,9 @@ private static SimpleXYChartSupport createChart(SimpleXYChartDescriptor sxycd)
*/
public static final int VALUES_LIMIT = Integer.getInteger("coherence.plugin.visualvm.values.limit", 50000);
- private static final String GRPH_CURRENT_AVERAGE = "GRPH_current_average";
- private static final String GRPH_MINIMUM = "GRPH_minimum";
- private static final String GRPH_MAXIMUM = "GRPH_maximum";
- private static final String GRPH_AVERAGE = "GRPH_average";
- private static final String GRPH_CURRENT_MAXIMUM = "GRPH_current_maximum";
+ public static final String GRPH_CURRENT_AVERAGE = "GRPH_current_average";
+ public static final String GRPH_MINIMUM = "GRPH_minimum";
+ public static final String GRPH_MAXIMUM = "GRPH_maximum";
+ public static final String GRPH_AVERAGE = "GRPH_average";
+ public static final String GRPH_CURRENT_MAXIMUM = "GRPH_current_maximum";
}
\ No newline at end of file
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/HttpRequestSender.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/HttpRequestSender.java
index bf30024..b2228f4 100644
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/HttpRequestSender.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/HttpRequestSender.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -294,6 +294,26 @@ public void invokeStorageManagerOperation(String sService, String sCacheName, St
sendPostRequest(urlBuilder);
}
+ @Override
+ public String invokeReportPartitionsStatsOperation(String sService, String sCacheName)
+ throws Exception
+ {
+ URLBuilder urlBuilder = getBasePath()
+ .addPathSegment(SERVICES)
+ .addPathSegment(encodeServiceName(sService))
+ .addPathSegment("storage")
+ .addPathSegment(encodeServiceName(sCacheName))
+ .addPathSegment(PART_STATS);
+
+ JsonNode rootNode = getResponseJson(sendGetRequest(urlBuilder));
+ if (rootNode != null)
+ {
+ return new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(rootNode.get(PART_STATS));
+ }
+
+ return "";
+ }
+
@Override
public Set getAllJournalMembers(String sJournalType)
throws Exception
@@ -540,6 +560,21 @@ public Set getAllProxyServerMembers()
return getSetObjectNamesFromResponse(sendGetRequest(urlBuilder));
}
+ @Override
+ public Set getViewMembers(String sServiceName, String sViewName)
+ throws Exception
+ {
+ URLBuilder urlBuilder = getBasePath().addPathSegment(SERVICES)
+ .addPathSegment(encodeServiceName(sServiceName))
+ .addPathSegment("views")
+ .addPathSegment(encodeCacheName(sViewName))
+ .addPathSegment(MEMBERS)
+ .addQueryParameter(LINKS, "");
+
+ return getSetObjectNamesFromResponse(sendGetRequest(urlBuilder));
+
+ }
+
@Override
public Set getProxyConnections(String sServiceName, int nNodeId)
throws Exception
@@ -1151,6 +1186,24 @@ public JsonNode getDataForProxyMembers() throws Exception
return getResponseJson(sendGetRequest(urlBuilder));
}
+ /**
+ * Get the view data in the cluster.
+ *
+ * @return the data for all the cluster members
+ * @throws Exception in case of errors
+ */
+ public JsonNode getDataForViews(String sServiceName, String sViewName) throws Exception
+ {
+ URLBuilder urlBuilder = getBasePath().addPathSegment(SERVICES)
+ .addPathSegment(encodeServiceName(sServiceName))
+ .addPathSegment("views")
+ .addPathSegment(encodeCacheName(sViewName))
+ .addPathSegment(MEMBERS)
+ .addQueryParameter(LINKS, "");
+
+ return getResponseJson(sendGetRequest(urlBuilder));
+ }
+
/**
* Get the data for all the topics in the cluster.
*
@@ -1433,7 +1486,7 @@ private InputStream sendGetRequest(URLBuilder urlBuilder) throws Exception
InputStream inputStream = connection.getInputStream();
if (isRequestDebugEnabled)
{
- LOGGER.info((System.currentTimeMillis() - start) + "ms to open connection to "
+ LOGGER.info((System.currentTimeMillis() - start) + " ms to open connection to "
+ urlBuilder.getUrl().toString() + " ");
}
@@ -2054,6 +2107,7 @@ private void initSSL()
private static final String CACHE = "Cache";
private static final String DOMAIN_PART = "domainPartition";
private static final String DESCRIPTION = "description";
+ public static final String PART_STATS = "reportPartitionStats";
/**
* A trust manager that will trust all certificates. Only used when the preference to ignore SSL certs is chosen.
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/JMXRequestSender.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/JMXRequestSender.java
index 7250e9f..b1e0f83 100644
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/JMXRequestSender.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/JMXRequestSender.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,7 @@
import javax.management.NotificationListener;
import javax.management.ObjectName;
+import static com.oracle.coherence.plugin.visualvm.helper.HttpRequestSender.PART_STATS;
import static com.oracle.coherence.plugin.visualvm.panel.CoherenceTopicPanel.NOTIFY_POPULATED;
/**
@@ -117,7 +118,7 @@ public Set getAllCacheMembers()
public void invokeStorageManagerOperation(String sService, String sCacheName, String sOperation)
throws Exception
{
- ObjectName objectName = new ObjectName("Coherence:type=StorageManager,service=" + sService + ",cache=" + sCacheName + ",*");
+ ObjectName objectName = new ObjectName(STORAGE_MANAGER_EQUALS + sService + CACHE_EQUALS + sCacheName + ",*");
Set setResult = getCompleteObjectName(objectName);
String sFQN = getFirstResult(setResult);
@@ -125,6 +126,19 @@ public void invokeStorageManagerOperation(String sService, String sCacheName, St
invoke(new ObjectName(sFQN), sOperation, new Object[]{}, new String[]{});
}
+ @Override
+ public String invokeReportPartitionsStatsOperation(String sService, String sCacheName)
+ throws Exception
+ {
+ ObjectName objectName = new ObjectName(STORAGE_MANAGER_EQUALS + sService + CACHE_EQUALS + sCacheName + ",*");
+
+ Set setResult = getCompleteObjectName(objectName);
+ String sFQN = getFirstResult(setResult);
+
+ return (String) invoke(new ObjectName(sFQN), PART_STATS, new Object[]{"json"}, new String[]{String.class.getName()});
+ }
+
+
@Override
public Set getAllJournalMembers(String sJournalType)
throws Exception
@@ -147,9 +161,9 @@ public Set getCacheStorageMembers(String sServiceName, String sCache
throws Exception
{
- return f_connection.queryNames(new ObjectName("Coherence:type=StorageManager,service="
+ return f_connection.queryNames(new ObjectName(STORAGE_MANAGER_EQUALS
+ sServiceName + (sDomainPartition != null ? DOMAIN_PARTITION + sDomainPartition : "")
- + ",cache=" + sCacheName + ",*"), null);
+ + CACHE_EQUALS + sCacheName + ",*"), null);
}
@Override
@@ -242,6 +256,13 @@ public Set getAllProxyServerMembers()
return f_connection.queryNames(new ObjectName("Coherence:type=ConnectionManager,*"), null);
}
+ @Override
+ public Set getViewMembers(String sServiceName, String sViewName)
+ throws Exception
+ {
+ return f_connection.queryNames(new ObjectName("Coherence:type=View,service=" + sServiceName + NAME + sViewName + ",*"), null);
+ }
+
@Override
public Set getProxyConnections(String sServiceName, int nNodeId)
throws Exception
@@ -641,10 +662,12 @@ private String getFirstResult(Set setResult)
*/
private static final Logger LOGGER = Logger.getLogger(JMXRequestSender.class.getName());
- private static final String DOMAIN_PARTITION = ",domainPartition=";
- private static final String NAME = ",name=";
- private static final String CLUSTER = "Coherence:type=Cluster,*";
- private static final String COHERENCE_TYPE_NODE = "Coherence:type=Node,nodeId=";
+ private static final String DOMAIN_PARTITION = ",domainPartition=";
+ private static final String NAME = ",name=";
+ private static final String CLUSTER = "Coherence:type=Cluster,*";
+ private static final String COHERENCE_TYPE_NODE = "Coherence:type=Node,nodeId=";
+ private static final String CACHE_EQUALS = ",cache=";
+ private static final String STORAGE_MANAGER_EQUALS = "Coherence:type=StorageManager,service=";
// ------ data members --------------------------------------------------
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/RequestSender.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/RequestSender.java
index 82abeab..a941f1c 100644
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/RequestSender.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/RequestSender.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -102,6 +102,17 @@ Set getAllCacheMembers()
void invokeStorageManagerOperation(String sService, String sCacheName, String sOperation)
throws Exception;
+ /**
+ * Invoke the reportPartitionStats Storage Manager operation.
+ *
+ * @param sService the name of the service
+ * @param sCacheName the name of the cache
+ *
+ * @throws Exception in case of errors
+ */
+ String invokeReportPartitionsStatsOperation(String sService, String sCacheName)
+ throws Exception;
+
/**
* Return the list of all journal member ObjectNames in the cluster.
*
@@ -273,6 +284,15 @@ Set getMembersOfService(String sServiceName, String sDomainPartition
Set getAllProxyServerMembers()
throws Exception;
+ /**
+ * Get the list of View MBeans.
+ *
+ * @return list of view MBeans
+ * @throws Exception in case of errors
+ */
+ Set getViewMembers(String sServiceName, String sViewName)
+ throws Exception;
+
/**
* Get the list of Connection MBeans in the cluster for a service and node.
* @param sServiceName service name
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/AbstractCoherencePanel.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/AbstractCoherencePanel.java
index 97f60a2..7b436da 100755
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/AbstractCoherencePanel.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/AbstractCoherencePanel.java
@@ -36,6 +36,7 @@
import com.oracle.coherence.plugin.visualvm.helper.RequestSender;
import com.oracle.coherence.plugin.visualvm.tablemodel.model.Data;
import com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationData;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.MachineData;
import com.oracle.coherence.plugin.visualvm.tablemodel.model.MemberData;
import com.oracle.coherence.plugin.visualvm.tablemodel.model.NodeStorageData;
import com.oracle.coherence.plugin.visualvm.VisualVMModel;
@@ -88,6 +89,8 @@
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.MB;
+
/**
* An abstract implementation of a {@link JPanel} which provides basic support
@@ -296,9 +299,9 @@ protected String getFullyQualifiedName(RequestSender requestSender, String sQuer
* @param nodeId the node id to check
* @return true if the node is storage-enabled
*/
- protected boolean isNodeStorageEnabled(int nodeId)
+ public static boolean isNodeStorageEnabled(VisualVMModel model, int nodeId)
{
- List> nodeStorageData = f_model.getData(VisualVMModel.DataType.NODE_STORAGE);
+ List> nodeStorageData = model.getData(VisualVMModel.DataType.NODE_STORAGE);
if (nodeStorageData != null)
{
@@ -773,8 +776,111 @@ protected static String getServiceName(String sSelectedServiceName)
{
String[] asParts = AbstractData.getDomainAndService(sSelectedServiceName);
return asParts[1];
+ }
+
+ /**
+ * Return the machineData data for overview and tracers.
+ *
+ * @param machineData member data to introspect
+ * @return the data, 0 = Integer, count
+ * 1 = Double, cTotalLoadAverage
+ * 2 = Double, cMax
+ */
+ public static Object[] getClusterLoadAverage(List> machineData)
+ {
+ int cCount = 0;
+ double cLoadAverage = 0;
+ double cMax = -1;
+ double cTotalLoadAverage = 0;
+
+ // work out the max and average load averages for the graph
+ if (machineData != null)
+ {
+ for (Map.Entry entry : machineData)
+ {
+ cCount++;
+ cLoadAverage = (Double) entry.getValue().getColumn(MachineData.SYSTEM_LOAD_AVERAGE);
+ cTotalLoadAverage += cLoadAverage;
+
+ if (cMax == -1 || cLoadAverage > cMax)
+ {
+ cMax = cLoadAverage;
+ }
+ }
}
+ return new Object[] {
+ cCount,
+ cTotalLoadAverage,
+ cMax
+ };
+ }
+
+ /**
+ * Return the member data for overview and tracers.
+ *
+ * @param memberData member data to introspect
+ * @return the data, 0 = Integer, count
+ * 1 = Integer, totalMemory
+ * 2 = Integer, usedMemory
+ * 3 = Float, totalPublisherRate
+ * 4 = Float = totalReceiverRate
+ * 5 = Float = minPublisherRate
+ * 6 = Float = minReceiverRate
+ */
+ public static Object[] getMemberMemoryRateData(VisualVMModel model, List> memberData)
+ {
+ int cTotalMemory = 0;
+ int cTotalMemoryUsed = 0;
+ float cTotalPublisherRate = 0.0f;
+ float cTotalReceiverRate = 0.0f;
+ float cMinPublisherRate = -1;
+ float cMinReceiverRate = -1;
+ int cCount = 0;
+
+ // get the min /max values for publisher and receiver success rates
+ if (memberData != null)
+ {
+ float cRate = 0;
+
+ for (Map.Entry entry : memberData)
+ {
+ // only include memory is the node is storage enabled
+ if (isNodeStorageEnabled(model, (Integer) entry.getValue().getColumn(MemberData.NODE_ID)))
+ {
+ cTotalMemory += (Integer) entry.getValue().getColumn(MemberData.MAX_MEMORY);
+ cTotalMemoryUsed += (Integer) entry.getValue().getColumn(MemberData.USED_MEMORY);
+ }
+
+ cCount++;
+ cRate = (Float) entry.getValue().getColumn(MemberData.PUBLISHER_SUCCESS);
+ cTotalPublisherRate += cRate;
+
+ if (cMinPublisherRate == -1 || cRate < cMinPublisherRate)
+ {
+ cMinPublisherRate = cRate;
+ }
+
+ cRate = (Float) entry.getValue().getColumn(MemberData.RECEIVER_SUCCESS);
+ cTotalReceiverRate += cRate;
+
+ if (cMinReceiverRate == -1 || cRate < cMinReceiverRate)
+ {
+ cMinReceiverRate = cRate;
+ }
+ }
+ }
+
+ return new Object[] {
+ cCount,
+ cTotalMemory,
+ cTotalMemoryUsed,
+ cTotalPublisherRate,
+ cTotalReceiverRate,
+ cMinPublisherRate,
+ cMinReceiverRate
+ };
+ }
/**
* Return the storage details.
@@ -800,7 +906,7 @@ protected Object[] getStorageDetails(List> memberData)
for (Map.Entry entry : memberData)
{
// only include memory if node is storage enabled
- if (isNodeStorageEnabled((Integer) entry.getValue().getColumn(MemberData.NODE_ID)))
+ if (isNodeStorageEnabled(f_model, (Integer) entry.getValue().getColumn(MemberData.NODE_ID)))
{
cStorageCount++;
cTotalMemory += (Integer) entry.getValue().getColumn(MemberData.MAX_MEMORY);
@@ -871,7 +977,7 @@ protected Object[] getPersistenceData(List> persistenceD
long cTotalBackup = (Long) entry.getValue().getColumn(PersistenceData.TOTAL_BACKUP_SPACE_USED_MB);
cTotalActiveSpace += cTotalActive == -1 ? 0 : cTotalActive;
- cTotalBackupSpace += cTotalBackup == -1 ? 0 : cTotalBackup * GraphHelper.MB;
+ cTotalBackupSpace += cTotalBackup == -1 ? 0 : cTotalBackup * MB;
cLatencyTotal += (Float) entry.getValue().getColumn(PersistenceData.AVERAGE_LATENCY);
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceCachePanel.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceCachePanel.java
index c22d5ef..0a0ce52 100755
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceCachePanel.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceCachePanel.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
import com.oracle.coherence.plugin.visualvm.tablemodel.CacheDetailTableModel;
import com.oracle.coherence.plugin.visualvm.tablemodel.CacheStorageManagerTableModel;
import com.oracle.coherence.plugin.visualvm.tablemodel.CacheTableModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.CacheViewTableModel;
import com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheData;
import com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheDetailData;
import com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheFrontDetailData;
@@ -72,6 +73,7 @@
import java.util.Map.Entry;
import java.util.Set;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.ViewData;
import javax.management.Attribute;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
@@ -135,20 +137,23 @@ public CoherenceCachePanel(VisualVMModel model)
pnlTop.setOpaque(false);
// create any table models required
- f_tmodel = new CacheTableModel(VisualVMModel.DataType.CACHE.getMetadata());
- f_tmodelDetail = new CacheDetailTableModel(VisualVMModel.DataType.CACHE_DETAIL.getMetadata());
+ f_tmodel = new CacheTableModel(VisualVMModel.DataType.CACHE.getMetadata());
+ f_tmodelDetail = new CacheDetailTableModel(VisualVMModel.DataType.CACHE_DETAIL.getMetadata());
f_tmodelFrontDetail = new CacheDetailTableModel(VisualVMModel.DataType.CACHE_FRONT_DETAIL.getMetadata());
- f_tmodelStorage = new CacheStorageManagerTableModel(VisualVMModel.DataType.CACHE_STORAGE_MANAGER.getMetadata());
+ f_tmodelStorage = new CacheStorageManagerTableModel(VisualVMModel.DataType.CACHE_STORAGE_MANAGER.getMetadata());
+ f_tmodelViews = new CacheViewTableModel(VisualVMModel.DataType.VIEW.getMetadata());
final ExportableJTable table = new ExportableJTable(f_tmodel, model);
- f_tableDetail = new ExportableJTable(f_tmodelDetail, model);
- f_tableFrontDetail = new ExportableJTable(f_tmodelFrontDetail, model);
- f_tableStorage = new ExportableJTable(f_tmodelStorage, model);
+ f_tableDetail = new ExportableJTable(f_tmodelDetail, model);
+ f_tableFrontDetail = new ExportableJTable(f_tmodelFrontDetail, model);
+ f_tableStorage = new ExportableJTable(f_tmodelStorage, model);
+ f_tableViews = new ExportableJTable(f_tmodelViews, model);
table.setPreferredScrollableViewportSize(new Dimension(500, table.getRowHeight() * 5));
f_tableDetail.setPreferredScrollableViewportSize(new Dimension(500, f_tableDetail.getRowHeight() * 3));
f_tableFrontDetail.setPreferredScrollableViewportSize(new Dimension(500, f_tableFrontDetail.getRowHeight() * 3));
f_tableStorage.setPreferredScrollableViewportSize(new Dimension(500, f_tableStorage.getRowHeight() * 3));
+ f_tableViews.setPreferredScrollableViewportSize(new Dimension(500, f_tableStorage.getRowHeight() * 3));
// define renderers for the columns
RenderHelper.setColumnRenderer(table, CacheData.CACHE_NAME, new RenderHelper.ToolTipRenderer());
@@ -162,6 +167,7 @@ public CoherenceCachePanel(VisualVMModel model)
RenderHelper.setHeaderAlignment(f_tableDetail, SwingConstants.CENTER);
RenderHelper.setHeaderAlignment(f_tableFrontDetail, SwingConstants.CENTER);
RenderHelper.setHeaderAlignment(f_tableStorage, SwingConstants.CENTER);
+ RenderHelper.setHeaderAlignment(f_tableViews, SwingConstants.CENTER);
RenderHelper.setColumnRenderer(f_tableDetail, CacheDetailData.CACHE_HITS, new RenderHelper.IntegerRenderer());
RenderHelper.setColumnRenderer(f_tableDetail, CacheDetailData.CACHE_MISSES, new RenderHelper.IntegerRenderer());
@@ -203,6 +209,10 @@ public CoherenceCachePanel(VisualVMModel model)
RenderHelper.setColumnRenderer(f_tableStorage, CacheStorageManagerData.INDEXING_TOTAL_MILLIS,
new RenderHelper.IntegerRenderer());
+ RenderHelper.setColumnRenderer(f_tableViews, ViewData.NODE_ID, new RenderHelper.IntegerRenderer());
+ RenderHelper.setColumnRenderer(f_tableViews, ViewData.SIZE, new RenderHelper.IntegerRenderer());
+ RenderHelper.setColumnRenderer(f_tableViews, ViewData.RECONNECT_INTERVAL, new RenderHelper.IntegerRenderer());
+
table.setIntercellSpacing(new Dimension(6, 3));
table.setRowHeight(table.getRowHeight() + 4);
@@ -215,6 +225,7 @@ public CoherenceCachePanel(VisualVMModel model)
new InvokeCacheOperationMenuOpen(model, m_requestSender, table, CLEAR)
});
+ setTablePadding(f_tableViews);
setTablePadding(f_tableDetail);
f_tableDetail.setMenuOptions(new MenuOption[] {new ShowDetailMenuOption(model, f_tableDetail, SELECTED_CACHE)});
@@ -224,7 +235,8 @@ public CoherenceCachePanel(VisualVMModel model)
setTablePadding(f_tableStorage);
f_tableStorage.setMenuOptions(new MenuOption[] {
new ShowDetailMenuOption(model, f_tableStorage, SELECTED_STORAGE),
- new ShowIndexInfoMenuOption(model, m_requestSender, f_tableStorage)
+ new ShowIndexInfoMenuOption(model, m_requestSender, f_tableStorage),
+ new ShowPartitionStatsMenuOption(model, m_requestSender, f_tableStorage)
});
// Create the scroll pane and add the table to it.
@@ -232,16 +244,20 @@ public CoherenceCachePanel(VisualVMModel model)
JScrollPane scrollPaneDetail = new JScrollPane(f_tableDetail);
JScrollPane scrollPaneStorage = new JScrollPane(f_tableStorage);
+ f_scrollPaneViews = new JScrollPane(f_tableViews);
f_scrollPaneFrontDetail = new JScrollPane(f_tableFrontDetail);
configureScrollPane(scrollPane, table);
configureScrollPane(scrollPaneDetail, f_tableDetail);
configureScrollPane(f_scrollPaneFrontDetail, f_tableFrontDetail);
+ configureScrollPane(f_scrollPaneViews, f_tableViews);
configureScrollPane(scrollPaneStorage, f_tableStorage);
+
scrollPane.setOpaque(false);
scrollPaneDetail.setOpaque(false);
scrollPaneStorage.setOpaque(false);
f_scrollPaneFrontDetail.setOpaque(false);
+ f_scrollPaneViews.setOpaque(false);
pnlTop.add(scrollPane, BorderLayout.CENTER);
pneSplit.add(pnlTop);
@@ -290,10 +306,11 @@ public CoherenceCachePanel(VisualVMModel model)
@Override
public void updateData()
{
- m_cacheData = f_model.getData(VisualVMModel.DataType.CACHE);
- m_cacheDetailData = f_model.getData(VisualVMModel.DataType.CACHE_DETAIL);
+ m_cacheData = f_model.getData(VisualVMModel.DataType.CACHE);
+ m_cacheDetailData = f_model.getData(VisualVMModel.DataType.CACHE_DETAIL);
m_cacheFrontDetailData = f_model.getData(VisualVMModel.DataType.CACHE_FRONT_DETAIL);
- m_cacheStorageData = f_model.getData(VisualVMModel.DataType.CACHE_STORAGE_MANAGER);
+ m_cacheStorageData = f_model.getData(VisualVMModel.DataType.CACHE_STORAGE_MANAGER);
+ m_viewData = f_model.getData(VisualVMModel.DataType.VIEW);
// zero out memory if the selected cache is FIXED unit calculator
Tuple selectedCache = f_model.getSelectedCache();
@@ -336,11 +353,19 @@ public void updateData()
// check if near cache is configured
m_isNearCacheConfigured = m_cacheFrontDetailData != null && !m_cacheFrontDetailData.isEmpty();
+ // check if view cache is configured
+ m_isViewCacheConfigured = m_viewData != null && !m_viewData.isEmpty();
+
if (m_isNearCacheConfigured)
{
f_tmodelFrontDetail.setDataList(m_cacheFrontDetailData);
}
+ if (m_isViewCacheConfigured)
+ {
+ f_tmodelViews.setDataList(m_viewData);
+ }
+
// if we are currently displaying the heat map then update it
if (m_currentHeatMap != null)
{
@@ -371,6 +396,23 @@ public void updateGUI()
}
}
+ if (m_isViewCacheConfigured)
+ {
+ if (!m_isViewTabAdded && f_pneTab != null)
+ {
+ f_pneTab.addTab(getLocalizedText("TAB_view_caches"), f_scrollPaneViews);
+ m_isViewTabAdded = true;
+ }
+ }
+ else
+ {
+ if (m_isViewTabAdded && f_pneTab != null)
+ {
+ f_pneTab.remove(f_scrollPaneViews);
+ m_isViewTabAdded = false;
+ }
+ }
+
if (m_cacheData != null)
{
f_txtTotalCaches.setText(String.format("%5d", m_cacheData.size()));
@@ -429,6 +471,7 @@ public void updateGUI()
fireTableDataChangedWithSelection(f_tableDetail, f_tmodelDetail);
fireTableDataChangedWithSelection(f_tableFrontDetail, f_tmodelFrontDetail);
fireTableDataChangedWithSelection(f_tableStorage, f_tmodelStorage);
+ fireTableDataChangedWithSelection(f_tableViews, f_tmodelViews);
if (f_model.getSelectedCache() != null)
{
@@ -495,6 +538,9 @@ public void valueChanged(ListSelectionEvent e)
f_tmodelFrontDetail.setDataList(null);
f_tmodelFrontDetail.fireTableDataChanged();
+ f_tmodelViews.setDataList(null);
+ f_tmodelViews.fireTableDataChanged();
+
f_txtMaxQueryDescription.setText("");
f_txtMaxQueryDuration.setText("");
m_cacheData = null;
@@ -531,7 +577,7 @@ protected class ShowIndexInfoMenuOption
// ----- constructors -----------------------------------------------
/**
- * Create a new menu option for displaying heat map.
+ * Create a new menu option for displaying index information.
*
* @param model the {@link VisualVMModel} to get collected data from
* @param requestSender the {@link MBeanServerConnection} to perform additional queries
@@ -673,6 +719,65 @@ public void actionPerformed(ActionEvent e)
private final String f_sMenuItem;
}
+ /**
+ * Right-click option to show index information.
+ */
+ protected class ShowPartitionStatsMenuOption
+ extends AbstractMenuOption
+ {
+
+ // ----- constructors -----------------------------------------------
+
+ /**
+ * Create a new menu option for displaying partition stats information.
+ *
+ * @param model the {@link VisualVMModel} to get collected data from
+ * @param requestSender the {@link MBeanServerConnection} to perform additional queries
+ * @param jtable the {@link ExportableJTable} that this applies to
+ */
+ public ShowPartitionStatsMenuOption(VisualVMModel model, RequestSender requestSender,
+ ExportableJTable jtable)
+ {
+ super(model, requestSender, jtable);
+ f_sMenuItem = getLocalizedText("LBL_cache_partition_stats");
+ }
+
+ // ----- AbstractMenuOption methods ---------------------------------
+
+ @Override
+ public String getMenuItem()
+ {
+ return f_sMenuItem;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ String sResult = "unknown";
+ Pair selectedCache = f_model.getSelectedCache();
+
+ try
+ {
+ sResult = m_requestSender.invokeReportPartitionsStatsOperation(selectedCache.getX(), selectedCache.getY());
+ showMessageDialog(Localization.getLocalText("LBL_cache_partition_stats"),
+ sResult, JOptionPane.INFORMATION_MESSAGE);
+ }
+ catch (Exception ee)
+ {
+ showMessageDialog(Localization.getLocalText("LBL_error"),
+ ee.getMessage(), JOptionPane.ERROR_MESSAGE);
+ }
+
+ }
+
+ // ----- data members ------------------------------------------------
+
+ /**
+ * Menu option description.
+ */
+ private final String f_sMenuItem;
+ }
+
/**
* Menu option to invoke clear or truncate against a cache. Only available in most recent versions of Coherence.
*/
@@ -848,7 +953,7 @@ public synchronized void updateData()
while (iter.hasNext())
{
Pair, Long> entryHeatMap = iter.next();
- if (entryHeatMap.getY().longValue() <= cache.getY().longValue())
+ if (entryHeatMap.getY() <= cache.getY())
{
// add new value at the current position
f_listValues.add(nLocation, cache);
@@ -1135,12 +1240,23 @@ private Color getColour()
*/
private boolean m_isNearCacheConfigured = false;
+ /**
+ * Flag to indicate if near view is configured.
+ */
+ private boolean m_isViewCacheConfigured = false;
+
/**
* Flag to indicate if we already added the front
* cache detail tab.
*/
private boolean m_isFrontCacheTabAdded = false;
+ /**
+ /**
+ * Flag to indicate if we already added the view cache tab.
+ */
+ private boolean m_isViewTabAdded = false;
+
/**
* The tabbed panel.
*/
@@ -1152,6 +1268,12 @@ private Color getColour()
*/
private final JScrollPane f_scrollPaneFrontDetail;
+ /**
+ * The scroll panel which we use to display front
+ * view details tab.
+ */
+ private final JScrollPane f_scrollPaneViews;
+
/**
* Total number of caches.
*/
@@ -1197,6 +1319,12 @@ private Color getColour()
*/
protected final CacheStorageManagerTableModel f_tmodelStorage;
+ /**
+ * The {@link CacheViewTableModel} to display cache viuews data.
+ */
+ protected final CacheViewTableModel f_tmodelViews;
+
+
/**
* The cache data retrieved from the {@link VisualVMModel}.
*/
@@ -1217,6 +1345,11 @@ private Color getColour()
*/
private List> m_cacheStorageData = null;
+ /**
+ * The storage view data retrieved from the {@link VisualVMModel}.
+ */
+ private transient List> m_viewData = null;
+
/**
* The row selection listener.
*/
@@ -1237,6 +1370,11 @@ private Color getColour()
*/
private final ExportableJTable f_tableStorage;
+ /**
+ * The {@link ExportableJTable} to use to display cache view data.
+ */
+ private final ExportableJTable f_tableViews;
+
/**
* Currently displaying heat map.
*/
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceClusterOverviewPanel.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceClusterOverviewPanel.java
index 9367ae1..c5d0e42 100755
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceClusterOverviewPanel.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceClusterOverviewPanel.java
@@ -185,46 +185,27 @@ public void updateGUI()
float cTotalReceiverRate = 0.0f;
float cMinPublisherRate = -1;
float cMinReceiverRate = -1;
+ int cCount = 0;
// get the min /max values for publisher and receiver success rates
if (m_memberData != null)
{
- int count = 0;
- float cRate = 0;
+ Object[] aoValues = getMemberMemoryRateData(f_model, m_memberData);
- for (Entry entry : m_memberData)
- {
- // only include memory is the node is storage enabled
- if (isNodeStorageEnabled((Integer) entry.getValue().getColumn(MemberData.NODE_ID)))
- {
- cTotalMemory += (Integer) entry.getValue().getColumn(MemberData.MAX_MEMORY);
- cTotalMemoryUsed += (Integer) entry.getValue().getColumn(MemberData.USED_MEMORY);
- }
-
- count++;
- cRate = (Float) entry.getValue().getColumn(MemberData.PUBLISHER_SUCCESS);
- cTotalPublisherRate += cRate;
-
- if (cMinPublisherRate == -1 || cRate < cMinPublisherRate)
- {
- cMinPublisherRate = cRate;
- }
-
- cRate = (Float) entry.getValue().getColumn(MemberData.RECEIVER_SUCCESS);
- cTotalReceiverRate += cRate;
-
- if (cMinReceiverRate == -1 || cRate < cMinReceiverRate)
- {
- cMinReceiverRate = cRate;
- }
- }
+ cCount = (Integer) aoValues[0];
+ cTotalMemory = (Integer) aoValues[1];
+ cTotalMemoryUsed = (Integer) aoValues[2];
+ cTotalPublisherRate = (Float) aoValues[3];
+ cTotalReceiverRate = (Float) aoValues[4];
+ cMinPublisherRate = (Float) aoValues[5];
+ cMinReceiverRate = (Float) aoValues[6];
// update the publisher graph
GraphHelper.addValuesToPublisherGraph(f_publisherGraph, cMinPublisherRate,
- count == 0 ? 0 : cTotalPublisherRate / count);
+ cCount == 0 ? 0 : cTotalPublisherRate / cCount);
GraphHelper.addValuesToReceiverGraph(f_receiverGraph, cMinReceiverRate,
- count == 0 ? 0 : cTotalReceiverRate / count);
+ cCount == 0 ? 0 : cTotalReceiverRate / cCount);
}
// update the memory graph
@@ -282,24 +263,17 @@ else if (bestStatusHA == 1)
}
int count = 0;
- double cLoadAverage = 0;
double cMax = -1;
double cTotalLoadAverage = 0;
// work out the max and average load averages for the graph
if (m_machineData != null)
{
- for (Entry entry : m_machineData)
- {
- count++;
- cLoadAverage = (Double) entry.getValue().getColumn(MachineData.SYSTEM_LOAD_AVERAGE);
- cTotalLoadAverage += cLoadAverage;
-
- if (cMax == -1 || cLoadAverage > cMax)
- {
- cMax = cLoadAverage;
- }
- }
+ Object[] aoValues = getClusterLoadAverage(m_machineData);
+
+ count = (Integer) aoValues[0];
+ cTotalLoadAverage = (Double) aoValues[1];
+ cMax = (Double) aoValues[2];
// update graph
GraphHelper.addValuesToLoadAverageGraph(f_loadAverageGraph, (float) cMax,
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceMemberPanel.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceMemberPanel.java
index 3f54f92..0c4527e 100755
--- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceMemberPanel.java
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/panel/CoherenceMemberPanel.java
@@ -284,7 +284,7 @@ public void updateData()
{
Data data = entry.getValue();
int nodeId = (Integer) entry.getKey();
- if (!isNodeStorageEnabled(nodeId))
+ if (!isNodeStorageEnabled(f_model, nodeId))
{
data.setColumn(MemberData.STORAGE_ENABLED, "false");
}
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tablemodel/CacheViewTableModel.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tablemodel/CacheViewTableModel.java
new file mode 100644
index 0000000..55080bf
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tablemodel/CacheViewTableModel.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.coherence.plugin.visualvm.tablemodel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.Data;
+
+/**
+ * A model for holding cache view data.
+ *
+ * @author tam 2024.02.27
+ * @since 1.7.0
+ */
+public class CacheViewTableModel
+ extends AbstractCoherenceTableModel
+ {
+ // ----- constructors ---------------------------------------------------
+
+ /**
+ * Creates a table model with the given columns.
+ *
+ * @param asColumns the columns for this table model
+ */
+ public CacheViewTableModel(String[] asColumns)
+ {
+ super(asColumns);
+ }
+
+ // ----- constants ---------------------------------------------------000
+
+ private static final long serialVersionUID = -8873208446231524540L;
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tablemodel/model/ViewData.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tablemodel/model/ViewData.java
new file mode 100755
index 0000000..58c8d36
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tablemodel/model/ViewData.java
@@ -0,0 +1,287 @@
+/*
+ * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tablemodel.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import static com.oracle.coherence.plugin.visualvm.helper.JMXUtils.getAttributeValueAsString;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.helper.HttpRequestSender;
+import com.oracle.coherence.plugin.visualvm.helper.RequestSender;
+
+import javax.management.AttributeList;
+import javax.management.ObjectName;
+
+/**
+ * A class to hold basic view data.
+ *
+ * @author tam 2024.02.26
+ * @since 1.7.0
+ */
+public class ViewData
+ extends AbstractData
+ {
+ // ----- constructors ---------------------------------------------------
+
+ /**
+ * Create ViewData passing in the number of columns.
+ */
+ public ViewData()
+ {
+ super(CACHE_VALUES + 1);
+ }
+
+ // ----- DataRetriever methods ------------------------------------------
+
+ @Override
+ public List> getJMXData(RequestSender requestSender, VisualVMModel model)
+ {
+ SortedMap mapData = new TreeMap<>();
+ Data data;
+ Pair selectedCache = model.getSelectedCache();
+ if (selectedCache == null)
+ {
+ return null;
+ }
+
+ try
+ {
+ Set viewNamesSet = requestSender.getViewMembers(selectedCache.getX(), selectedCache.getY());
+
+ for (Iterator nodIter = viewNamesSet.iterator(); nodIter.hasNext(); )
+ {
+ ObjectName viewNameObjName = nodIter.next();
+
+ data = new ViewData();
+
+ AttributeList listAttr = requestSender.getAttributes(viewNameObjName,
+ new String[] { ATTR_TRANSFORMED, ATTR_FILTER, ATTR_TRANSFORMER, ATTR_CACHE_VALUES,
+ ATTR_SIZE, ATTR_READ_ONLY, ATTR_RECONNECT_INTERVAL});
+
+ data.setColumn(ViewData.NODE_ID, Integer.valueOf(viewNameObjName.getKeyProperty("nodeId")));
+ data.setColumn(ViewData.SIZE, Integer.parseInt(getAttributeValueAsString(listAttr, ATTR_SIZE)));
+
+ data.setColumn(ViewData.RECONNECT_INTERVAL, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_SIZE)));
+ data.setColumn(ViewData.FILTER, getAttributeValueAsString(listAttr, ATTR_FILTER));
+ data.setColumn(ViewData.TRANSFORMED, getAttributeValueAsString(listAttr, ATTR_TRANSFORMED));
+ data.setColumn(ViewData.TRANSFORMER, getAttributeValueAsString(listAttr, ATTR_TRANSFORMER));
+ data.setColumn(ViewData.READ_ONLY, getAttributeValueAsString(listAttr, ATTR_READ_ONLY));
+ data.setColumn(ViewData.CACHE_VALUES, getAttributeValueAsString(listAttr, ATTR_CACHE_VALUES));
+
+ mapData.put(data.getColumn(ViewData.NODE_ID), data);
+ }
+
+ return new ArrayList<>(mapData.entrySet());
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Error getting view statistics", e);
+
+ return null;
+ }
+ }
+
+ @Override
+ public String getReporterReport()
+ {
+ return REPORT_VIEW;
+ }
+
+ @Override
+ public String preProcessReporterXML(VisualVMModel model, String sReporterXML)
+ {
+ // the report XML contains the following tokens that require substitution: %SERVICE_NAME% and %VIEW_NAME%
+ Pair selectedCache = model.getSelectedCache();
+ String sServiceName = "";
+ String sViewName = "";
+ if (selectedCache != null)
+ {
+ sServiceName = selectedCache.getX();
+ sViewName = selectedCache.getY();
+ }
+
+ return sServiceName == null ? sReporterXML :
+ sReporterXML.replaceAll("%SERVICE_NAME%", escape(sServiceName))
+ .replaceAll("%VIEW_NAME%", escape(sViewName));
+ }
+
+ @Override
+ public Data processReporterData(Object[] aoColumns, VisualVMModel model)
+ {
+ Data data = new ViewData();
+
+ data.setColumn(NODE_ID, Integer.valueOf(getNumberValue(aoColumns[2].toString())));
+ data.setColumn(SIZE, Integer.valueOf(getNumberValue(aoColumns[3].toString())));
+ data.setColumn(RECONNECT_INTERVAL, Long.valueOf(getNumberValue(aoColumns[4].toString())));
+ data.setColumn(FILTER, aoColumns[5].toString());
+ data.setColumn(TRANSFORMED, Boolean.toString(Boolean.parseBoolean(aoColumns[6].toString())));
+ Object sTransformer = aoColumns[7];
+ data.setColumn(TRANSFORMER, "".equals(sTransformer) || "null".equals(sTransformer) || sTransformer == null ? "n/a" : sTransformer.toString());
+ data.setColumn(READ_ONLY, Boolean.toString(Boolean.parseBoolean(aoColumns[8].toString())));
+ data.setColumn(CACHE_VALUES, Boolean.toString(Boolean.parseBoolean(aoColumns[9].toString())));
+
+ return data;
+ }
+
+ @Override
+ public SortedMap getAggregatedDataFromHttpQuerying(VisualVMModel model,
+ HttpRequestSender requestSender)
+ throws Exception
+ {
+ SortedMap mapData = new TreeMap();
+ Pair selectedCache = model.getSelectedCache();
+
+ if (selectedCache == null)
+ {
+ return mapData;
+ }
+
+ JsonNode rootNode = requestSender.getDataForViews(selectedCache.getX(), selectedCache.getY());
+
+ JsonNode viewMemberItems = rootNode.get("items");
+ if (viewMemberItems != null && viewMemberItems.isArray())
+ {
+ for (int k = 0; k < (viewMemberItems).size(); k++)
+ {
+ JsonNode viewNode = viewMemberItems.get(k);
+
+ ViewData data = new ViewData();
+
+ data.setColumn(NODE_ID, viewNode.get("nodeId").asInt());
+ data.setColumn(SIZE, viewNode.get("size").asInt());
+ data.setColumn(RECONNECT_INTERVAL, viewNode.get("reconnectInterval").asLong());
+ data.setColumn(FILTER, viewNode.get("filter").asText());
+ data.setColumn(TRANSFORMED, Boolean.toString(viewNode.get("transformed").asBoolean()));
+ data.setColumn(READ_ONLY, Boolean.toString(viewNode.get("readOnly").asBoolean()));
+ data.setColumn(CACHE_VALUES, Boolean.toString(viewNode.get("cacheValues").asBoolean()));
+ JsonNode transformer = viewNode.get("transformer");
+ data.setColumn(TRANSFORMER, transformer == null || "null".equals(transformer.asText()) ? "n/a" : transformer.asText());
+
+ mapData.put(data.getColumn(NODE_ID), data);
+ }
+ }
+ return mapData;
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final long serialVersionUID = 1789858484301825295L;
+
+ /**
+ * Array index for Node id.
+ */
+ public static final int NODE_ID = 0;
+
+ /**
+ * Array index for Size.
+ */
+ public static final int SIZE = 1;
+
+ /**
+ * Array index for ReconnectInterval.
+ */
+ public static final int RECONNECT_INTERVAL = 2;
+
+ /**
+ * Array index for Filter.
+ */
+ public static final int FILTER = 3;
+
+ /**
+ * Array index for Transformed.
+ */
+ public static final int TRANSFORMED = 4;
+
+ /**
+ * Array index for Transformer.
+ */
+ public static final int TRANSFORMER = 5;
+
+ /**
+ * Array index for ReadOnly
+ */
+ public static final int READ_ONLY = 6;
+
+ /**
+ * Array index for CacheValues.
+ */
+ public static final int CACHE_VALUES = 7;
+
+ /**
+ * The logger object to use.
+ */
+ private static final Logger LOGGER = Logger.getLogger(ViewData.class.getName());
+
+ /**
+ * Report for proxy server data.
+ */
+ public static final String REPORT_VIEW = "reports/visualvm/view-details.xml";
+
+ /**
+ * JMX attribute name for Size.
+ */
+ private static final String ATTR_SIZE = "Size";
+
+ /**
+ * JMX attribute name for ReconnectInterval.
+ */
+ private static final String ATTR_RECONNECT_INTERVAL = "ReconnectInterval";
+
+ /**
+ * JMX attribute name for Filter.
+ */
+ private static final String ATTR_FILTER= "Filter";
+
+ /**
+ * JMX attribute name for Transformed.
+ */
+ private static final String ATTR_TRANSFORMED = "Transformed";
+
+ /**
+ * JMX attribute name for Transformer.
+ */
+ private static final String ATTR_TRANSFORMER = "Transformer";
+
+ /**
+ * JMX attribute name for ReadOnly.
+ */
+ private static final String ATTR_READ_ONLY = "ReadOnly";
+
+ /**
+ * JMX attribute name for CacheValues.
+ */
+ private static final String ATTR_CACHE_VALUES = "CacheValues";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/AbstractCoherenceMonitorProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/AbstractCoherenceMonitorProbe.java
new file mode 100644
index 0000000..d7b997c
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/AbstractCoherenceMonitorProbe.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.coherence.plugin.visualvm.tracer;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.Data;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import org.graalvm.visualvm.application.Application;
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbe;
+import org.openide.util.ImageUtilities;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import static com.oracle.coherence.plugin.visualvm.VisualVMView.IMAGE_PATH;
+
+/**
+ * Abstract implementations of a Coherence {@link TracerProbe}.
+ * @author tam 2024.03.03
+ */
+public abstract class AbstractCoherenceMonitorProbe
+ extends TracerProbe
+ {
+
+ // ----- constructors ---------------------------------------------------
+
+ public AbstractCoherenceMonitorProbe(int valuesCount, ProbeItemDescriptor[] itemDescriptors,
+ MonitoredDataResolver resolver)
+ {
+ super(itemDescriptors);
+ this.f_nValuesCount = valuesCount;
+ this.f_resolver = resolver;
+ }
+
+ public final synchronized long[] getItemValues(long timestamp)
+ {
+ VisualVMModel model = f_resolver.getMonitoredData();
+ if (model != null)
+ {
+ return getValues(model);
+ }
+
+ long[] noData = new long[f_nValuesCount];
+ Arrays.fill(noData, ProbeItemDescriptor.VALUE_UNDEFINED);
+ return noData;
+ }
+
+ protected static String getMonitorsString(String sKey)
+ {
+ return Localization.getLocalText("LBL_monitors") + " " + Localization.getLocalText(sKey);
+ }
+
+ protected abstract long[] getValues(VisualVMModel model);
+
+ public interface MonitoredDataResolver
+ {
+ VisualVMModel getMonitoredData();
+ }
+
+ protected long getValueAsLong(Object oValue)
+ {
+ if (oValue instanceof Long)
+ {
+ return (Long)oValue;
+ }
+ if (oValue instanceof Integer)
+ {
+ return ((Integer)oValue);
+ }
+ if (oValue instanceof String)
+ {
+ return Long.parseLong((String) oValue);
+ }
+ return 0L;
+ }
+
+ /**
+ * Returns a single value from a data type.
+ * @param model the {@link VisualVMModel} to use
+ * @param dataType the {@link VisualVMModel.DataType} to query
+ * @param nColumn the column to extract
+ * @param aDefault default value
+ *
+ * @return the tracer result
+ */
+ protected long[] getSingValue(VisualVMModel model, VisualVMModel.DataType dataType, int nColumn, long[] aDefault)
+ {
+ List> data = model.getData(dataType);
+ if (data == null || data.isEmpty())
+ {
+ return aDefault;
+ }
+
+ return new long[] {getValueAsLong(data.get(0).getValue().getColumn(nColumn))};
+ }
+
+ /**
+ * Returns the sum of a single value from all entries for a datatype.
+ * @param model the {@link VisualVMModel} to use
+ * @param dataType the {@link VisualVMModel.DataType} to query
+ * @param nColumn the column to extract
+ * @param aDefault default value
+ *
+ * @return the tracer result
+ */
+ protected long[] getSingValueSum(VisualVMModel model, VisualVMModel.DataType dataType, int nColumn, long[] aDefault)
+ {
+ List> data = model.getData(dataType);
+ long nSum = 0L;
+
+ if (data != null && !data.isEmpty())
+ {
+ for (Map.Entry entry : data)
+ {
+ nSum += getValueAsLong(entry.getValue().getColumn(nColumn));
+ }
+ }
+
+ return new long[] {nSum};
+ }
+
+ /**
+ * Returns the max of a single value from all entries for a datatype.
+ * @param model the {@link VisualVMModel} to use
+ * @param dataType the {@link VisualVMModel.DataType} to query
+ * @param nColumn the column to extract
+ * @param aDefault default value
+ *
+ * @return the tracer result
+ */
+ protected long[] getSingValueMax(VisualVMModel model, VisualVMModel.DataType dataType, int nColumn, long[] aDefault)
+ {
+ List> data = model.getData(dataType);
+ long nMax = 0L;
+ long nValue = 0L;
+
+ if (data != null && !data.isEmpty())
+ {
+ for (Map.Entry entry : data)
+ {
+ nValue = getValueAsLong(entry.getValue().getColumn(nColumn));
+
+ if (nValue > nMax)
+ {
+ nMax = nValue;
+ }
+ }
+ }
+
+ return new long[] {nMax};
+ }
+
+ // ----- data members ---------------------------------------------------
+
+ private final MonitoredDataResolver f_resolver;
+
+ private final int f_nValuesCount;
+
+ protected static final long[] ZERO_VALUES2 = new long[]{0L,0L};
+ protected static final long[] ZERO_VALUES1 = new long[]{0L};
+
+ // ----- constants ------------------------------------------------------
+
+ public static final Icon ICON = new ImageIcon(ImageUtilities.loadImage(IMAGE_PATH, true)); // NOI18N
+
+ public static final ItemValueFormatter CUSTOM_FORMATTER = new CustomFormatter(1000, "");
+
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/CustomFormatter.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/CustomFormatter.java
new file mode 100644
index 0000000..4a38b2e
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/CustomFormatter.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import java.text.NumberFormat;
+
+/**
+ * A customer formatter.
+ *
+ * @author tam 2024.03.04
+ */
+public class CustomFormatter
+ extends ItemValueFormatter {
+
+ // ----- constructors ---------------------------------------------------
+
+ public CustomFormatter(int factor, String units)
+ {
+ this.m_nFactor = factor;
+ this.m_sUnits = units;
+ }
+
+ @Override
+ public String formatValue(long value, int format)
+ {
+ return FORMAT.format(value / (double) this.m_nFactor);
+ }
+
+ @Override
+ public String getUnits(int format)
+ {
+ return this.m_sUnits;
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final NumberFormat FORMAT = NumberFormat.getInstance();
+
+ // ----- data members ---------------------------------------------------
+
+ private final int m_nFactor;
+ private final String m_sUnits;
+
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/CacheMemorySizeProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/CacheMemorySizeProbe.java
new file mode 100644
index 0000000..d2106da
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/CacheMemorySizeProbe.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.cache;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheData;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the total memory size of all caches across all services.
+ *
+ * @author tam 2024.03.03
+ */
+public class CacheMemorySizeProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public CacheMemorySizeProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.CACHE, CacheData.MEMORY_USAGE_BYTES, ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_cache_memory_size_desc"), ICON, 10, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_BYTES,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_total_cache";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/CacheMonitorPackage.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/CacheMonitorPackage.java
new file mode 100644
index 0000000..749d709
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/CacheMonitorPackage.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.cache;
+
+import static com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe.ICON;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.VisualVMView;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.application.Application;
+
+import org.graalvm.visualvm.modules.tracer.TracerPackage;
+import org.graalvm.visualvm.modules.tracer.TracerProbe;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+
+/**
+ * A {@link TracerPackage} to show cache related probes.
+ *
+ * @author tam 2024.03.06
+ */
+public class CacheMonitorPackage
+ extends TracerPackage implements AbstractCoherenceMonitorProbe.MonitoredDataResolver {
+
+ public CacheMonitorPackage(Application application)
+ {
+ super(NAME, DESCR, ICON, POSITION);
+ this.f_model = VisualVMView.getModelForApplication(application);
+ }
+
+ // ---- TracerPackage methods -------------------------------------------
+
+ @Override
+ public TracerProbeDescriptor[] getProbeDescriptors() {
+ m_memorySizeProbeDescriptor = CacheMemorySizeProbe.createDescriptor(f_model != null);
+ m_SizeProbeDescriptor = CacheSizeProbe.createDescriptor(f_model != null);
+
+ return new TracerProbeDescriptor[] {
+ m_memorySizeProbeDescriptor,
+ m_SizeProbeDescriptor
+ };
+ }
+
+ @Override
+ public TracerProbe getProbe(TracerProbeDescriptor descriptor)
+ {
+ if (descriptor == m_memorySizeProbeDescriptor)
+ {
+ if (m_memorySizeProbe == null)
+ {
+ m_memorySizeProbe = new CacheMemorySizeProbe(this);
+ }
+ return m_memorySizeProbe;
+ }
+ else if (descriptor == m_SizeProbeDescriptor)
+ {
+ if (m_SizeProbe == null)
+ {
+ m_SizeProbe = new CacheSizeProbe(this);
+ }
+ return m_SizeProbe;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ // ---- AbstractCoherenceMonitorProbe.MonitoredDataResolver interface ---
+
+ @Override
+ public VisualVMModel getMonitoredData()
+ {
+ return f_model;
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String NAME = Localization.getLocalText("LBL_cache_probe");
+ private static final String DESCR = Localization.getLocalText("LBL_cache_probe_description");
+ private static final int POSITION = 20510;
+
+ private TracerProbeDescriptor m_memorySizeProbeDescriptor;
+ private TracerProbeDescriptor m_SizeProbeDescriptor;
+
+ private AbstractCoherenceMonitorProbe m_memorySizeProbe;
+ private AbstractCoherenceMonitorProbe m_SizeProbe;
+
+ private final VisualVMModel f_model;
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/CacheSizeProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/CacheSizeProbe.java
new file mode 100644
index 0000000..91f6230
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cache/CacheSizeProbe.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.cache;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the total number of cache entries across all services.
+ *
+ * @author tam 2024.03.03
+ */
+public class CacheSizeProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public CacheSizeProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.CACHE, CacheData.SIZE, ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_cache_size_desc"), ICON, 10, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_size";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/ClusterMonitorPackage.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/ClusterMonitorPackage.java
new file mode 100644
index 0000000..7239089
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/ClusterMonitorPackage.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.cluster;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.VisualVMView;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.application.Application;
+
+import org.graalvm.visualvm.modules.tracer.TracerPackage;
+import org.graalvm.visualvm.modules.tracer.TracerProbe;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+import static com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe.ICON;
+
+
+/**
+ * A {@link TracerPackage} to show cluster related probes.
+ *
+ * @author tam 2024.03.04
+ */
+public class ClusterMonitorPackage
+ extends TracerPackage implements AbstractCoherenceMonitorProbe.MonitoredDataResolver {
+
+ public ClusterMonitorPackage(Application application)
+ {
+ super(NAME, DESCR, ICON, POSITION);
+ this.f_model = VisualVMView.getModelForApplication(application);
+ }
+
+ // ---- TracerPackage methods -------------------------------------------
+
+ @Override
+ public TracerProbeDescriptor[] getProbeDescriptors() {
+ m_heapProbeDescriptor = StorageMembersHeapProbe.createDescriptor(f_model != null);
+ m_clusterSizeProbeDescriptor = ClusterSizeProbe.createDescriptor(f_model != null);
+ m_departureCountProbeDescriptor = DepartureCountProbe.createDescriptor(f_model != null);
+ m_packetPublisherProbeDescriptor = PacketPublisherProbe.createDescriptor(f_model != null);
+ m_packetReceiverProbeDescriptor = PacketReceiverProbe.createDescriptor(f_model != null);
+ m_loadAverageProbeDescriptor = LoadAverageProbe.createDescriptor(f_model != null);
+
+ return new TracerProbeDescriptor[] {
+ m_heapProbeDescriptor,
+ m_clusterSizeProbeDescriptor,
+ m_departureCountProbeDescriptor,
+ m_packetPublisherProbeDescriptor,
+ m_packetReceiverProbeDescriptor,
+ m_loadAverageProbeDescriptor,
+ };
+ }
+
+ @Override
+ public TracerProbe getProbe(TracerProbeDescriptor descriptor)
+ {
+ if (descriptor == m_heapProbeDescriptor)
+ {
+ if (m_heapProbe == null)
+ {
+ m_heapProbe = new StorageMembersHeapProbe(this);
+ }
+ return m_heapProbe;
+ }
+ else if (descriptor == m_clusterSizeProbeDescriptor)
+ {
+ if (m_clusterSizeProbe == null)
+ {
+ m_clusterSizeProbe = new ClusterSizeProbe(this);
+ }
+ return m_clusterSizeProbe;
+ }
+ else if (descriptor == m_departureCountProbeDescriptor)
+ {
+ if (m_departureCountProbe == null)
+ {
+ m_departureCountProbe = new DepartureCountProbe(this);
+ }
+ return m_departureCountProbe;
+ }
+ else if (descriptor == m_packetPublisherProbeDescriptor)
+ {
+ if (m_packetPublisherProbe == null)
+ {
+ m_packetPublisherProbe = new PacketPublisherProbe(this);
+ }
+ return m_packetPublisherProbe;
+ }
+ else if (descriptor == m_packetReceiverProbeDescriptor)
+ {
+ if (m_packetReceiverProbe == null)
+ {
+ m_packetReceiverProbe = new PacketReceiverProbe(this);
+ }
+ return m_packetReceiverProbe;
+ }
+ else if (descriptor == m_loadAverageProbeDescriptor)
+ {
+ if (m_loadAverageProbe == null)
+ {
+ m_loadAverageProbe = new LoadAverageProbe(this);
+ }
+ return m_loadAverageProbe;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ // ---- AbstractCoherenceMonitorProbe.MonitoredDataResolver interface ---
+
+ @Override
+ public VisualVMModel getMonitoredData()
+ {
+ return f_model;
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String NAME = Localization.getLocalText("LBL_cluster_probe");
+ private static final String DESCR = Localization.getLocalText("LBL_cluster_probe_description");
+ private static final int POSITION = 20500;
+
+ private TracerProbeDescriptor m_heapProbeDescriptor;
+ private TracerProbeDescriptor m_clusterSizeProbeDescriptor;
+ private TracerProbeDescriptor m_departureCountProbeDescriptor;
+ private TracerProbeDescriptor m_packetPublisherProbeDescriptor;
+ private TracerProbeDescriptor m_packetReceiverProbeDescriptor;
+ private TracerProbeDescriptor m_loadAverageProbeDescriptor;
+
+ private AbstractCoherenceMonitorProbe m_heapProbe;
+ private AbstractCoherenceMonitorProbe m_clusterSizeProbe;
+ private AbstractCoherenceMonitorProbe m_departureCountProbe;
+ private AbstractCoherenceMonitorProbe m_packetPublisherProbe;
+ private AbstractCoherenceMonitorProbe m_packetReceiverProbe;
+ private AbstractCoherenceMonitorProbe m_loadAverageProbe;
+
+ private final VisualVMModel f_model;
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/ClusterSizeProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/ClusterSizeProbe.java
new file mode 100644
index 0000000..3ad7aea
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/ClusterSizeProbe.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.cluster;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.ClusterData;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.Data;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.MemberData;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+import java.util.List;
+import java.util.Map;
+
+import static com.oracle.coherence.plugin.visualvm.panel.AbstractCoherencePanel.isNodeStorageEnabled;
+
+/**
+ * Tracer probe to return the cluster size.
+ *
+ * @author tam 2024.03.03
+ */
+public class ClusterSizeProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public ClusterSizeProbe(MonitoredDataResolver resolver)
+ {
+ super(12, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ long nTotalMembers = getSingValue(model, VisualVMModel.DataType.CLUSTER, ClusterData.CLUSTER_SIZE, ZERO_VALUES1)[0];
+ long nStorageCount = 0L;
+
+ // determine the number of storage-enabled members
+ for (Map.Entry entry : model.getData(VisualVMModel.DataType.MEMBER))
+ {
+ // only include memory is the node is storage enabled
+ if (isNodeStorageEnabled(model, (Integer) entry.getValue().getColumn(MemberData.NODE_ID)))
+ {
+ nStorageCount++;
+ }
+ }
+ return new long[]{nTotalMembers, nStorageCount};
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText("LBL_cluster_members"),
+ Localization.getLocalText("LBL_members_desc"), ICON, 5, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL2),
+ getMonitorsString(LBL2), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_total_members";
+ private static final String LBL2 = "LBL_total_storage_members";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/DepartureCountProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/DepartureCountProbe.java
new file mode 100644
index 0000000..400f5cc
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/DepartureCountProbe.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.cluster;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.ClusterData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the members left.
+ *
+ * @author tam 2024.03.03
+ */
+public class DepartureCountProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+
+ public DepartureCountProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValue(model, VisualVMModel.DataType.CLUSTER, ClusterData.DEPARTURE_COUNT, ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_departure_count"), ICON, 10, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_member_departure_count";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/LoadAverageProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/LoadAverageProbe.java
new file mode 100644
index 0000000..accd272
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/LoadAverageProbe.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.cluster;
+
+import java.util.List;
+import java.util.Map;
+
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.GRPH_CURRENT_AVERAGE;
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.GRPH_MAXIMUM;
+import static com.oracle.coherence.plugin.visualvm.panel.AbstractCoherencePanel.getClusterLoadAverage;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.Data;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return average and max load average.
+ *
+ * @author tam 2024.03.03
+ */
+public class LoadAverageProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public LoadAverageProbe(MonitoredDataResolver resolver)
+ {
+ super(2, LoadAverageProbe.createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ List> data = model.getData(VisualVMModel.DataType.MACHINE);
+ if (data == null || data.isEmpty())
+ {
+ return ZERO_VALUES2;
+ }
+
+ Object[] aoValues = getClusterLoadAverage(data);
+
+ int cCount = (Integer) aoValues[0];
+ double cTotalLoadAverage = (Double) aoValues[1];
+ double cMax = (Double) aoValues[2];
+
+ return new long[]
+ {
+ (long) ((cTotalLoadAverage / (cCount * 1.0f)) * 1000),
+ (long) (cMax * 1000)
+ };
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText("GRPH_load_average"),
+ Localization.getLocalText("LBL_load_average_desc"), ICON, 15, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(GRPH_CURRENT_AVERAGE),
+ getMonitorsString(GRPH_CURRENT_AVERAGE), CUSTOM_FORMATTER,
+ 1000, 0, 1),
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(GRPH_MAXIMUM),
+ getMonitorsString(GRPH_MAXIMUM), CUSTOM_FORMATTER,
+ 1000, 0, 1)
+ };
+ }
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/PacketPublisherProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/PacketPublisherProbe.java
new file mode 100644
index 0000000..1342c37
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/PacketPublisherProbe.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.cluster;
+
+import java.util.List;
+import java.util.Map;
+
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.GRPH_CURRENT_AVERAGE;
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.GRPH_MINIMUM;
+import static com.oracle.coherence.plugin.visualvm.panel.AbstractCoherencePanel.getMemberMemoryRateData;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.Data;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return average and minimum package publisher.
+ *
+ * @author tam 2024.03.03
+ */
+public class PacketPublisherProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public PacketPublisherProbe(MonitoredDataResolver resolver)
+ {
+ super(2, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ List> data = model.getData(VisualVMModel.DataType.MEMBER);
+ if (data == null || data.isEmpty())
+ {
+ return ZERO_VALUES2;
+ }
+
+ Object[] aoValues = getMemberMemoryRateData(model, data);
+
+ int cCount = (Integer) aoValues[0];
+ float cTotalPublisherRate = (Float) aoValues[3];
+ float cMinPublisherRate = (Float) aoValues[5];
+
+ return new long[]
+ {
+ (long) ((cTotalPublisherRate / (cCount * 1.0f)) * 1000),
+ (long) (cMinPublisherRate * 1000)
+ };
+
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText("GRPH_packet_publisher"),
+ Localization.getLocalText("LBL_packet_publisher_desc"), ICON, 15, available);
+ }
+
+ protected static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(GRPH_CURRENT_AVERAGE),
+ getMonitorsString(GRPH_CURRENT_AVERAGE), CUSTOM_FORMATTER,
+ 1, 0, 1000),
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(GRPH_MINIMUM),
+ getMonitorsString(GRPH_MINIMUM), CUSTOM_FORMATTER,
+ 1, 0, 1000)
+ };
+ }
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/PacketReceiverProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/PacketReceiverProbe.java
new file mode 100644
index 0000000..bd80d8f
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/PacketReceiverProbe.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.cluster;
+
+import java.util.List;
+import java.util.Map;
+
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.GRPH_CURRENT_AVERAGE;
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.GRPH_MINIMUM;
+import static com.oracle.coherence.plugin.visualvm.panel.AbstractCoherencePanel.getMemberMemoryRateData;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.Data;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return average and minimum package receiver.
+ *
+ * @author tam 2024.03.03
+ */
+public class PacketReceiverProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public PacketReceiverProbe(MonitoredDataResolver resolver)
+ {
+ super(2, PacketPublisherProbe.createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ List> data = model.getData(VisualVMModel.DataType.MEMBER);
+ if (data == null || data.isEmpty())
+ {
+ return ZERO_VALUES2;
+ }
+
+ Object[] aoValues = getMemberMemoryRateData(model, data);
+
+ int cCount = (Integer) aoValues[0];
+ float cTotalReceiverRate = (Float) aoValues[4];
+ float cMinReceiverRate = (Float) aoValues[6];
+
+ return new long[]
+ {
+ (long) ((cTotalReceiverRate / (cCount * 1.0f)) * 1000),
+ (long) (cMinReceiverRate * 1000)
+ };
+
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText("GRPH_packet_receiver"),
+ Localization.getLocalText("LBL_packet_receiver_desc"), ICON, 15, available);
+ }
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/StorageMembersHeapProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/StorageMembersHeapProbe.java
new file mode 100644
index 0000000..8310b21
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/cluster/StorageMembersHeapProbe.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.cluster;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.Data;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.MemberData;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+import java.util.List;
+import java.util.Map;
+
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.GB;
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.MB;
+import static com.oracle.coherence.plugin.visualvm.panel.AbstractCoherencePanel.getMemberMemoryRateData;
+
+/**
+ * Tracer probe to return maximum and used storage heap for a cluster.
+ *
+ * @author tam 2024.03.03
+ */
+public class StorageMembersHeapProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public StorageMembersHeapProbe(MonitoredDataResolver resolver)
+ {
+ super(2, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ List> data = model.getData(VisualVMModel.DataType.MEMBER);
+ if (data == null || data.isEmpty())
+ {
+ return ZERO_VALUES2;
+ }
+ Object[] aoValues = getMemberMemoryRateData(model, model.getData(VisualVMModel.DataType.MEMBER));
+
+ int cTotalMemory = (Integer) aoValues[1];
+ int cTotalMemoryUsed = (Integer) aoValues[2];
+
+ return new long[]
+ {
+ (long) cTotalMemory * MB,
+ (long) cTotalMemoryUsed * MB,
+ };
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText("GRPH_cluster_memory_details"),
+ Localization.getLocalText("LBL_storage_members_heap_desc"), ICON, 15, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText("GRPH_total_cluster_memory"),
+ getMonitorsString("GRPH_total_cluster_memory"), ItemValueFormatter.DEFAULT_BYTES,
+ 1d, 0, GB),
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText("GRPH_used_cluster_memory"),
+ getMonitorsString("GRPH_used_cluster_memory"), ItemValueFormatter.DEFAULT_BYTES,
+ 1d, 0, GB)
+ };
+ }
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/ElasticDataMonitorPackage.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/ElasticDataMonitorPackage.java
new file mode 100644
index 0000000..07a5311
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/ElasticDataMonitorPackage.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.elasticdata;
+
+import static com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe.ICON;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.VisualVMView;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.application.Application;
+
+import org.graalvm.visualvm.modules.tracer.TracerPackage;
+import org.graalvm.visualvm.modules.tracer.TracerProbe;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+
+
+/**
+ * A {@link TracerPackage} to show elastic data related probes.
+ *
+ * @author tam 2024.03.07
+ */
+public class ElasticDataMonitorPackage
+ extends TracerPackage implements AbstractCoherenceMonitorProbe.MonitoredDataResolver {
+
+ public ElasticDataMonitorPackage(Application application)
+ {
+ super(NAME, DESCR, ICON, POSITION);
+ this.f_model = VisualVMView.getModelForApplication(application);
+ }
+
+ // ---- TracerPackage methods -------------------------------------------
+
+ @Override
+ public TracerProbeDescriptor[] getProbeDescriptors() {
+ m_ramournalMemoryProbeDescriptor = RamJournalMemoryProbe.createDescriptor(f_model != null);
+ m_flashjournalSpaceProbeDescriptor = FlashJournalSpaceProbe.createDescriptor(f_model != null);
+ m_ramjournalFilesProbeDescriptor = RamJournalFilesProbe.createDescriptor(f_model != null);
+ m_flashjournalFilesProbeDescriptor = FlashJournalFilesProbe.createDescriptor(f_model != null);
+
+ return new TracerProbeDescriptor[] {
+ m_ramournalMemoryProbeDescriptor,
+ m_flashjournalSpaceProbeDescriptor,
+ m_ramjournalFilesProbeDescriptor,
+ m_flashjournalFilesProbeDescriptor
+ };
+ }
+
+ @Override
+ public TracerProbe getProbe(TracerProbeDescriptor descriptor)
+ {
+ if (descriptor == m_ramournalMemoryProbeDescriptor)
+ {
+ if (m_ramjournalMemoryProbe == null)
+ {
+ m_ramjournalMemoryProbe = new RamJournalMemoryProbe(this);
+ }
+ return m_ramjournalMemoryProbe;
+ }
+ else if (descriptor == m_flashjournalSpaceProbeDescriptor)
+ {
+ if (m_flashjournalSpaceProbe == null)
+ {
+ m_flashjournalSpaceProbe = new FlashJournalSpaceProbe(this);
+ }
+ return m_flashjournalSpaceProbe;
+ }
+ else if (descriptor == m_flashjournalFilesProbeDescriptor)
+ {
+ if (m_flashjournalFilesProbe == null)
+ {
+ m_flashjournalFilesProbe = new FlashJournalFilesProbe(this);
+ }
+ return m_flashjournalFilesProbe;
+ }
+ else if (descriptor == m_ramjournalFilesProbeDescriptor)
+ {
+ if (m_ramjournalFilesProbe == null)
+ {
+ m_ramjournalFilesProbe = new RamJournalFilesProbe(this);
+ }
+ return m_ramjournalFilesProbe;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ // ---- AbstractCoherenceMonitorProbe.MonitoredDataResolver interface ---
+
+ @Override
+ public VisualVMModel getMonitoredData()
+ {
+ return f_model;
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String NAME = Localization.getLocalText("LBL_elasticdata_probe");
+ private static final String DESCR = Localization.getLocalText("LBL_elasticdata_probe_description");
+ private static final int POSITION = 20570;
+
+ private TracerProbeDescriptor m_ramournalMemoryProbeDescriptor;
+ private TracerProbeDescriptor m_flashjournalSpaceProbeDescriptor;
+ private TracerProbeDescriptor m_ramjournalFilesProbeDescriptor;
+ private TracerProbeDescriptor m_flashjournalFilesProbeDescriptor;
+
+ private AbstractCoherenceMonitorProbe m_ramjournalMemoryProbe;
+ private AbstractCoherenceMonitorProbe m_flashjournalSpaceProbe;
+ private AbstractCoherenceMonitorProbe m_ramjournalFilesProbe;
+ private AbstractCoherenceMonitorProbe m_flashjournalFilesProbe;
+
+ private final VisualVMModel f_model;
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/FlashJournalFilesProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/FlashJournalFilesProbe.java
new file mode 100644
index 0000000..33a956e
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/FlashJournalFilesProbe.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.elasticdata;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.AbstractElasticData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the flash journal files used.
+ *
+ * @author tam 2024.03.06
+ */
+public class FlashJournalFilesProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public FlashJournalFilesProbe(MonitoredDataResolver resolver)
+ {
+ super(2, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ long nRamJournalFileCount = getSingValueSum(model, VisualVMModel.DataType.FLASHJOURNAL, AbstractElasticData.FILE_COUNT, ZERO_VALUES1)[0];
+ long nRamJournaMaxFiles = getSingValueSum(model, VisualVMModel.DataType.FLASHJOURNAL, AbstractElasticData.MAX_FILES, ZERO_VALUES1)[0];
+ return new long[] {nRamJournalFileCount, nRamJournaMaxFiles};
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText("LBL_flash_journal_files"),
+ Localization.getLocalText("LBL_flashjournal_files_desc"), ICON, 25, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL1),
+ getMonitorsString(LBL1), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL2),
+ getMonitorsString(LBL2), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL1 = "LBL_journal_files_used";
+ private static final String LBL2 = "LBL_max_journal_files";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/FlashJournalSpaceProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/FlashJournalSpaceProbe.java
new file mode 100644
index 0000000..e23013d
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/FlashJournalSpaceProbe.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.elasticdata;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.AbstractElasticData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the flash journal space committed and used.
+ *
+ * @author tam 2024.03.03]7
+ */
+public class FlashJournalSpaceProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public FlashJournalSpaceProbe(MonitoredDataResolver resolver)
+ {
+ super(2, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ long nRamJournalCommitted = getSingValueSum(model, VisualVMModel.DataType.FLASHJOURNAL, AbstractElasticData.TOTAL_COMMITTED_BYTES, ZERO_VALUES1)[0];
+ long nRamJournalUsed = getSingValueSum(model, VisualVMModel.DataType.FLASHJOURNAL, AbstractElasticData.TOTAL_DATA_SIZE, ZERO_VALUES1)[0];
+ return new long[] {nRamJournalCommitted, nRamJournalUsed};
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText("GRPH_flashjournal_usage_details"),
+ Localization.getLocalText("LBL_flashjournal_size_desc"), ICON, 20, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL1),
+ getMonitorsString(LBL1), ItemValueFormatter.DEFAULT_BYTES,
+ 1d, 0, 1),
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL2),
+ getMonitorsString(LBL2), ItemValueFormatter.DEFAULT_BYTES,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL1 = "GRPH_total_flashjournal_space";
+ private static final String LBL2 = "GRPH_used_flashjournal_space";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/RamJournalFilesProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/RamJournalFilesProbe.java
new file mode 100644
index 0000000..20d461d
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/RamJournalFilesProbe.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.elasticdata;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.AbstractElasticData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the ram journal files used.
+ *
+ * @author tam 2024.03.07
+ */
+public class RamJournalFilesProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public RamJournalFilesProbe(MonitoredDataResolver resolver)
+ {
+ super(2, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ long nRamJournalFileCount = getSingValueSum(model, VisualVMModel.DataType.RAMJOURNAL, AbstractElasticData.FILE_COUNT, ZERO_VALUES1)[0];
+ long nRamJournaMaxFiles = getSingValueSum(model, VisualVMModel.DataType.RAMJOURNAL, AbstractElasticData.MAX_FILES, ZERO_VALUES1)[0];
+ return new long[] {nRamJournalFileCount, nRamJournaMaxFiles};
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText("LBL_ram_journal_files"),
+ Localization.getLocalText("LBL_ramjournal_files_desc"), ICON, 15, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL1),
+ getMonitorsString(LBL1), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL2),
+ getMonitorsString(LBL2), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL1 = "LBL_journal_files_used";
+ private static final String LBL2 = "LBL_max_journal_files";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/RamJournalMemoryProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/RamJournalMemoryProbe.java
new file mode 100644
index 0000000..8085a97
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/elasticdata/RamJournalMemoryProbe.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.elasticdata;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.AbstractElasticData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the ram journal memory committed and used.
+ *
+ * @author tam 2024.03.03
+ */
+public class RamJournalMemoryProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public RamJournalMemoryProbe(MonitoredDataResolver resolver)
+ {
+ super(2, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ long nRamJournalCommitted = getSingValueSum(model, VisualVMModel.DataType.RAMJOURNAL, AbstractElasticData.TOTAL_COMMITTED_BYTES, ZERO_VALUES1)[0];
+ long nRamJournalUsed = getSingValueSum(model, VisualVMModel.DataType.RAMJOURNAL, AbstractElasticData.TOTAL_DATA_SIZE, ZERO_VALUES1)[0];
+ return new long[] {nRamJournalCommitted, nRamJournalUsed};
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText("GRPH_ramjournal_memory_details"),
+ Localization.getLocalText("LBL_ramjournal_memory_desc"), ICON, 10, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL1),
+ getMonitorsString(LBL1), ItemValueFormatter.DEFAULT_BYTES,
+ 1d, 0, 1),
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL2),
+ getMonitorsString(LBL2), ItemValueFormatter.DEFAULT_BYTES,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL1 = "GRPH_total_ramjournal_memory";
+ private static final String LBL2 = "GRPH_used_ramjournal_memory";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/BytesReceivedSecProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/BytesReceivedSecProbe.java
new file mode 100644
index 0000000..5d7b5b8
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/BytesReceivedSecProbe.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.federation;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationData;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the current total bytes received per second across all federated services.
+ *
+ * @author tam 2024.03.03
+ */
+public class BytesReceivedSecProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public BytesReceivedSecProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.FEDERATION_DESTINATION, FederationData.Column.TOTAL_BYTES_RECEIVED.ordinal(), ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_federation_bytes_rec_desc"), ICON, 20, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_BYTES_PER_SEC,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_total_bytes_received_sec";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/BytesSentSecProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/BytesSentSecProbe.java
new file mode 100644
index 0000000..791b414
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/BytesSentSecProbe.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.federation;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the current total bytes sent per second across all federated services.
+ *
+ * @author tam 2024.03.03
+ */
+public class BytesSentSecProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public BytesSentSecProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.FEDERATION_DESTINATION, FederationData.Column.TOTAL_BYTES_SENT.ordinal(), ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_federation_bytes_sent_desc"), ICON, 10, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_BYTES_PER_SEC,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_total_bytes_sent_sec";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/FederationMonitorPackage.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/FederationMonitorPackage.java
new file mode 100644
index 0000000..b6497b0
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/FederationMonitorPackage.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.federation;
+
+import static com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe.ICON;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.VisualVMView;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;;
+
+import org.graalvm.visualvm.application.Application;
+
+import org.graalvm.visualvm.modules.tracer.TracerPackage;
+import org.graalvm.visualvm.modules.tracer.TracerProbe;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+
+/**
+ * A {@link TracerPackage} to show federation related probes.
+ *
+ * @author tam 2024.03.06
+ */
+public class FederationMonitorPackage
+ extends TracerPackage implements AbstractCoherenceMonitorProbe.MonitoredDataResolver {
+
+ public FederationMonitorPackage(Application application)
+ {
+ super(NAME, DESCR, ICON, POSITION);
+ this.f_model = VisualVMView.getModelForApplication(application);
+ }
+
+ // ---- TracerPackage methods -------------------------------------------
+
+ @Override
+ public TracerProbeDescriptor[] getProbeDescriptors() {
+ m_bytesSentPerSecondProbeDescriptor = BytesSentSecProbe.createDescriptor(f_model != null);
+ m_msgsSentPerSecondProbeDescriptor = MsgsSentSecProbe.createDescriptor(f_model != null);
+ m_bytesRecPerSecondProbeDescriptor = BytesReceivedSecProbe.createDescriptor(f_model != null);
+ m_msgsRecPerSecondProbeDescriptor = MsgsReceivedSecProbe.createDescriptor(f_model != null);
+
+ return new TracerProbeDescriptor[] {
+ m_bytesSentPerSecondProbeDescriptor,
+ m_msgsSentPerSecondProbeDescriptor,
+ m_bytesRecPerSecondProbeDescriptor,
+ m_msgsRecPerSecondProbeDescriptor
+ };
+ }
+
+ @Override
+ public TracerProbe getProbe(TracerProbeDescriptor descriptor)
+ {
+ if (descriptor == m_bytesSentPerSecondProbeDescriptor)
+ {
+ if (m_bytesSentPerSecondProbe == null)
+ {
+ m_bytesSentPerSecondProbe = new BytesSentSecProbe(this);
+ }
+ return m_bytesSentPerSecondProbe;
+ }
+ else if (descriptor == m_msgsSentPerSecondProbeDescriptor)
+ {
+ if (m_msgsSentPerSecondProbe == null)
+ {
+ m_msgsSentPerSecondProbe = new MsgsSentSecProbe(this);
+ }
+ return m_msgsSentPerSecondProbe;
+ }
+ else if (descriptor == m_bytesRecPerSecondProbeDescriptor)
+ {
+ if (m_bytesRecPerSecondProbe == null)
+ {
+ m_bytesRecPerSecondProbe = new BytesReceivedSecProbe(this);
+ }
+ return m_bytesRecPerSecondProbe;
+ }
+ else if (descriptor == m_msgsRecPerSecondProbeDescriptor)
+ {
+ if (m_msgsRecPerSecondProbe == null)
+ {
+ m_msgsRecPerSecondProbe = new MsgsReceivedSecProbe(this);
+ }
+ return m_msgsRecPerSecondProbe;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ // ---- AbstractCoherenceMonitorProbe.MonitoredDataResolver interface ---
+
+ @Override
+ public VisualVMModel getMonitoredData()
+ {
+ return f_model;
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String NAME = Localization.getLocalText("LBL_federation_probe");
+ private static final String DESCR = Localization.getLocalText("LBL_federation_probe_description");
+ private static final int POSITION = 20550;
+
+ private TracerProbeDescriptor m_bytesSentPerSecondProbeDescriptor;
+ private TracerProbeDescriptor m_msgsSentPerSecondProbeDescriptor;
+ private TracerProbeDescriptor m_bytesRecPerSecondProbeDescriptor;
+ private TracerProbeDescriptor m_msgsRecPerSecondProbeDescriptor;
+
+ private AbstractCoherenceMonitorProbe m_bytesSentPerSecondProbe;
+ private AbstractCoherenceMonitorProbe m_msgsSentPerSecondProbe;
+ private AbstractCoherenceMonitorProbe m_bytesRecPerSecondProbe;
+ private AbstractCoherenceMonitorProbe m_msgsRecPerSecondProbe;
+
+ private final VisualVMModel f_model;
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/MsgsReceivedSecProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/MsgsReceivedSecProbe.java
new file mode 100644
index 0000000..742a3a4
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/MsgsReceivedSecProbe.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.federation;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationData;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+import com.oracle.coherence.plugin.visualvm.tracer.CustomFormatter;
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the current total messages received per second across all federated services.
+ *
+ * @author tam 2024.03.03
+ */
+public class MsgsReceivedSecProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public MsgsReceivedSecProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.FEDERATION_DESTINATION, FederationData.Column.TOTAL_MSGS_RECEIVED.ordinal(), ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_federation_msgs_rec_desc"), ICON, 25, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), new CustomFormatter(1, "msg/ s"),
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_total_msgs_received_sec";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/MsgsSentSecProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/MsgsSentSecProbe.java
new file mode 100644
index 0000000..67de4f6
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/federation/MsgsSentSecProbe.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.federation;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationData;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+import com.oracle.coherence.plugin.visualvm.tracer.CustomFormatter;
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the current total messages sent per second across all federated services.
+ *
+ * @author tam 2024.03.03
+ */
+public class MsgsSentSecProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public MsgsSentSecProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.FEDERATION_DESTINATION, FederationData.Column.TOTAL_MSGS_SENT.ordinal(), ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_federation_msgs_sent_desc"), ICON, 15, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), new CustomFormatter(1, "msg/ s"),
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_total_msgs_sent_sec";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/ActiveSpaceProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/ActiveSpaceProbe.java
new file mode 100644
index 0000000..3e074ee
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/ActiveSpaceProbe.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.persistence;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheData;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.PersistenceData;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.MB;
+
+/**
+ * Tracer probe to return the total active space used across all persistence services.
+ *
+ * @author tam 2024.03.07
+ */
+public class ActiveSpaceProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public ActiveSpaceProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ long[] anValue = getSingValueSum(model, VisualVMModel.DataType.PERSISTENCE, PersistenceData.TOTAL_ACTIVE_SPACE_USED_MB, ZERO_VALUES1);
+ anValue[0] = anValue[0] * MB;
+ return anValue;
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_active_space_desc"), ICON, 10, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_BYTES,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_active_space";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/BackupSpaceProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/BackupSpaceProbe.java
new file mode 100644
index 0000000..9255cc7
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/BackupSpaceProbe.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.persistence;
+
+import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.MB;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.PersistenceData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the total backup space used across all persistence services.
+ *
+ * @author tam 2024.03.07
+ */
+public class BackupSpaceProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public BackupSpaceProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ long[] anValue = getSingValueSum(model, VisualVMModel.DataType.PERSISTENCE, PersistenceData.TOTAL_BACKUP_SPACE_USED_MB, ZERO_VALUES1);
+ anValue[0] = anValue[0] * MB;
+ return anValue;
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_backup_space_desc"), ICON, 20, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_BYTES,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_backup_space";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/MaximumLatencyProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/MaximumLatencyProbe.java
new file mode 100644
index 0000000..957ecb8
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/MaximumLatencyProbe.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.persistence;
+
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.PersistenceData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import com.oracle.coherence.plugin.visualvm.tracer.CustomFormatter;
+
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the maximum latency of all persistence services.
+ *
+ * @author tam 2024.03.07
+ */
+public class MaximumLatencyProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public MaximumLatencyProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueMax(model, VisualVMModel.DataType.PERSISTENCE, PersistenceData.MAX_LATENCY, ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_max_latency_desc"), ICON, 25, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), new CustomFormatter(1, "ms"),
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_max_persistence";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/PersistenceMonitorPackage.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/PersistenceMonitorPackage.java
new file mode 100644
index 0000000..ad465e5
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/persistence/PersistenceMonitorPackage.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.persistence;
+
+import static com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe.ICON;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.VisualVMView;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.application.Application;
+
+import org.graalvm.visualvm.modules.tracer.TracerPackage;
+import org.graalvm.visualvm.modules.tracer.TracerProbe;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+
+/**
+ * A {@link TracerPackage} to show persistence related probes.
+ *
+ * @author tam 2024.03.06
+ */
+public class PersistenceMonitorPackage
+ extends TracerPackage implements AbstractCoherenceMonitorProbe.MonitoredDataResolver {
+
+ public PersistenceMonitorPackage(Application application)
+ {
+ super(NAME, DESCR, ICON, POSITION);
+ this.f_model = VisualVMView.getModelForApplication(application);
+ }
+
+ // ---- TracerPackage methods -------------------------------------------
+
+ @Override
+ public TracerProbeDescriptor[] getProbeDescriptors() {
+ m_activeSpaceProbeDescriptor = ActiveSpaceProbe.createDescriptor(f_model != null);
+ m_backupSpaceProbeDescriptor = BackupSpaceProbe.createDescriptor(f_model != null);
+ m_maxLatencyProbeDescriptor = MaximumLatencyProbe.createDescriptor(f_model != null);
+
+ return new TracerProbeDescriptor[] {
+ m_activeSpaceProbeDescriptor,
+ m_backupSpaceProbeDescriptor,
+ m_maxLatencyProbeDescriptor
+ };
+ }
+
+ @Override
+ public TracerProbe getProbe(TracerProbeDescriptor descriptor)
+ {
+ if (descriptor == m_activeSpaceProbeDescriptor)
+ {
+ if (m_activeSpaceProbe == null)
+ {
+ m_activeSpaceProbe = new ActiveSpaceProbe(this);
+ }
+ return m_activeSpaceProbe;
+ }
+ else if (descriptor == m_backupSpaceProbeDescriptor)
+ {
+ if (m_backupSpaceProbe == null)
+ {
+ m_backupSpaceProbe = new BackupSpaceProbe(this);
+ }
+ return m_backupSpaceProbe;
+ }
+ else if (descriptor == m_maxLatencyProbeDescriptor)
+ {
+ if (m_maxLatencyProbe == null)
+ {
+ m_maxLatencyProbe = new MaximumLatencyProbe(this);
+ }
+ return m_maxLatencyProbe;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ // ---- AbstractCoherenceMonitorProbe.MonitoredDataResolver interface ---
+
+ @Override
+ public VisualVMModel getMonitoredData()
+ {
+ return f_model;
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String NAME = Localization.getLocalText("LBL_persistence_probe");
+ private static final String DESCR = Localization.getLocalText("LBL_persistence_description");
+ private static final int POSITION = 20525;
+
+ private TracerProbeDescriptor m_activeSpaceProbeDescriptor;
+ private TracerProbeDescriptor m_backupSpaceProbeDescriptor;
+ private TracerProbeDescriptor m_maxLatencyProbeDescriptor;
+
+ private AbstractCoherenceMonitorProbe m_activeSpaceProbe;
+ private AbstractCoherenceMonitorProbe m_backupSpaceProbe;
+ private AbstractCoherenceMonitorProbe m_maxLatencyProbe;
+
+ private final VisualVMModel f_model;
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyConnectionCountProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyConnectionCountProbe.java
new file mode 100644
index 0000000..812db46
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyConnectionCountProbe.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.proxy;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.ProxyData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the total number of proxy server connections.
+ *
+ * @author tam 2024.03.03
+ */
+public class ProxyConnectionCountProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public ProxyConnectionCountProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.PROXY, ProxyData.CONNECTION_COUNT, ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_proxy_desc"), ICON, 5, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "GRPH_total_connections";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyMonitorPackage.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyMonitorPackage.java
new file mode 100644
index 0000000..ee105e1
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyMonitorPackage.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.proxy;
+
+import static com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe.ICON;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.VisualVMView;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.application.Application;
+import org.graalvm.visualvm.modules.tracer.TracerPackage;
+import org.graalvm.visualvm.modules.tracer.TracerProbe;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+
+/**
+ * A {@link TracerPackage} to show Proxy related probes.
+ *
+ * @author tam 2024.03.04
+ */
+public class ProxyMonitorPackage
+ extends TracerPackage implements AbstractCoherenceMonitorProbe.MonitoredDataResolver {
+
+ public ProxyMonitorPackage(Application application)
+ {
+ super(NAME, DESCR, ICON, POSITION);
+ this.f_model = VisualVMView.getModelForApplication(application);
+ }
+
+ // ---- TracerPackage methods -------------------------------------------
+
+ @Override
+ public TracerProbeDescriptor[] getProbeDescriptors() {
+ m_proxyConnectionsProbeDescriptor = ProxyConnectionCountProbe.createDescriptor(f_model != null);
+ m_proxyOutgoingMsgProbeDescriptor = ProxyOutgoingMsgBacklogProbe.createDescriptor(f_model != null);
+
+ return new TracerProbeDescriptor[] {
+ m_proxyConnectionsProbeDescriptor,
+ m_proxyOutgoingMsgProbeDescriptor
+ };
+ }
+
+ @Override
+ public TracerProbe getProbe(TracerProbeDescriptor descriptor)
+ {
+ if (descriptor == m_proxyConnectionsProbeDescriptor)
+ {
+ if (m_proxyConnectionsProbe == null)
+ {
+ m_proxyConnectionsProbe = new ProxyConnectionCountProbe(this);
+ }
+ return m_proxyConnectionsProbe;
+ }
+ else if (descriptor == m_proxyOutgoingMsgProbeDescriptor)
+ {
+ if (m_proxyOutgoingMsgBacklogProbe == null)
+ {
+ m_proxyOutgoingMsgBacklogProbe = new ProxyOutgoingMsgBacklogProbe(this);
+ }
+ return m_proxyOutgoingMsgBacklogProbe;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ // ---- AbstractCoherenceMonitorProbe.MonitoredDataResolver interface ---
+
+ @Override
+ public VisualVMModel getMonitoredData()
+ {
+ return f_model;
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String NAME = Localization.getLocalText("LBL_proxy_probe");
+ private static final String DESCR = Localization.getLocalText("LBL_proxy_probe_description");
+ private static final int POSITION = 20520;
+
+ private TracerProbeDescriptor m_proxyConnectionsProbeDescriptor;
+ private TracerProbeDescriptor m_proxyOutgoingMsgProbeDescriptor;
+
+ private AbstractCoherenceMonitorProbe m_proxyConnectionsProbe;
+ private AbstractCoherenceMonitorProbe m_proxyOutgoingMsgBacklogProbe;
+
+ private final VisualVMModel f_model;
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyOutgoingMsgBacklogProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyOutgoingMsgBacklogProbe.java
new file mode 100644
index 0000000..3f4e657
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyOutgoingMsgBacklogProbe.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.proxy;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.ProxyData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the total number of outgoing message backlog for all proxy servers.
+ *
+ * @author tam 2024.03.03
+ */
+public class ProxyOutgoingMsgBacklogProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public ProxyOutgoingMsgBacklogProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.PROXY, ProxyData.OUTGOING_MSG_BACKLOG, ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_proxy_outgoing_desc"), ICON, 5, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_outgoing_msg_backlog";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/EndangeredPartitionsProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/EndangeredPartitionsProbe.java
new file mode 100644
index 0000000..47ac7ff
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/EndangeredPartitionsProbe.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.service;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceData;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the total number of endangered partitions for all partitioned services.
+ *
+ * @author tam 2024.03.03
+ */
+public class EndangeredPartitionsProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public EndangeredPartitionsProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.SERVICE, ServiceData.PARTITIONS_ENDANGERED, ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_service_endangered_desc"), ICON, 5, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_endangered";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/PartitionedPendingRequestsProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/PartitionedPendingRequestsProbe.java
new file mode 100644
index 0000000..90a4ef4
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/PartitionedPendingRequestsProbe.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.service;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceData;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the total number of pending requests for all partitioned services.
+ *
+ * @author tam 2024.03.03
+ */
+public class PartitionedPendingRequestsProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public PartitionedPendingRequestsProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.SERVICE, ServiceData.REQUESTS_PENDING, ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_service_pending_desc"), ICON, 20, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_pending";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/ServiceMonitorPackage.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/ServiceMonitorPackage.java
new file mode 100644
index 0000000..320403d
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/ServiceMonitorPackage.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.service;
+
+import static com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe.ICON;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.VisualVMView;
+
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+
+import org.graalvm.visualvm.application.Application;
+
+import org.graalvm.visualvm.modules.tracer.TracerPackage;
+import org.graalvm.visualvm.modules.tracer.TracerProbe;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+
+/**
+ * A {@link TracerPackage} to show servier related probes.
+ *
+ * @author tam 2024.03.06
+ */
+public class ServiceMonitorPackage
+ extends TracerPackage implements AbstractCoherenceMonitorProbe.MonitoredDataResolver {
+
+ public ServiceMonitorPackage(Application application)
+ {
+ super(NAME, DESCR, ICON, POSITION);
+ this.f_model = VisualVMView.getModelForApplication(application);
+ }
+
+ // ---- TracerPackage methods -------------------------------------------
+
+ @Override
+ public TracerProbeDescriptor[] getProbeDescriptors() {
+ m_pendingRequestsProbeDescriptor = PartitionedPendingRequestsProbe.createDescriptor(f_model != null);
+ m_endangeredProbeDescriptor = EndangeredPartitionsProbe.createDescriptor(f_model != null);
+ m_unbalancedProbeDescriptor = UnbalancedPartitionsProbe.createDescriptor(f_model != null);
+ m_vulnerableProbeDescriptor = VulnerablePartitionsProbe.createDescriptor(f_model != null);
+
+ return new TracerProbeDescriptor[] {
+ m_pendingRequestsProbeDescriptor,
+ m_endangeredProbeDescriptor,
+ m_unbalancedProbeDescriptor,
+ m_vulnerableProbeDescriptor
+ };
+ }
+
+ @Override
+ public TracerProbe getProbe(TracerProbeDescriptor descriptor)
+ {
+ if (descriptor == m_pendingRequestsProbeDescriptor)
+ {
+ if (m_PendingRequestsProbe == null)
+ {
+ m_PendingRequestsProbe = new PartitionedPendingRequestsProbe(this);
+ }
+ return m_PendingRequestsProbe;
+ }
+ else if (descriptor == m_endangeredProbeDescriptor)
+ {
+ if (m_endangeredProbe == null)
+ {
+ m_endangeredProbe = new EndangeredPartitionsProbe(this);
+ }
+ return m_endangeredProbe;
+ }
+ else if (descriptor == m_unbalancedProbeDescriptor)
+ {
+ if (m_unbalancedProbe == null)
+ {
+ m_unbalancedProbe = new UnbalancedPartitionsProbe(this);
+ }
+ return m_unbalancedProbe;
+ }
+ else if (descriptor == m_vulnerableProbeDescriptor)
+ {
+ if (m_vulnerableProbe == null)
+ {
+ m_vulnerableProbe = new VulnerablePartitionsProbe(this);
+ }
+ return m_vulnerableProbe;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ // ---- AbstractCoherenceMonitorProbe.MonitoredDataResolver interface ---
+
+ @Override
+ public VisualVMModel getMonitoredData()
+ {
+ return f_model;
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String NAME = Localization.getLocalText("LBL_service_probe");
+ private static final String DESCR = Localization.getLocalText("LBL_service_probe_description");
+ private static final int POSITION = 20505;
+
+ private TracerProbeDescriptor m_pendingRequestsProbeDescriptor;
+ private TracerProbeDescriptor m_endangeredProbeDescriptor;
+ private TracerProbeDescriptor m_unbalancedProbeDescriptor;
+ private TracerProbeDescriptor m_vulnerableProbeDescriptor;
+
+ private AbstractCoherenceMonitorProbe m_PendingRequestsProbe;
+ private AbstractCoherenceMonitorProbe m_endangeredProbe;
+ private AbstractCoherenceMonitorProbe m_unbalancedProbe;
+ private AbstractCoherenceMonitorProbe m_vulnerableProbe;
+
+ private final VisualVMModel f_model;
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/UnbalancedPartitionsProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/UnbalancedPartitionsProbe.java
new file mode 100644
index 0000000..2f0eb6c
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/UnbalancedPartitionsProbe.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.service;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceData;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the total number of unbalanced partitions for all partitioned services.
+ *
+ * @author tam 2024.03.03
+ */
+public class UnbalancedPartitionsProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public UnbalancedPartitionsProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.SERVICE, ServiceData.PARTITIONS_UNBALANCED, ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_service_unbalanced_desc"), ICON, 10, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_unbalanced";
+ }
diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/VulnerablePartitionsProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/VulnerablePartitionsProbe.java
new file mode 100644
index 0000000..5eb06e2
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/service/VulnerablePartitionsProbe.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.coherence.plugin.visualvm.tracer.service;
+
+import com.oracle.coherence.plugin.visualvm.Localization;
+import com.oracle.coherence.plugin.visualvm.VisualVMModel;
+import com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceData;
+import com.oracle.coherence.plugin.visualvm.tracer.AbstractCoherenceMonitorProbe;
+import org.graalvm.visualvm.modules.tracer.ItemValueFormatter;
+import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
+import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;
+
+/**
+ * Tracer probe to return the total number of vulnerable partitions for all partitioned services.
+ *
+ * @author tam 2024.03.03
+ */
+public class VulnerablePartitionsProbe
+ extends AbstractCoherenceMonitorProbe
+ {
+ // ----- constructors ---------------------------------------------------
+
+ public VulnerablePartitionsProbe(MonitoredDataResolver resolver)
+ {
+ super(1, createItemDescriptors(), resolver);
+ }
+
+ // ---- TracerProbe methods ---------------------------------------------
+
+ @Override
+ public long[] getValues(VisualVMModel model)
+ {
+ return getSingValueSum(model, VisualVMModel.DataType.SERVICE, ServiceData.PARTITIONS_VULNERABLE, ZERO_VALUES1);
+ }
+
+ public static TracerProbeDescriptor createDescriptor(boolean available)
+ {
+ return new TracerProbeDescriptor(Localization.getLocalText(LBL),
+ Localization.getLocalText("LBL_service_vulnerable_desc"), ICON, 15, available);
+ }
+
+ private static ProbeItemDescriptor[] createItemDescriptors()
+ {
+ return new ProbeItemDescriptor[]
+ {
+ ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
+ getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
+ 1d, 0, 1),
+ };
+ }
+
+ // ----- constants ------------------------------------------------------
+
+ private static final String LBL = "LBL_vulnerable";
+ }
diff --git a/coherence-visualvm-plugin/src/main/resources/com/oracle/coherence/plugin/visualvm/Bundle.properties b/coherence-visualvm-plugin/src/main/resources/com/oracle/coherence/plugin/visualvm/Bundle.properties
index d8d822e..d9f6204 100644
--- a/coherence-visualvm-plugin/src/main/resources/com/oracle/coherence/plugin/visualvm/Bundle.properties
+++ b/coherence-visualvm-plugin/src/main/resources/com/oracle/coherence/plugin/visualvm/Bundle.properties
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -29,13 +29,15 @@ OpenIDE-Module-Long-Description=\
This plug-in provides a GUI to allow developers to view information about a running Coherence Cluster. \
Once installed, when you connect to a local or remote process running a Coherence MBean server you will see a "Coherence Tab" \
which allows you to view Coherence related information for that cluster. \
+ Version 1.7.0 includes support for the VisualVM Tracer framework and includes various Coherence probes, which gather metrics from Coherence and display the data in a timeline. \
+ See the documentation on GitHub for more information. \
The following tabs are displayed: \
\
Cluster Overview - Displays high-level information about the Coherence cluster including cluster name, version, member count and 'Cluster StatusHA'. Summary graphs show total cluster memory available and used, packet publisher and receiver success rates and load averages for machines running Coherence. \
Machines - Displays a list of the physical machines that make up the Coherence cluster as well as information about the load averages and available memory on these machines. \
Members - Displays the full list of Coherence members/nodes including individual publisher/ receiver success rates, memory and send queue sizes. \
Services - Displays information about the running services including partition counts and statusHA values. If you select a service, on the next data refresh you will see detailed thread information for each node of the service as well as graphs of that information. \
- Caches - Displays information about any caches including size, and memory usage information. To get the correct information to be displayed for memory usage, you must be using the binary unit-calculator. If you select a cache, on the next data refresh you will see detailed information about each node hosting that service and cache. \
+ Caches - Displays information about any caches including size, and memory usage information. To get the correct information to be displayed for memory usage, you must be using the binary unit-calculator. If you select a cache, on the next data refresh you will see detailed information about each node hosting that service and cache as well as view caches if any exist. \
Topics - Displays information about any active Topics including size, message rates and unconsumed messages. \
Proxy Servers - If your cluster is running proxy servers, this tab displays information about the proxy servers and the number of connections across each proxy server and total connections. \
HTTP Servers - If your cluster is running proxy servers with HTTP acceptors, this tab displays information about the HTTP servers, the number of connections across each server, total connections and graphs of response codes, errors and requests over time for a selected service. \
@@ -85,6 +87,7 @@ LBL_max_query_desc= Max Query Description
TAB_cache=Cache Size and Access Details
TAB_storage=Cache Storage Details
TAB_front_cache_detail=Front Cache Size and Access Details
+TAB_view_caches=View Caches
TTIP_cache_size=The memory sizes shown here and displayed below are only meaningful if the binary unit-calculator is used for caches.
LBL_size_heat_map=Show Size Heat Map
LBL_memory_heat_map=Show Memory Heat Map
@@ -92,7 +95,8 @@ LBL_title_size_heat_map=Cache Size Heat Map for All Caches
LBL_title_memory_heat_map=Primary Memory Heat Map for All Caches
LBL_no_caches=No caches are defined or all caches have zero size. Unable to create Heat Map.
LBL_no_data=You have selected a new row, please wait for the data to be refreshed and try viewing the heat map again.
-LBL_index_info=Index information
+LBL_index_info=Index Information
+LBL_cache_partition_stats=Cache Partition Stats
LBL_truncate=Truncate Cache
LBL_clear=Clear Cache
LBL_confirm_cache_operation=WARNING: This operation will remove the cache contents.\nAre you sure you want to perform operation {0} against cache {1}?
@@ -407,6 +411,12 @@ LBL_published=Published
LBL_page_capacity=Page Capacity
LBL_retain_consumed=Retain Consumed
LBL_reconnect_retry=Reconnect Retry
+LBL_reconnect_Interval=Reconnect Interval
+LBL_filter=Filter
+LBL_transformed=Transformed?
+LBL_transformer=Transformer
+LBL_read_only=Read Only?
+LBL_cache_values=Cache Values?
LBL_reconnect_timeout=Reconnect Timeout
LBL_reconnect_wait=Reconnect Wait
LBL_subscribers=Subscribers
@@ -416,6 +426,7 @@ LBL_memory_bytes=Memory (bytes)
LBL_memory_mb=Memory (MB)
LBL_average_object_size=Avg object Size (bytes)
LBL_unit_calculator=Unit Calculator
+LBL_view_cache=View Cache
LBL_total_gets=Total Gets
LBL_total_puts=Total Puts
LBL_cache_hits=Cache Hits
@@ -696,4 +707,50 @@ LBL_error_discovering=Error discovering clusters on host {0}:{1}, {2}.
LBL_confirm_add_clusters=Are you sure you want to add the following clusters discovered on this host?\n
LBL_discovering_clusters=Discovering clusters on host {0}, port {1}...
LBL_enter_cluster_port=Enter cluster port
-LBL_invalid_cluster_port=Invalid cluster port {0}.
\ No newline at end of file
+LBL_invalid_cluster_port=Invalid cluster port {0}.
+
+# Monitor Probes
+LBL_cluster_probe=Coherence - Cluster Overview
+LBL_cluster_probe_description=Provides cluster based metrics.
+LBL_proxy_probe=Coherence - Proxy Servers
+LBL_cache_probe=Coherence - Caches
+LBL_persistence_probe=Coherence - Persistence
+LBL_federation_probe=Coherence - Federation
+LBL_elasticdata_probe=Coherence - Elastic Data
+LBL_service_probe=Coherence - Services
+LBL_proxy_probe_description=Provides proxy server based metrics.
+LBL_cache_probe_description=Provides cache based metrics.
+LBL_persistence_description=Provides persistence based metrics.
+LBL_federation_probe_description=Provides federation based metrics.
+LBL_elasticdata_probe_description=Provides elastic data based metrics.
+LBL_service_probe_description=Provides service based metrics.
+LBL_proxy_desc=Monitors the total number of proxy server connections across all proxy servers.
+LBL_service_pending_desc=Monitors the total number of pending requests across all partitioned services.
+LBL_service_endangered_desc=Monitors the total number of endangered partitions across all partitioned services.
+LBL_service_unbalanced_desc=Monitors the total number of unbalanced partitions across all partitioned services.
+LBL_service_vulnerable_desc=Monitors the total number of vulnerable partitions across all partitioned services.
+LBL_cache_memory_size_desc=Monitors the total memory usage by all caches across all partitioned services.
+LBL_active_space_desc=Monitors the total disk space usage for active persistence by all partitioned services.
+LBL_max_latency_desc=Monitors the maximum latency across all services running active persistence.
+LBL_backup_space_desc=Monitors the total disk space usage for backup persistence by all partitioned services.
+LBL_ramjournal_memory_desc=Monitors the committed and used ram journal memory.
+LBL_ramjournal_files_desc=Monitors the used and committed ram journal files.
+LBL_flashjournal_files_desc=Monitors the used and committed flash journal files.
+LBL_flashjournal_size_desc=Monitors the committed and used ram journal space.
+LBL_cache_size_desc=Monitors the total number of cache entries in all caches across all partitioned services and participants.
+LBL_federation_bytes_sent_desc=Monitors the current bytes sent/ second across all federated services and participants.
+LBL_federation_bytes_rec_desc=Monitors the current bytes received/ second across all federated services and participants.
+LBL_federation_msgs_sent_desc=Monitors the current msgs sent/ second across all federated services and participants.
+LBL_federation_msgs_rec_desc=Monitors the current msgs received/ second across all federated services and participants.
+LBL_proxy_outgoing_desc=Monitors the total outgoing message backlog across all proxy servers.
+LBL_storage_members_heap_desc=Monitors allocated and used Heap size for storage members.
+LBL_packet_publisher_desc=Monitors average and minimum packet publisher rates across all members.
+LBL_packet_receiver_desc=Monitors average and minimum packet receiver rates across all members.
+LBL_load_average_desc=Monitors average and maximum load average across all machines.
+LBL_members_desc=Monitors the number of total cluster members as well as the number of storage-enabled members.
+LBL_active_space=Active Space Used on disk
+LBL_backup_space=Backup Space Used on disk
+LBL_departure_count=Monitors the number of cluster members that have left.
+LBL_monitors=Monitors
+LBL_cluster_members=Cluster Members
+LBL_total_cache=Total Primary Cache Data Memory
\ No newline at end of file
diff --git a/coherence-visualvm-plugin/src/main/resources/reports/visualvm/view-details.xml b/coherence-visualvm-plugin/src/main/resources/reports/visualvm/view-details.xml
new file mode 100644
index 0000000..8ae3d12
--- /dev/null
+++ b/coherence-visualvm-plugin/src/main/resources/reports/visualvm/view-details.xml
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+ {date}-view-details.txt
+ {tab}
+
+
+
+
+
+ Coherence:type=View,service=%SERVICE_NAME%,name=%VIEW_NAME%,*
+
+
+
+
+ global
+ {batch-counter}
+
+
+
+
+ key
+ nodeId
+
+
+
+
+ Size
+
+
+
+
+ ReconnectInterval
+
+
+
+
+ Filter
+
+
+
+
+ Transformed
+
+
+
+
+ Transformer
+
+
+
+
+ ReadOnly
+
+
+
+
+ CacheValues
+
+
+
+
+
\ No newline at end of file
diff --git a/coherence-visualvm-tests/coherence-visualvm-tests-ce/pom.xml b/coherence-visualvm-tests/coherence-visualvm-tests-ce/pom.xml
index 8413bef..062ec59 100644
--- a/coherence-visualvm-tests/coherence-visualvm-tests-ce/pom.xml
+++ b/coherence-visualvm-tests/coherence-visualvm-tests-ce/pom.xml
@@ -1,7 +1,7 @@
+
+ org.graalvm.visualvm.modules
+ org-graalvm-visualvm-modules-tracer
+ ${visualvm.version}
+
+
org.netbeans.api
org-openide-modules
@@ -259,6 +267,10 @@
${java.version}
${java.version}
${java.version.release}
+
+ --add-opens
+ jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
+
diff --git a/scripts/install-tracer-library.sh b/scripts/install-tracer-library.sh
new file mode 100755
index 0000000..68e1b3d
--- /dev/null
+++ b/scripts/install-tracer-library.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+#
+# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+#
+# Purpose: Build and install the org-graalvm-visualvm-modules-tracer plugin as it is not available in Maven.
+set -e
+
+#
+#echo "Installing required tracer VisualVM dependencies"
+#TEMP_DIR=`mktemp -d`
+#echo "Temp dir = ${TEMP_DIR}"
+#
+#trap "rm -rf $TEMP_DIR 2>&1 > /dev/null" 0 1 2 3
+#
+#cd $TEMP_DIR
+#echo "Cloning VisualVM..."
+#git clone https://github.com/oracle/visualvm.git
+#cd visualvm
+#git checkout 2.1.7
+#
+#curl -Lo /tmp/nb140_platform_20230511.zip https://github.com/oracle/visualvm/releases/download/2.1.7/nb140_platform_20230511.zip
+#cd visualvm
+#unzip /tmp/nb140_platform_20230511.zip
+#
+#echo "Building VisualVM..."
+#ant build-zip
+#
+#cd ../plugins
+#ant build
+#
+#MODULE_NAME=org-graalvm-visualvm-modules-tracer
+#
+#TRACER=`find . -name ${MODULE_NAME}.jar | sed 1q`
+#FULL_PATH=`pwd`/${TRACER}
+#
+#echo "Installing ${FULL_PATH}"
+
+# Temp workaround
+DIR=`pwd`
+FULL_PATH=$DIR/org-graalvm-visualvm-modules-tracer-2.1.jar
+
+set -x
+mvn install:install-file -Dfile=${FULL_PATH} -DgroupId=org.graalvm.visualvm.modules -DartifactId=org-graalvm-visualvm-modules-tracer -Dversion=2.1 -Dpackaging=jar
+
+ls -l ~/.m2/repository/org/graalvm/visualvm/modules/org-graalvm-visualvm-modules-tracer/2.1
+
+
+
diff --git a/scripts/org-graalvm-visualvm-modules-tracer-2.1.jar b/scripts/org-graalvm-visualvm-modules-tracer-2.1.jar
new file mode 100644
index 0000000..d67b7bb
Binary files /dev/null and b/scripts/org-graalvm-visualvm-modules-tracer-2.1.jar differ