Skip to content

Commit

Permalink
Add storage-members
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiddlet2666 committed Mar 8, 2024
1 parent a5375d3 commit ee0af3b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ private static ProbeItemDescriptor[] createItemDescriptors()

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

private static final String LBL = "GRPH_total_cache";
private static final String LBL = "LBL_total_cache";
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@
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.
Expand All @@ -47,20 +53,32 @@ public class ClusterSizeProbe

public ClusterSizeProbe(MonitoredDataResolver resolver)
{
super(1, createItemDescriptors(), resolver);
super(12, createItemDescriptors(), resolver);
}

// ---- TracerProbe methods ---------------------------------------------

@Override
public long[] getValues(VisualVMModel model)
{
return getSingValue(model, VisualVMModel.DataType.CLUSTER, ClusterData.CLUSTER_SIZE, ZERO_VALUES1);
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<Object, Data> 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),
return new TracerProbeDescriptor(Localization.getLocalText("LBL_cluster_members"),
Localization.getLocalText("LBL_members_desc"), ICON, 5, available);
}

Expand All @@ -71,10 +89,14 @@ private static ProbeItemDescriptor[] createItemDescriptors()
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 LBL = "LBL_total_members";
private static final String LBL2 = "LBL_total_storage_members";
}
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,10 @@ LBL_storage_members_heap_desc=Monitors allocated and used Heap size for storage
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 cluster members.
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_monitors=Monitors
LBL_cluster_members=Cluster Members
LBL_total_cache=Total Primary Cache Data Memory

0 comments on commit ee0af3b

Please sign in to comment.