Codota Logo
Profiler.startTrace
Code IndexAdd Codota to your IDE (free)

How to use
startTrace
method
in
org.sonar.core.util.logs.Profiler

Best Java code snippets using org.sonar.core.util.logs.Profiler.startTrace (Showing top 9 results out of 315)

  • Common ways to obtain Profiler
private void myMethod () {
Profiler p =
  • Codota IconLogger logger;Profiler.create(logger)
  • Codota IconLogger logger;Profiler.createIfTrace(logger)
  • Smart code suggestions by Codota
}
origin: SonarSource/sonarqube

private void doUpgradeDb() {
 Profiler profiler = Profiler.createIfTrace(LOGGER);
 profiler.startTrace("Starting DB Migration");
 migrationEngine.execute();
 profiler.stopTrace("DB Migration ended");
}
origin: SonarSource/sonarqube

private void doRestartContainer() {
 Profiler profiler = Profiler.createIfTrace(LOGGER);
 profiler.startTrace("Restarting container");
 platform.doStart();
 profiler.stopTrace("Container restarted successfully");
}
origin: SonarSource/sonarqube

@Test
public void startTrace_writes_log_with_context_appended_when_there_is_a_message() {
 tester.setLevel(LoggerLevel.TRACE);
 addSomeContext(underTest);
 underTest.startTrace("Foo");
 assertThat(tester.logs(LoggerLevel.TRACE)).containsOnly("Foo | a_string=bar | an_int=42 | after_start=true");
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("logTimeLastValues")
public void different_start_and_stop_messages(boolean logTimeLast) {
 underTest.logTimeLast(logTimeLast);
 tester.setLevel(LoggerLevel.TRACE);
 // start TRACE and stop DEBUG
 underTest.startTrace("Register rules");
 underTest.stopDebug("Rules registered");
 assertThat(tester.logs()).hasSize(2);
 assertThat(tester.logs().get(0)).contains("Register rules");
 assertThat(tester.logs().get(1)).startsWith("Rules registered | time=");
 tester.clear();
 // start DEBUG and stop INFO
 underTest.startDebug("Register rules {}", 10);
 underTest.stopInfo("Rules registered");
 assertThat(tester.logs()).hasSize(2);
 assertThat(tester.logs().get(0)).contains("Register rules 10");
 assertThat(tester.logs().get(1)).startsWith("Rules registered | time=");
 tester.clear();
 // start INFO and stop TRACE
 underTest.startInfo("Register rules");
 underTest.stopTrace("Rules registered");
 assertThat(tester.logs()).hasSize(2);
 assertThat(tester.logs().get(0)).contains("Register rules");
 assertThat(tester.logs().get(1)).startsWith("Rules registered | time=");
}
origin: SonarSource/sonarqube

private void visitNode(Component component, VisitorWrapper visitor) {
 Profiler profiler = Profiler.create(Loggers.get(visitor.getWrappedVisitor().getClass()))
  .startTrace("Visiting component {}", component.getDbKey());
 visitor.visitAny(component);
 switch (component.getType()) {
  case PROJECT:
   visitor.visitProject(component);
   break;
  case DIRECTORY:
   visitor.visitDirectory(component);
   break;
  case FILE:
   visitor.visitFile(component);
   break;
  case VIEW:
   visitor.visitView(component);
   break;
  case SUBVIEW:
   visitor.visitSubView(component);
   break;
  case PROJECT_VIEW:
   visitor.visitProjectView(component);
   break;
  default:
   throw new IllegalStateException(String.format("Unknown type %s", component.getType().name()));
 }
 long duration = profiler.stopTrace();
 incrementDuration(visitor, duration);
}
origin: SonarSource/sonarqube

underTest.startTrace("Register rules {}", 1);
Thread.sleep(2);
assertThat(tester.logs()).containsOnly("Register rules 1");
origin: org.sonarsource.sonarqube/sonar-server

private void doRestartContainer() {
 Profiler profiler = Profiler.createIfTrace(LOGGER);
 profiler.startTrace("Restarting container");
 platform.doStart();
 profiler.stopTrace("Container restarted successfully");
}
origin: org.sonarsource.sonarqube/sonar-server

private void doUpgradeDb() {
 Profiler profiler = Profiler.createIfTrace(LOGGER);
 profiler.startTrace("Starting DB Migration");
 migrationEngine.execute();
 profiler.stopTrace("DB Migration ended");
}
origin: org.sonarsource.sonarqube/sonar-server

private void visitNode(Component component, VisitorWrapper visitor) {
 Profiler profiler = Profiler.create(Loggers.get(visitor.getWrappedVisitor().getClass()))
  .startTrace("Visiting component {}", component.getKey());
 visitor.visitAny(component);
 switch (component.getType()) {
org.sonar.core.util.logsProfilerstartTrace

Popular methods of Profiler

  • create
  • stopInfo
  • startInfo
  • stopError
  • addContext
    Context information is removed if value is null.
  • createIfTrace
  • logTimeLast
    Defines whether time is added to stop messages before or after context (if any). flag is false by d
  • start
  • stopTrace
  • hasContext
  • stopDebug
  • createIfDebug
  • stopDebug,
  • createIfDebug,
  • isDebugEnabled,
  • isTraceEnabled,
  • startDebug

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now