Skip to content

Commit

Permalink
Incorporate review comments (#84)
Browse files Browse the repository at this point in the history
* Incorporate review comments
* Add 24.03
* Update README
* Update image
* Correct target version to 1.8
  • Loading branch information
tmiddlet2666 authored Mar 28, 2024
1 parent edf76ae commit f213f41
Show file tree
Hide file tree
Showing 42 changed files with 196 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-against-released.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ jobs:
- 14.1.1-0-16
- 22.06.7
- 22.06.6
- 23.09
- 23.09.1
- 23.09.2
- 24.03

steps:
- name: Checkout
Expand Down
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ NOTE: The most current version of the Plugin requires VisualVM release 2.1 or la

The Plugin will connect to and display data for the following Coherence versions:

* **Community Editions**: 24.03.x, 23.09.x, 22.06.x, 21.12.x (*), 14.1.1.0.x
* **Community Editions**: 24.03.x, 23.09.x, 22.06.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
* **Commercial Editions**: 14.1.1.2206.x, 14.1.1.0.x and 12.2.1.4.x

>Note: If you wish to connect to Coherence version 12.2.1.4.x via REST you should have Coherence version 12.2.1.4.7 or greater.
Expand Down Expand Up @@ -195,18 +195,37 @@ Depending upon the edition and functionality you are using, the following option

## <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.
Version 1.7.0 of the Coherence VisualVM Plugin introduces initial integration with the
VisualVM Tracer framework.

From the VisualVM website
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:
After installation, when you connect to a cluster via JMX, you will see the `Tracer` tab as shown below:

TBC.
![Tracer Tab](assets/visualvm-tracer.png)

There are a number of expandable groups allowing you to choose Coherence related probes to display on the timeline including:

* Coherence Cluster Overview - shows general cluster data such as members, heap, package publisher/receive rates and load averages
* Coherence Services - Overall - shows overall service partition data
* Coherence Services - Selected - shows data for the selected service only
* Coherence Caches - Overall - shows overall cache data such as total cache sizes and memory usage
* Coherence Caches - Selected - shows data for the selected cache only
* Coherence Proxy Servers - shows proxy connection details and outgoing backlogs
* Coherence Persistence - shows active and backup persistence data as well as maximum latency
* Coherence Federation - shows send and receive rates
* Coherence Elastic Data - shows elastic data flash a ram journal usage

To start recording tracer data, select the tracer probes that you wish to display and click `Start`.

> Note: The data displayed is the same as is display on the various Coherence tabs.
![Tracer Tab](assets/visualvm-tracer-timeline.png)

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

Expand Down
Binary file added assets/visualvm-tracer-timeline.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/visualvm-tracer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions coherence-visualvm-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@
<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
Expand Up @@ -27,12 +27,17 @@

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;

import static com.oracle.coherence.plugin.visualvm.helper.GraphHelper.MB;

/**
* Tracer probe to return the total memory size of all caches across all services.
*
Expand Down Expand Up @@ -68,7 +73,7 @@ private static ProbeItemDescriptor[] createItemDescriptors()
{
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
getMonitorsString(LBL), ItemValueFormatter.DEFAULT_BYTES,
1d, 0, 1),
1d, 0, MB),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

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;
Expand All @@ -36,6 +35,8 @@
import org.graalvm.visualvm.modules.tracer.ProbeItemDescriptor;
import org.graalvm.visualvm.modules.tracer.TracerProbeDescriptor;

import static com.oracle.coherence.plugin.visualvm.Localization.getLocalText;

/**
* Tracer probe to return the total number of cache entries across all services.
*
Expand All @@ -61,17 +62,17 @@ public long[] getValues(VisualVMModel model)

public static TracerProbeDescriptor createDescriptor(boolean available)
{
return new TracerProbeDescriptor(Localization.getLocalText(LBL),
Localization.getLocalText("LBL_cache_size_desc"), ICON, 10, available);
return new TracerProbeDescriptor(getLocalText(LBL),
getLocalText("LBL_cache_size_desc"), ICON, 10, available);
}

private static ProbeItemDescriptor[] createItemDescriptors()
{
return new ProbeItemDescriptor[]
{
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
ProbeItemDescriptor.continuousLineFillItem(getLocalText("LBL_all_caches") + " - " + getLocalText(LBL),
getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
1d, 0, 1),
1d, 0, 0),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ private static ProbeItemDescriptor[] createItemDescriptors()
{
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL1),
getMonitorsString(LBL1), ItemValueFormatter.DEFAULT_DECIMAL,
1d, 0, 1),
1d, 0, 0),
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL2),
getMonitorsString(LBL2), ItemValueFormatter.DEFAULT_DECIMAL,
1d, 0, 1),
1d, 0, 0),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ private static ProbeItemDescriptor[] createItemDescriptors()
{
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL1),
getMonitorsString(LBL1), ItemValueFormatter.DEFAULT_BYTES,
1d, 0, 1),
1d, 0, 0),
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL2),
getMonitorsString(LBL2), ItemValueFormatter.DEFAULT_BYTES,
1d, 0, 1),
1d, 0, 0),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ private static ProbeItemDescriptor[] createItemDescriptors()
{
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
getMonitorsString(LBL), new CustomFormatter(1000, "ms"),
1000d, 0, 1),
1000d, 0, 0),
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL2),
getMonitorsString(LBL2), new CustomFormatter(1000, "ms"),
1000d, 0, 1),
1000d, 0, 0),
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL3),
getMonitorsString(LBL3), new CustomFormatter(1000, "ms"),
1000d, 0, 1),
1000d, 0, 0),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@

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.tablemodel.model.CacheDetailData;

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.Localization.getLocalText;

/**
* Tracer probe to return the total number of cache entries across all services.
*
Expand All @@ -59,17 +63,17 @@ public long[] getValues(VisualVMModel model)

public static TracerProbeDescriptor createDescriptor(boolean available)
{
return new TracerProbeDescriptor(Localization.getLocalText("LBL_selected_cache_size"),
Localization.getLocalText("LBL_selected_cache_size_desc"), ICON, 10, available);
return new TracerProbeDescriptor(getLocalText("LBL_selected_cache_size"),
getLocalText("LBL_selected_cache_size_desc"), ICON, 10, available);
}

private static ProbeItemDescriptor[] createItemDescriptors()
{
return new ProbeItemDescriptor[]
{
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
ProbeItemDescriptor.continuousLineFillItem(getLocalText("LBL_cache") + " - " + getLocalText(LBL),
getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
1d, 0, 1),
1d, 0, 0),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ private static ProbeItemDescriptor[] createItemDescriptors()
{
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
1d, 0, 1),
1d, 0, 0),
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL2),
getMonitorsString(LBL2), ItemValueFormatter.DEFAULT_DECIMAL,
1d, 0, 1),
1d, 0, 0),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static ProbeItemDescriptor[] createItemDescriptors()
{
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(LBL),
getMonitorsString(LBL), ItemValueFormatter.DEFAULT_DECIMAL,
1d, 0, 1),
1d, 0, 0),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@
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;

import static com.oracle.coherence.plugin.visualvm.Localization.getLocalText;
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;


/**
* Tracer probe to return average and max load average.
*
Expand Down Expand Up @@ -73,27 +74,31 @@ public long[] getValues(VisualVMModel model)

return new long[]
{
(long) ((cTotalLoadAverage / (cCount * 1.0f)) * 1000),
(long) (cMax * 1000)
(long) (cMax * 1000),
(long) ((cTotalLoadAverage / (cCount * 1.0f)) * 1000)
};
}

public static TracerProbeDescriptor createDescriptor(boolean available)
{
return new TracerProbeDescriptor(Localization.getLocalText("GRPH_load_average"),
Localization.getLocalText("LBL_load_average_desc"), ICON, 15, available);
return new TracerProbeDescriptor(getLocalText("GRPH_load_average"),
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),
ProbeItemDescriptor.continuousLineFillItem(getLocalText(LBL) + " - " + getLocalText(GRPH_MAXIMUM),
getMonitorsString(GRPH_MAXIMUM), CUSTOM_FORMATTER,
1000, 0, 1)
1000, 0, 0),
ProbeItemDescriptor.continuousLineFillItem(getLocalText(LBL) + " - " + getLocalText(GRPH_CURRENT_AVERAGE),
getMonitorsString(GRPH_CURRENT_AVERAGE), CUSTOM_FORMATTER,
1000, 0, 0)
};
}

// ----- constants ------------------------------------------------------

private static final String LBL = "LBL_load_average";
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,19 @@
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;

import static com.oracle.coherence.plugin.visualvm.Localization.getLocalText;
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;


/**
* Tracer probe to return average and minimum package publisher.
*
Expand All @@ -52,7 +53,7 @@ public class PacketPublisherProbe

public PacketPublisherProbe(MonitoredDataResolver resolver)
{
super(2, createItemDescriptors(), resolver);
super(2, createItemDescriptors("LBL_publisher"), resolver);
}

// ---- TracerProbe methods ---------------------------------------------
Expand Down Expand Up @@ -82,18 +83,18 @@ public long[] getValues(VisualVMModel model)

public static TracerProbeDescriptor createDescriptor(boolean available)
{
return new TracerProbeDescriptor(Localization.getLocalText("GRPH_packet_publisher"),
Localization.getLocalText("LBL_packet_publisher_desc"), ICON, 15, available);
return new TracerProbeDescriptor(getLocalText("GRPH_packet_publisher"),
getLocalText("LBL_packet_publisher_desc"), ICON, 15, available);
}

protected static ProbeItemDescriptor[] createItemDescriptors()
protected static ProbeItemDescriptor[] createItemDescriptors(String sLabel)
{
return new ProbeItemDescriptor[]
{
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(GRPH_CURRENT_AVERAGE),
ProbeItemDescriptor.continuousLineFillItem(getLocalText(sLabel) + " - " + getLocalText(GRPH_CURRENT_AVERAGE),
getMonitorsString(GRPH_CURRENT_AVERAGE), CUSTOM_FORMATTER,
1, 0, 1000),
ProbeItemDescriptor.continuousLineFillItem(Localization.getLocalText(GRPH_MINIMUM),
ProbeItemDescriptor.continuousLineFillItem(getLocalText(sLabel) + " - " + getLocalText(GRPH_MINIMUM),
getMonitorsString(GRPH_MINIMUM), CUSTOM_FORMATTER,
1, 0, 1000)
};
Expand Down
Loading

0 comments on commit f213f41

Please sign in to comment.