Tabnine Logo
Profiler.stopDebug
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: SonarSource/sonarqube

@Test
public void fail_if_stop_without_start() {
 try {
  underTest.stopDebug("foo");
  fail();
 } catch (IllegalStateException e) {
  assertThat(e).hasMessage("Profiler must be started before being stopped");
 }
}
origin: SonarSource/sonarqube

@Test
public void stopDebug_clears_context() {
 tester.setLevel(LoggerLevel.DEBUG);
 addSomeContext(underTest);
 underTest.logTimeLast(true);
 underTest.start().stopDebug("Foo");
 underTest.start().stopDebug("Bar");
 assertThat(tester.logs()).hasSize(2);
 List<String> logs = tester.logs(LoggerLevel.DEBUG);
 assertThat(logs.get(0))
   .startsWith("Foo | a_string=bar | an_int=42 | after_start=true | time=")
   .endsWith("ms");
 assertThat(logs.get(1))
   .startsWith("Bar | time=")
   .endsWith("ms");
}
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

@Test
@UseDataProvider("logTimeLastValues")
public void log_on_at_stop(boolean logTimeLast) {
 underTest.logTimeLast(logTimeLast);
 tester.setLevel(LoggerLevel.TRACE);
 // trace
 underTest.start();
 underTest.stopTrace("Rules registered");
 assertThat(tester.logs()).hasSize(1);
 assertThat(tester.logs().get(0)).startsWith("Rules registered | time=");
 tester.clear();
 // debug
 underTest.start();
 underTest.stopDebug("Rules registered {} on {}", 6, 10);
 assertThat(tester.logs()).hasSize(1);
 assertThat(tester.logs().get(0)).startsWith("Rules registered 6 on 10 | time=");
 tester.clear();
 // info
 underTest.start();
 underTest.stopInfo("Rules registered");
 assertThat(tester.logs()).hasSize(1);
 assertThat(tester.logs().get(0)).startsWith("Rules registered | time=");
}
origin: org.sonarsource.sonarqube/sonar-server

private void executeSteps(Profiler stepProfiler) {
 for (ComputationStep step : steps.instances()) {
  stepProfiler.start();
  step.execute();
  stepProfiler.stopDebug(step.getDescription());
 }
}
org.sonar.core.util.logsProfilerstopDebug

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
  • startTrace
  • stopTrace
  • hasContext
  • createIfDebug
  • hasContext,
  • createIfDebug,
  • isDebugEnabled,
  • isTraceEnabled,
  • startDebug

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • Menu (java.awt)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now