3

In jprofiler how does the time in CPU views and Databases(jdbc/JPA) in call tree view coorelate with each other? How can i see if the bottleneck is at database calls or in java code

  1. Is the time shown in call tree section of CPU views cumulative time of the whole request and include the time taken by JPA and JDBC calls or is it only of CPU and does not include IO times. Is the total time of request is what i seen in call tree section of CPU views or is it a sum total of call tree timings for database and CPU views

  2. Question on different lines: I see a significant amount of times taken in java core classes like BigDecimal. Double.value of, Calendar.getInstance. They are a lot of invocations of these methods from my application. Also if I add these classes in my list of ignored classes in filter settings the overall time of my method which calls these classes is reduced. So can I assume that the large time reported in these methods was actually overhead introduced by Jprofiler.

archie
  • 45
  • 4

1 Answers1

2

Is the time shown in call tree section of CPU views cumulative time of the whole request and include the time taken by JPA and JDBC calls

Only if you set the "Thread status" selector at the top of the CPU views to "All times". By default it's set to "Runnable" and does not include the time a socket waits for a database call to complete.

So can I assume that the large time reported in these methods was actually overhead introduced by Jprofiler.

With instrumentation, overhead can get very high in algorithmic code, especially because it reduces the possibility for the hot spot compiler to eliminate method calls. You would either have to adjust your filters to only instrument "high-level" classes or switch to "Sampling" in order to get realistic time measurements.

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102
  • This is a very important information and should be part of the documentation. It is very confusing when the CPU view shows a very short time for your request when it actually lasted very long (and you see a long running query in jdbc view which caused it). – T3rm1 Dec 16 '20 at 13:35
  • 1
    See https://www.ej-technologies.com/resources/jprofiler/help/doc/main/cpu.html under "Thread status" – Ingo Kegel Dec 16 '20 at 21:47