aeppert / yappi

Automatically exported from code.google.com/p/yappi
MIT License
0 stars 0 forks source link

unexpected thread total times #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
     time0 = time.time()
     yappi.start()
     <my function>
     stats = yappi.get_stats()
     for stat in stats: print stat
     print "TOTAL TIME:",time.time() - time0

What is the expected output? What do you see instead?
     I expected the TOTAL TIME to be the sum of the total times in each thread.  Instead, I see thread total times exceeding the TOTAL TIME. (i.e. main thread: total time of 147 while global total time is 44 s)

What version of the product are you using? On what operating system?
     yappi 0.54, python2.6.6, linux debian

Original issue reported on code.google.com by sarah.va...@gmail.com on 14 Feb 2012 at 10:09

GoogleCodeExporter commented 9 years ago
Yes this is a known problem. This is related with issue 31. thread total times 
are miscalculated when IO blocking functions are used. In current design there 
is no way to calculate this correctly as we have a no way of getting per-thread 
cpu time. However, I have a linux specific branch in the repository(under the 
name: native-perthread) which can calculate total thread times correctly with 
the help of OS and you can compile and use it for your purposes.

Original comment by sum...@gmail.com on 20 Feb 2012 at 2:13

GoogleCodeExporter commented 9 years ago
Will be fixed in issue 33

Original comment by sum...@gmail.com on 20 Feb 2012 at 3:11

GoogleCodeExporter commented 9 years ago
fixed in v0.62.

Original comment by sum...@gmail.com on 6 Mar 2012 at 6:26