Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

CPU profiling not recording Thread.Sleep time?

Moderators: Vladimir Kondratyev, Anton Katilin

CPU profiling not recording Thread.Sleep time?

Postby Tobbe » Fri Feb 22, 2008 8:29 am

Is CPU profiling not recording Thread.Sleep time? Running 304 version and cant find my thread.sleep timeout.
Tobbe
 
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Postby Anton Katilin (YourKit) » Fri Feb 22, 2008 8:56 am

Record time is a thread CPU time.
Anton Katilin (YourKit)
 
Posts: 157
Joined: Wed Aug 15, 2007 9:09 pm

Postby Tobbe » Fri Feb 22, 2008 9:08 am

I dont understand your answer.

Are you say that when a Thread.Sleep is invoked from my code, lets say someone puts a 10000ms. Im not able to see it in the profiler?
Tobbe
 
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Postby Tobbe » Fri Feb 22, 2008 9:24 am

To clarify

Im not able to see it in the profiler?


- Have a Form with a button.
- Button_Click results in a Thread.Sleep(10000)
- No Filters in yourkit!
- Cpu/Call Tree/Time(ms) = 906ms (100%)

Shouldnt it say 10906ms (100%)? And i would see that the 10000ms is spent in Button_Click?

I dont even show up in Hot spots!?
Tobbe
 
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Postby Tobbe » Fri Feb 22, 2008 9:26 am

I dont even show up in Hot spots!?

:oops: Correction: It dont even show up in Hot spots!? :oops:
Tobbe
 
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Postby Vladimir Kondratyev » Fri Feb 22, 2008 10:08 am

Anton said, that only really consumed CPU time is measured. If the thread is sleeping, it doesn't consume any CPU resource and measured time will be 0. CPU time is not the same as wall time you are measured by stopwatch. That's why you do not see Thread.Sleep()

Best regards,
Vladimir Kondratyev
YourKit, LLC
http://www.yourkit.com
"Don't get lost in data, get information!"
Vladimir Kondratyev
 
Posts: 1444
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Postby Tobbe » Fri Feb 22, 2008 10:16 am

Ok, is there any way to profile by "wall time" in yourkit? I thought that the ms presented was the actuall time a metod call cost?
Tobbe
 
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Postby Anton Katilin » Fri Feb 22, 2008 12:39 pm

Currently consumed CPU time is measured. We'll add an option for a wall time too.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Postby Tobbe » Fri Feb 22, 2008 1:22 pm

:D Looking forward to it!
Tobbe
 
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Postby dabrammertz » Tue Feb 26, 2008 8:08 pm

I'm looking forward to that feature too. I just had a problem with a big performance leak caused by a slow database query. YourKit-Profiler couldn't give me any hint on this issue, since waiting for the database was no cpu time.
dabrammertz
 
Posts: 2
Joined: Tue Feb 26, 2008 8:01 pm
Location: Cologne

Postby Anton Katilin » Tue Feb 26, 2008 8:39 pm

I'm looking forward to that feature too. I just had a problem with a big performance leak caused by a slow database query. YourKit-Profiler couldn't give me any hint on this issue, since waiting for the database was no cpu time.


What is the exact class and method which you expect to measure that way?
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Postby dabrammertz » Tue Feb 26, 2008 8:57 pm

It ended up in System.Data.Odbc.OdbcCommand.ExecuteReader() for which the CPU-Time was just some milliseconds. This lead me to the misconclusion that the problem could not be related to a slow database query, and i fixed all sorts of other bottlenecks, but which in total did not bring any big difference, since the real problem was much bigger. Finally two Log-Messages around the ExecuteReader() showed me that this statement took two seconds, since the database query was too complicated.
So a feature like "wall time" would be really helpfull for this kind of problems.
dabrammertz
 
Posts: 2
Joined: Tue Feb 26, 2008 8:01 pm
Location: Cologne

Postby Tobbe » Wed Apr 02, 2008 10:26 am

Hi again

Any progress regarding recording with wall time?
Tobbe
 
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Postby Anton Katilin » Wed Apr 02, 2008 3:55 pm

Hello,

We have added corresponding feature request of high priority.
Anton Katilin
 
Posts: 5574
Joined: Wed Aug 11, 2004 8:37 am

Re: CPU profiling not recording Thread.Sleep time?

Postby ppietrus » Fri Sep 19, 2008 8:40 pm

Hey,
Is there any ETA on that feature? It would be important for us as well.
Thanks,
Pawel
ppietrus
 
Posts: 1
Joined: Fri Sep 19, 2008 8:21 pm

Next

Return to .NET Profiler

Who is online

Users browsing this forum: No registered users and 2 guests