Search in sources :

Example 16 with IMonitoredMXBeanGroup

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);
    }
}
Also used : IMBeanServer(org.talend.designer.runtime.visualization.MBean.IMBeanServer) IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup)

Example 17 with IMonitoredMXBeanGroup

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);
}
Also used : IMBeanServer(org.talend.designer.runtime.visualization.MBean.IMBeanServer) IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup)

Example 18 with IMonitoredMXBeanGroup

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);
    }
}
Also used : IMBeanServer(org.talend.designer.runtime.visualization.MBean.IMBeanServer) IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup)

Example 19 with IMonitoredMXBeanGroup

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));
    }
}
Also used : IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup) MBeanServerEvent(org.talend.designer.runtime.visualization.MBean.MBeanServerEvent)

Example 20 with IMonitoredMXBeanGroup

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);
        }
    }
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup) MBeanAttribute(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.MBeanAttribute) RGB(org.eclipse.swt.graphics.RGB) ObjectName(javax.management.ObjectName) JvmCoreException(org.talend.designer.runtime.visualization.JvmCoreException)

Aggregations

IMonitoredMXBeanGroup (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup)22 IMBeanServer (org.talend.designer.runtime.visualization.MBean.IMBeanServer)7 JvmCoreException (org.talend.designer.runtime.visualization.JvmCoreException)6 IMonitoredMXBeanAttribute (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanAttribute)6 IActiveJvm (org.talend.designer.runtime.visualization.IActiveJvm)5 ObjectName (javax.management.ObjectName)4 RGB (org.eclipse.swt.graphics.RGB)4 Date (java.util.Date)3 IMemento (org.eclipse.ui.IMemento)3 AxisUnit (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup.AxisUnit)2 MBeanServerEvent (org.talend.designer.runtime.visualization.MBean.MBeanServerEvent)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 FormLayout (org.eclipse.swt.layout.FormLayout)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)1