Extract CPU time programmatically

Questions about YourKit Java Profiler
Locked
Cosmin T.
Posts: 2
Joined: Thu Nov 02, 2023 8:24 am

Extract CPU time programmatically

Post by Cosmin T. »

Hello,

In the Thread view I can see the CPU time of a thread and also I can see CPU usage on a sample if I hover over. Question is can I extract this information per thread programmatically from a snapshot or can I see the statistics somewhere in Yourkit? My goal would be to create a statistic with how much our threads are waiting/blocked and how much time they actually compute something depending on different configurations. I tried -export option but cannot find the needed data.

Thank you,
Cosmin
Vladimir Kondratyev
Posts: 1659
Joined: Tue Aug 10, 2004 7:52 pm

Re: Extract CPU time programmatically

Post by Vladimir Kondratyev »

Currently, the profiler does not have this functionality, but we can try to add it in the next version. Therefore, we want to gather more requirements and understand what functionality you need. Do you want to get statistics for each thread? For example, how long a thread was idle, blocked, how much CPU time it consumed. Or do you need the entire measurement history, and you want to know how much CPU time was consumed at each sample?

Best regards,
Vladimir Kondratyev
YourKit GmbH
http://www.yourkit.com
"Don't get lost in data, get information!"
Cosmin T.
Posts: 2
Joined: Thu Nov 02, 2023 8:24 am

Re: Extract CPU time programmatically

Post by Cosmin T. »

I would like to see statistics for each thread for my use case(eg. how much time it was blocked /waiting). Filter by thread name similar to the functionality in the Thread view would also be a nice feature. If possible would be nice to be able to programmatically get this data from the snapshot with the -export flag.
Vladimir Kondratyev
Posts: 1659
Joined: Tue Aug 10, 2004 7:52 pm

Re: Extract CPU time programmatically

Post by Vladimir Kondratyev »

Thank you for the explanation. I've submitted a feature request, and we'll aim to implement it within the current release cycle. However, I cannot guarantee this will be accomplished.

Best regards,
Vladimir Kondratyev
YourKit GmbH
http://www.yourkit.com
"Don't get lost in data, get information!"
Locked