use of org.eclipse.linuxtools.internal.valgrind.massif.charting.HeapChart in project linuxtools by eclipse.
the class ChartTests method byteScalingHelper.
private void byteScalingHelper(int ix, long times, long bytes, String testName) throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, // $NON-NLS-1$
String.valueOf(bytes) + " " + String.valueOf(times));
wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_TIMEUNIT, MassifLaunchConstants.TIME_B);
config = wc.doSave();
doLaunch(config, testName);
IAction chartAction = getChartAction();
assertNotNull(chartAction);
chartAction.run();
IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
assertTrue(part.getEditorInput() instanceof ChartEditorInput);
ChartEditorInput input = (ChartEditorInput) part.getEditorInput();
HeapChart chart = input.getChart();
assertEquals(HeapChart.getByteUnits()[ix], chart.getXUnits());
}
use of org.eclipse.linuxtools.internal.valgrind.massif.charting.HeapChart in project linuxtools by eclipse.
the class MassifViewPart method createChart.
private void createChart(MassifSnapshot[] snapshots) {
// $NON-NLS-1$//$NON-NLS-2$
String title = chartName + " [PID: " + pid + "]";
HeapChart chart = new HeapChart(snapshots, title);
String name = getInputName(title);
ChartEditorInput input = new ChartEditorInput(chart, this, name, pid);
chartInputs.add(input);
// open the editor
displayChart(input);
}
use of org.eclipse.linuxtools.internal.valgrind.massif.charting.HeapChart in project linuxtools by eclipse.
the class ChartTests method testChartCallback.
@Test
public void testChartCallback() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testChartCallback");
IAction chartAction = getChartAction();
assertNotNull(chartAction);
chartAction.run();
IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
assertTrue(part instanceof ChartEditor);
Chart control = ((ChartEditor) part).getControl();
ILineSeries lsTotal = (ILineSeries) control.getSeriesSet().getSeries(// $NON-NLS-1$
Messages.getString("HeapChart.Total_Heap"));
Point p1 = lsTotal.getPixelCoordinates(4);
HeapChart heapChart = ((ChartEditorInput) ((ChartEditor) part).getEditorInput()).getChart();
int x = control.getAxisSet().getXAxis(0).getPixelCoordinate(heapChart.time[4]);
int y = control.getAxisSet().getYAxis(0).getPixelCoordinate(heapChart.dataTotal[4]);
assertEquals(x, p1.x);
assertEquals(y, p1.y);
}
Aggregations