Search in sources :

Example 1 with IThreadNode

use of org.talend.designer.runtime.visualization.internal.core.cpu.IThreadNode in project tdi-studio-se by Talend.

the class CallTreeLabelProvider method getTimeInMsColumnText.

/**
     * Gets the time in milliseconds column text.
     * 
     * @param element the element
     * @return the time column text
     */
private String getTimeInMsColumnText(Object element) {
    ICpuModel cpuModel = (ICpuModel) treeViewer.getInput();
    if (cpuModel == null) {
        //$NON-NLS-1$
        return "";
    }
    int length = String.valueOf(cpuModel.getMaxTotalTime() * 1000).length();
    length = (length > 10) ? 10 : length;
    if (element instanceof IThreadNode) {
        String milliseconds = getMillisecondsText(((IThreadNode) element).getTotalTime(), length);
        return milliseconds;
    } else if (element instanceof ICallTreeNode) {
        long totalTime = ((ICallTreeNode) element).getTotalTime();
        return getMillisecondsText(totalTime, length);
    }
    //$NON-NLS-1$
    return "";
}
Also used : IThreadNode(org.talend.designer.runtime.visualization.internal.core.cpu.IThreadNode) ICallTreeNode(org.talend.designer.runtime.visualization.internal.core.cpu.ICallTreeNode) ICpuModel(org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel)

Aggregations

ICallTreeNode (org.talend.designer.runtime.visualization.internal.core.cpu.ICallTreeNode)1 ICpuModel (org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel)1 IThreadNode (org.talend.designer.runtime.visualization.internal.core.cpu.IThreadNode)1