Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/test-against-released.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
- 22.06.6
- 23.09
- 23.09.1
- 23.09.2

steps:
- name: Checkout
Expand All @@ -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:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/test-against-snapshot-1440.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/test-against-snapshot.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
fail-fast: false
matrix:
coherenceVersion:
- 23.09.2-SNAPSHOT
- 23.09.3-SNAPSHOT
- 22.06.8-SNAPSHOT

steps:
Expand All @@ -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:
Expand Down
61 changes: 59 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

## <a id="versions"></a> 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

Expand Down Expand Up @@ -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.

## <a id="tracer"></a> 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:

&nbsp;&nbsp; ![Coherence VisualVM Probes](assets/probes.png)

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*

&nbsp; &nbsp; ![Cluster Overview](assets/probes-cluster-overview.png)

*Services*

&nbsp; &nbsp; ![Cluster Overview](assets/probes-services.png)

*Caches*

&nbsp; &nbsp; ![Caches](assets/probes-caches.png)

*Proxy Servers*

&nbsp; &nbsp; ![Proxy Servers](assets/probes-proxies.png)

*Persistence*

&nbsp; &nbsp; ![Persistence](assets/probes-persistence.png)

*Federation*

&nbsp; &nbsp; ![Federation](assets/probes-federation.png)

*Elastic Data*

&nbsp; &nbsp; ![elastic Data](assets/probes-elastic-data.png)

> 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.

## <a id="build"></a> Building the Plugin

Expand All @@ -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

Expand Down
Binary file added assets/probes-caches.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/probes-cluster-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/probes-elastic-data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/probes-federation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/probes-persistence.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/probes-proxies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/probes-services.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/probes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion coherence-visualvm-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<parent>
<groupId>com.oracle.coherence.plugin.visualvm</groupId>
<artifactId>coherence-visualvm-main</artifactId>
<version>1.6.3-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -107,6 +107,11 @@
<artifactId>org-graalvm-visualvm-lib-ui</artifactId>
</dependency>

<dependency>
<groupId>org.graalvm.visualvm.modules</groupId>
<artifactId>org-graalvm-visualvm-modules-tracer</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
Expand Down Expand Up @@ -164,6 +169,10 @@
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version.release}</release>
<compilerArgs>
<arg>--add-opens</arg>
<arg>jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;

/**
Expand All @@ -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);
}

/**
Expand All @@ -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<Application>
{

TracerPackageProviderImpl()
{
super(Application.class);
}

public TracerPackage<Application>[] 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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*/
Expand Down
Loading