Search in sources :

Example 6 with IMBeanServer

use of org.talend.designer.runtime.visualization.MBean.IMBeanServer in project tdi-studio-se by Talend.

the class LoadChartAction 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 = graphComposite.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$
    //        group = server.addMonitoredAttributeGroup("Thread Count", AxisUnit.Count); //$NON-NLS-1$
    //        group.addAttribute(ManagementFactory.THREAD_MXBEAN_NAME, "ThreadCount", //$NON-NLS-1$
    // 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 7 with IMBeanServer

use of org.talend.designer.runtime.visualization.MBean.IMBeanServer in project tdi-studio-se by Talend.

the class LoadChartAction method loadChartSet.

/**
     * Loads the given memento of chart set.
     * 
     * @param memento The memento
     * @throws JvmCoreException
     */
private void loadChartSet(IMemento memento) throws JvmCoreException {
    IMBeanServer server = graphComposite.getJvm().getMBeanServer();
    server.getMonitoredAttributeGroups().clear();
    StringBuffer buffer = new StringBuffer();
    for (IMemento groupMemento : memento.getChildren(GROUP)) {
        IMonitoredMXBeanGroup group = server.addMonitoredAttributeGroup(groupMemento.getID(), AxisUnit.valueOf(groupMemento.getString(UNIT)));
        for (IMemento attributeMemento : groupMemento.getChildren(ATTRIBUTE)) {
            String objectName = attributeMemento.getString(OBJECT_NAME);
            String attributeName = attributeMemento.getID();
            if (attributeExist(objectName, attributeName)) {
                group.addAttribute(objectName, attributeName, getRGB(attributeMemento.getString(COLOR)));
            } else {
                buffer.append('\n');
                buffer.append(objectName + ':' + attributeName);
            }
        }
    }
    if (buffer.length() > 0) {
        MessageDialog.openError(Display.getDefault().getActiveShell(), Messages.errorDialogTitle, NLS.bind(Messages.attributeNotSupportedMsg, buffer.toString()));
    }
}
Also used : IMBeanServer(org.talend.designer.runtime.visualization.MBean.IMBeanServer) IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup) IMemento(org.eclipse.ui.IMemento)

Example 8 with IMBeanServer

use of org.talend.designer.runtime.visualization.MBean.IMBeanServer 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 9 with IMBeanServer

use of org.talend.designer.runtime.visualization.MBean.IMBeanServer 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 10 with IMBeanServer

use of org.talend.designer.runtime.visualization.MBean.IMBeanServer 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)

Aggregations

IMBeanServer (org.talend.designer.runtime.visualization.MBean.IMBeanServer)10 IMonitoredMXBeanGroup (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup)7 IMemento (org.eclipse.ui.IMemento)2 IActiveJvm (org.talend.designer.runtime.visualization.IActiveJvm)1