-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09bdd87
commit df81533
Showing
11 changed files
with
776 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...ain/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyConnectionCountProbe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
} |
114 changes: 114 additions & 0 deletions
114
.../src/main/java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyMonitorPackage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Application> 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<Application> 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 = 520; | ||
|
||
private TracerProbeDescriptor m_proxyConnectionsProbeDescriptor; | ||
private TracerProbeDescriptor m_proxyOutgoingMsgProbeDescriptor; | ||
|
||
private AbstractCoherenceMonitorProbe m_proxyConnectionsProbe; | ||
private AbstractCoherenceMonitorProbe m_proxyOutgoingMsgBacklogProbe; | ||
|
||
private final VisualVMModel f_model; | ||
} |
81 changes: 81 additions & 0 deletions
81
.../java/com/oracle/coherence/plugin/visualvm/tracer/proxy/ProxyOutgoingMsgBacklogProbe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
} |
Oops, something went wrong.