Package com.google.dart.engine.utilities.instrumentation

Examples of com.google.dart.engine.utilities.instrumentation.InstrumentationBuilder


    return basis.getTypeProvider();
  }

  @Override
  public boolean isClientLibrary(Source librarySource) {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-isClientLibrary");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      return basis.isClientLibrary(librarySource);
    } finally {
      instrumentation.log();
    }
  }
View Full Code Here


    }
  }

  @Override
  public boolean isDisposed() {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-isDisposed");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      return basis.isDisposed();
    } finally {
      instrumentation.log();
    }
  }
View Full Code Here

    }
  }

  @Override
  public boolean isServerLibrary(Source librarySource) {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-isServerLibrary");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      return basis.isServerLibrary(librarySource);
    } finally {
      instrumentation.log();
    }
  }
View Full Code Here

    }
  }

  @Override
  public void mergeContext(AnalysisContext context) {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-mergeContext");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      if (context instanceof InstrumentedAnalysisContextImpl) {
        context = ((InstrumentedAnalysisContextImpl) context).basis;
      }
      basis.mergeContext(context);
    } finally {
      instrumentation.log();
    }
  }
View Full Code Here

    }
  }

  @Override
  public CompilationUnit parseCompilationUnit(Source source) throws AnalysisException {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-parseCompilationUnit");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      return basis.parseCompilationUnit(source);
    } catch (AnalysisException e) {
      recordAnalysisException(instrumentation, e);
      throw e;
    } finally {
      instrumentation.log();
    }
  }
View Full Code Here

    }
  }

  @Override
  public HtmlUnit parseHtmlUnit(Source source) throws AnalysisException {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-parseHtmlUnit");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      return basis.parseHtmlUnit(source);
    } catch (AnalysisException e) {
      recordAnalysisException(instrumentation, e);
      throw e;
    } finally {
      instrumentation.log();
    }
  }
View Full Code Here

    }
  }

  @Override
  public AnalysisResult performAnalysisTask() {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-performAnalysisTask");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      AnalysisResult result = basis.performAnalysisTask();
      if (result.getChangeNotices() != null) {
        instrumentation.metric("ChangeNotice-count", result.getChangeNotices().length);
      }
      return result;
    } finally {
      instrumentation.log(15); //Log if >= 15ms
    }
  }
View Full Code Here

  }

  @Override
  public CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement library)
      throws AnalysisException {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-resolveCompilationUnit");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      return basis.resolveCompilationUnit(unitSource, library);
    } catch (AnalysisException e) {
      recordAnalysisException(instrumentation, e);
      throw e;
    } finally {
      instrumentation.log();
    }
  }
View Full Code Here

  }

  @Override
  public CompilationUnit resolveCompilationUnit(Source unitSource, Source librarySource)
      throws AnalysisException {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-resolveCompilationUnit");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      return basis.resolveCompilationUnit(unitSource, librarySource);
    } catch (AnalysisException e) {
      recordAnalysisException(instrumentation, e);
      throw e;
    } finally {
      instrumentation.log();
    }
  }
View Full Code Here

    }
  }

  @Override
  public HtmlUnit resolveHtmlUnit(Source htmlSource) throws AnalysisException {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-resolveHtmlUnit");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      return basis.resolveHtmlUnit(htmlSource);
    } catch (AnalysisException e) {
      recordAnalysisException(instrumentation, e);
      throw e;
    } finally {
      instrumentation.log();
    }
  }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.utilities.instrumentation.InstrumentationBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.