/* * Copied from super class, but changed so that a custom ReconcileWorkingCopyOperation can be run */ @Override public org.eclipse.jdt.core.dom.CompilationUnit reconcile( int astLevel, int reconcileFlags, WorkingCopyOwner workingCopyOwner, IProgressMonitor monitor) throws JavaModelException { if (!isWorkingCopy()) return null; // Reconciling is not supported on non working copies if (workingCopyOwner == null) workingCopyOwner = DefaultWorkingCopyOwner.PRIMARY; PerformanceStats stats = null; if (ReconcileWorkingCopyOperation.PERF) { stats = PerformanceStats.getStats(JavaModelManager.RECONCILE_PERF, this); stats.startRun(new String(this.getFileName())); } ReconcileWorkingCopyOperation op = new GroovyReconcileWorkingCopyOperation(this, astLevel, reconcileFlags, workingCopyOwner); JavaModelManager manager = JavaModelManager.getJavaModelManager(); try { manager.cacheZipFiles(this); // cache zip files for performance (see // https://bugs.eclipse.org/bugs/show_bug.cgi?id=134172) op.runOperation(monitor); } finally { manager.flushZipFiles(this); } if (ReconcileWorkingCopyOperation.PERF) { stats.endRun(); } return op.ast; }
private static void connectFTPClient(FTPClient ftpClient) throws IOException, FTPException { PerformanceStats stats = PerformanceStats.getStats( "com.aptana.ide.filesystem.ftp/perf/connect", //$NON-NLS-1$ FTPConnectionFileManager.class.getName()); stats.startRun(ftpClient.getRemoteHost()); try { ftpClient.connect(); } finally { stats.endRun(); } }
private PerformanceStats startMeter(Object context, IRubyCompletionProposalComputer computer) { final PerformanceStats stats; if (MEASURE_PERFORMANCE) { stats = PerformanceStats.getStats(PERFORMANCE_EVENT, computer); stats.startRun(context.toString()); } else { stats = null; } if (fIsReportingDelay) { fStart = System.currentTimeMillis(); } return stats; }
/** * Starts timing an occurrence of this event. This is a convenience method, fully equivalent to * <code>startRun(null)</code>. */ public void startRun() { if (ENABLED) startRun(null); }