use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.
the class SuspendCpuProfilingAction method performRun.
/*
* @see AbstractJobAction#performRun(IProgressMonitor)
*/
@Override
protected IStatus performRun(IProgressMonitor monitor) {
IActiveJvm jvm = section.getJvm();
if (jvm == null) {
return Status.CANCEL_STATUS;
}
try {
jvm.getCpuProfiler().suspend();
} catch (JvmCoreException e) {
Activator.log(Messages.suspendingCpuProfilingFailedMsg, e);
}
resumeAction.setEnabled(true);
return Status.OK_STATUS;
}
use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.
the class CpuSection method setProfilerSamplingPeriod.
/**
* Sets the profiler sampling period.
*/
void setProfilerSamplingPeriod() {
IActiveJvm jvm = getJvm();
if (jvm == null) {
return;
}
Integer period = null;
String periodString = Activator.getDefault().getDialogSettings(CpuSection.class.getName()).get(IConstants.PROFILER_SAMPLING_PERIOD_KEY);
if (periodString != null) {
try {
period = Integer.valueOf(periodString);
} catch (NumberFormatException e) {
// do nothing
}
}
if (period == null) {
period = DEFAULT_SAMPLING_PERIOD;
}
jvm.getCpuProfiler().setSamplingPeriod(period);
}
use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.
the class CpuSection method jvmModelChanged.
/*
* @see AbstractJvmPropertySection#jvmModelChanged(JvmModelEvent)
*/
@Override
public void jvmModelChanged(JvmModelEvent event) {
super.jvmModelChanged(event);
IActiveJvm jvm = getJvm();
if (jvm == null || event.jvm == null || event.jvm.getPid() != jvm.getPid() || !(event.jvm instanceof IActiveJvm)) {
return;
}
if (event.state == State.JvmConnected) {
refresh(true);
}
}
use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.
the class ConfigChartAction method run.
/*
* @see Action#run()
*/
@Override
public void run() {
IActiveJvm jvm = runtimeComposite.getJvm();
if (jvm == null) {
return;
}
String title = chart.getSection().getText();
IMonitoredMXBeanGroup group = chart.getAttributeGroup();
AxisUnit unit = group.getAxisUnit();
List<MBeanAttribute> attributes = getAttributes();
ConfigureChartDialog dialog = new ConfigureChartDialog(chart.getShell(), title, unit, attributes, jvm, true);
if (dialog.open() == Window.OK) {
performConfiguration(dialog.getChartTitle(), dialog.getAxisUnit(), dialog.getAttributes(), dialog.getRemovedAttributes());
}
}
use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.
the class OverviewSection method getDialogSettings.
/**
* Gets the dialog settings for the tree expansion state.
*
* @return The dialog settings
*/
private IDialogSettings getDialogSettings() {
String id = sectionName;
IActiveJvm jvm = getJvm();
if (jvm != null) {
id += jvm.getPid();
}
IDialogSettings settings = Activator.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(id);
if (section == null) {
section = settings.addNewSection(id);
}
return section;
}
Aggregations