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 31edd38..dd4ddaa 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 @@ -32,6 +32,8 @@ 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.proxy.ProxyMonitorPackage; import com.oracle.coherence.plugin.visualvm.tracer.service.ServiceMonitorPackage; @@ -117,7 +119,9 @@ public TracerPackage[] getPackages(Application application) new ClusterMonitorPackage(application), new ProxyMonitorPackage(application), new ServiceMonitorPackage(application), - new CacheMonitorPackage(application) + new CacheMonitorPackage(application), + new FederationMonitorPackage(application), + new ElasticDataMonitorPackage(application) }; } } 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..742207f --- /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 = 570; + + 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..80e3f8f --- /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.RamJournalData; + +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, RamJournalData.FILE_COUNT, ZERO_VALUES1)[0]; + long nRamJournaMaxFiles = getSingValueSum(model, VisualVMModel.DataType.FLASHJOURNAL, RamJournalData.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..14d8ebe --- /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.RamJournalData; + +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, RamJournalData.TOTAL_COMMITTED_BYTES, ZERO_VALUES1)[0]; + long nRamJournalUsed = getSingValueSum(model, VisualVMModel.DataType.FLASHJOURNAL, RamJournalData.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..4d9c139 --- /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.RamJournalData; + +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, RamJournalData.FILE_COUNT, ZERO_VALUES1)[0]; + long nRamJournaMaxFiles = getSingValueSum(model, VisualVMModel.DataType.RAMJOURNAL, RamJournalData.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..16acc97 --- /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.RamJournalData; + +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, RamJournalData.TOTAL_COMMITTED_BYTES, ZERO_VALUES1)[0]; + long nRamJournalUsed = getSingValueSum(model, VisualVMModel.DataType.RAMJOURNAL, RamJournalData.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..6a069a2 --- /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 = 550; + + 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/resources/com/oracle/coherence/plugin/visualvm/Bundle.properties b/coherence-visualvm-plugin/src/main/resources/com/oracle/coherence/plugin/visualvm/Bundle.properties index aa363b6..39e2dce 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 @@ -714,9 +714,13 @@ 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_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_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. @@ -724,7 +728,15 @@ LBL_service_endangered_desc=Monitors the total number of endangered partitions a 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_cache_size_desc=Monitors the total number of cache entries in all caches across 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.