use of org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup in project tdi-studio-se by Talend.
the class LoadChartAction method loadMemoryChartSet.
/**
* Loads the memory chart set.
*
* @throws JvmCoreException
*/
private void loadMemoryChartSet() throws JvmCoreException {
final int[] blue = new int[] { 0, 0, 255 };
final int[] green = new int[] { 0, 255, 0 };
IMBeanServer server = graphComposite.getJvm().getMBeanServer();
server.getMonitoredAttributeGroups().clear();
//$NON-NLS-1$
IMonitoredMXBeanGroup group = server.addMonitoredAttributeGroup("Heap Memory", AxisUnit.MBytes);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, "HeapMemoryUsage.used", blue);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, "HeapMemoryUsage.committed", green);
//$NON-NLS-1$
group = server.addMonitoredAttributeGroup("Non-Heap Memory", AxisUnit.MBytes);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, "NonHeapMemoryUsage.used", blue);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, "NonHeapMemoryUsage.committed", green);
//$NON-NLS-1$
group = server.addMonitoredAttributeGroup("Heap Memory Pool", AxisUnit.MBytes);
for (String objectName : getMemoryPoolObjectNames(HEAP_MEMORYPOOL_MXBEANS)) {
//$NON-NLS-1$
group.addAttribute(objectName, "Usage.used", blue);
}
//$NON-NLS-1$
group = server.addMonitoredAttributeGroup("Non-Heap Memory Pool", AxisUnit.MBytes);
for (String objectName : getMemoryPoolObjectNames(NON_HEAP_MEMORYPOOL_MXBEANS)) {
//$NON-NLS-1$
group.addAttribute(objectName, "Usage.used", blue);
}
}
use of org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup in project tdi-studio-se by Talend.
the class LoadChartSetAction method loadOverviewChartSet.
/**
* Loads the overview chart set.
*
* @throws JvmCoreException
*/
private void loadOverviewChartSet() throws JvmCoreException {
final int[] blue = new int[] { 0, 0, 255 };
final int[] red = new int[] { 255, 0, 0 };
final int[] green = new int[] { 0, 255, 0 };
final int[] orange = new int[] { 255, 128, 0 };
IMBeanServer server = section.getJvm().getMBeanServer();
server.getMonitoredAttributeGroups().clear();
//$NON-NLS-1$
IMonitoredMXBeanGroup group = server.addMonitoredAttributeGroup("Used Heap Memory", AxisUnit.MBytes);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, "HeapMemoryUsage.used", blue);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, "HeapMemoryUsage.maxsize", red);
// group = server.addMonitoredAttributeGroup("Loaded Class Count", AxisUnit.Count); //$NON-NLS-1$
// group.addAttribute(ManagementFactory.CLASS_LOADING_MXBEAN_NAME, "LoadedClassCount", blue); //$NON-NLS-1$
//$NON-NLS-1$
group = server.addMonitoredAttributeGroup("Thread Count", AxisUnit.Count);
//$NON-NLS-1$
group.addAttribute(//$NON-NLS-1$
ManagementFactory.THREAD_MXBEAN_NAME, //$NON-NLS-1$
"ThreadCount", orange);
//$NON-NLS-1$
group = server.addMonitoredAttributeGroup("CPU Usage", AxisUnit.Percent);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME, "ProcessCpuTime", green);
}
use of org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup in project tdi-studio-se by Talend.
the class LoadChartSetAction method loadMemoryChartSet.
/**
* Loads the memory chart set.
*
* @throws JvmCoreException
*/
private void loadMemoryChartSet() throws JvmCoreException {
final int[] blue = new int[] { 0, 0, 255 };
final int[] green = new int[] { 0, 255, 0 };
IMBeanServer server = section.getJvm().getMBeanServer();
server.getMonitoredAttributeGroups().clear();
//$NON-NLS-1$
IMonitoredMXBeanGroup group = server.addMonitoredAttributeGroup("Heap Memory", AxisUnit.MBytes);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, "HeapMemoryUsage.used", blue);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, "HeapMemoryUsage.committed", green);
//$NON-NLS-1$
group = server.addMonitoredAttributeGroup("Non-Heap Memory", AxisUnit.MBytes);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, "NonHeapMemoryUsage.used", blue);
//$NON-NLS-1$
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, "NonHeapMemoryUsage.committed", green);
//$NON-NLS-1$
group = server.addMonitoredAttributeGroup("Heap Memory Pool", AxisUnit.MBytes);
for (String objectName : getMemoryPoolObjectNames(HEAP_MEMORYPOOL_MXBEANS)) {
//$NON-NLS-1$
group.addAttribute(objectName, "Usage.used", blue);
}
//$NON-NLS-1$
group = server.addMonitoredAttributeGroup("Non-Heap Memory Pool", AxisUnit.MBytes);
for (String objectName : getMemoryPoolObjectNames(NON_HEAP_MEMORYPOOL_MXBEANS)) {
//$NON-NLS-1$
group.addAttribute(objectName, "Usage.used", blue);
}
}
use of org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup in project tdi-studio-se by Talend.
the class MBeanServer method removeMonitoredAttributeGroup.
/*
* @see IMBeanServer#removeMonitoredAttributeGroup(String)
*/
@Override
public void removeMonitoredAttributeGroup(String name) {
Assert.isNotNull(name);
IMonitoredMXBeanGroup targetGroup = null;
for (IMonitoredMXBeanGroup group : monitoredAttributeGroups) {
if (group.getName().equals(name)) {
targetGroup = group;
break;
}
}
if (targetGroup != null) {
monitoredAttributeGroups.remove(targetGroup);
fireMBeanServerChangeEvent(new MBeanServerEvent(MBeanServerState.MonitoredAttributeGroupRemoved, targetGroup));
}
}
use of org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup in project tdi-studio-se by Talend.
the class ShowInTimelineAction method performShowInTimeline.
/**
* Performs showing a new chart with attributes in Timeline tab.
*
* @param chartTitle The chart title
* @param axisUnit The axis unit
* @param attributes The attributes
*/
private void performShowInTimeline(String chartTitle, AxisUnit axisUnit, List<MBeanAttribute> attributes) {
IActiveJvm jvm = section.getJvm();
if (jvm == null) {
return;
}
IMonitoredMXBeanGroup group = jvm.getMBeanServer().addMonitoredAttributeGroup(chartTitle, axisUnit);
for (MBeanAttribute attribute : attributes) {
ObjectName objectName = attribute.getObjectName();
String attributeName = attribute.getAttributeName();
RGB rgb = attribute.getRgb();
try {
group.addAttribute(objectName.getCanonicalName(), attributeName, new int[] { rgb.red, rgb.green, rgb.blue });
} catch (JvmCoreException e) {
Activator.log(NLS.bind(Messages.addAttributeFailedMsg, attributeName), e);
}
}
}
Aggregations