use of org.talend.designer.runtime.visualization.internal.core.cpu.ICallTreeNode in project tdi-studio-se by Talend.
the class CallTreeLabelProvider method getSelfTimeInMsColumnText.
/**
* Gets the self time in milliseconds column text.
*
* @param element the element
* @return the self time column text
*/
private String getSelfTimeInMsColumnText(Object element) {
ICpuModel cpuModel = (ICpuModel) treeViewer.getInput();
if (cpuModel == null) {
//$NON-NLS-1$
return "";
}
if (element instanceof ICallTreeNode) {
long totalTime = ((ICallTreeNode) element).getSelfTime();
int length = String.valueOf(cpuModel.getMaxSelfTime() * 1000).length();
length = (length > 10) ? 10 : length;
return getMillisecondsText(totalTime, length);
}
//$NON-NLS-1$
return "";
}
use of org.talend.designer.runtime.visualization.internal.core.cpu.ICallTreeNode 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 "";
}
use of org.talend.designer.runtime.visualization.internal.core.cpu.ICallTreeNode in project tdi-studio-se by Talend.
the class CallTreeTabPage method refreshContentDescription.
/**
* Refreshes the content description.
*/
private void refreshContentDescription() {
if (jvm == null) {
return;
}
ICallTreeNode focusedNode = jvm.getCpuProfiler().getCpuModel().getFocusTarget();
StringBuilder description = new StringBuilder();
if (focusedNode != null) {
description.append(NLS.bind(Messages.focusTargetIndicator, focusedNode.getNonqualifiedName())).append(NLS.bind(Messages.threadIndicator, focusedNode.getThread()));
}
setContentDescription(description.toString());
}
use of org.talend.designer.runtime.visualization.internal.core.cpu.ICallTreeNode in project tdi-studio-se by Talend.
the class CallerCalleeTabPage method refreshContentDescription.
/**
* Refreshes the content description.
*/
private void refreshContentDescription() {
if (jvm == null) {
return;
}
StringBuilder description = new StringBuilder();
IMethodNode callersCalleesTarget = jvm.getCpuProfiler().getCpuModel().getCallersCalleesTarget();
if (callersCalleesTarget != null) {
description.append(NLS.bind(Messages.callersCalleesTargetIndicator, callersCalleesTarget.getName()));
}
ICpuModel cpuModel = jvm.getCpuProfiler().getCpuModel();
ICallTreeNode focusedNode = cpuModel.getFocusTarget();
if (focusedNode != null) {
if (callersCalleesTarget != null) {
description.append(NLS.bind(Messages.focusTargetIndicator, focusedNode.getNonqualifiedName()));
}
}
String thread = null;
if (focusedNode != null) {
thread = focusedNode.getThread();
} else if (callersCalleesTarget != null) {
thread = callersCalleesTarget.getThread();
}
if (description.length() > 0 && thread != null) {
description.append(NLS.bind(Messages.threadIndicator, thread));
}
setContentDescription(description.toString());
}
use of org.talend.designer.runtime.visualization.internal.core.cpu.ICallTreeNode in project tdi-studio-se by Talend.
the class FocusOnAction method aboutToShow.
/**
* Notifies when menu is about to be shown.
*/
public void aboutToShow() {
ICpuModel cpuModel = (ICpuModel) filteredTree.getViewer().getInput();
boolean focused = cpuModel.getFocusTarget() != null;
setChecked(focused);
Object element = ((TreeSelection) filteredTree.getViewer().getSelection()).getFirstElement();
// frame is selected on call tree
if (element instanceof ICallTreeNode) {
selectedNode = (ICallTreeNode) element;
setEnabled(true);
if (!focused) {
updateMenu();
}
return;
}
if (filteredTree.getViewerType() == ViewerType.CallTree) {
// thread node is selected on call tree
selectedNode = null;
} else {
selectedNode = cpuModel.getFocusTarget();
}
setEnabled(focused);
updateMenu();
}
Aggregations