explain thread telemetry presentation

Questions about YourKit Java Profiler
Post Reply
jjfraney
Posts: 1
Joined: Wed May 13, 2009 7:51 pm

explain thread telemetry presentation

Post by jjfraney »

Please give me an explanation for what I am looking at in the thread telemetry window.

Across the top panel is a three column graph. On far left, is a thread name, in center is multi-colored blocks marching from right to left with time units on bottom, on far right is a column entitled 'time' with two numbers for each thread, one is percentage.

I see the colored blocks are distinguishable as fitting into the one-second interval of the graph scale. I guess that means each block represents a sample.

I see that there are two different widths of color. One is about a second wide, the other is much thinner. For example, one thread is mostly yellow (waiting), but has a few thick green blocks (runnable), but also has some very thin verical lines separating two yellow blocks. If a wide block represents a single sample, what does a thin vertical line represent?

I see red blocks (blocked status). These appear in all yellow bands (mostly waiting thread) and all green bands (mostly runnable thread). The red block in the all yellow bands is larger than the red block in the all green bands. Like in the green band, there are thin vertical lines on either side of the red block.

What is the time number? The actual runtime of a thread? If so, how do I explain that a band that is all green (thread always runnable) has LESS time charged than a band that is half green, half yellow (runnable/waiting)?

To what is the percentage relative?

Thanks,
John
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: explain thread telemetry presentation

Post by Vladimir Kondratyev »

Profiler periodically samples states of all running threads and display them on the graph. As you correctly mentioned, the sample is performed about one time in a second. Profiler calculates the CPU time which was consumed by the particular thread since the previous sample. If the thread consumed non-zero CPU time profiler does the following to visualize thread state:

1) "Running" thread state (i.e thread is on CPU) corresponds to the green block. Darker green color corresponds to higher CPU consumption. And lighter color corresponds to lower CPU time.

2) "Blocked" state is visualized as two blocks: red block + small block of green color. It means that thread was in running state (because it consumed some CPU), but the current state is blocked.

3) "Waiting" and "Sleeping" are the same as "Blocked". See my comments above.
What is the time number? The actual runtime of a thread?
Consumed CPU time
If so, how do I explain that a band that is all green (thread always runnable) has LESS time charged than a band that is half green, half yellow (runnable/waiting)?
Everything is quite simple.

1) The threads have different priority, it means that one thread can consume CPU time more intensively than another

2) It might happen, that thread sampler measures only "Running" state for particular thread. For example, thread does something 2/3 of second and does nothing (sleeping) 1/3 of second. It means that sampler _most_ probably measure "Runnable" state for this thread. All the graph will be green.
To what is the percentage relative?
Percents are relative to total process CPU time.
bunburyist
Posts: 1
Joined: Fri Nov 06, 2015 4:15 pm

Re: explain thread telemetry presentation

Post by bunburyist »

Can you explain why my thread state display shows gaps of white between the areas that are all green? My program is running 500 threads. All the threads show RUNNING all the time, with gaps of white between the green blocks. Moreover, the white gaps are aligned for all the threads. That is, for a particular place in the graph that's white, it shows white for all the threads ... looks like a white column amidst the green.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: explain thread telemetry presentation

Post by Anton Katilin »

It is likely that actual telemetry sampling period is bigger than the desired 1 second because wit such big number of threads it takes much for the JVM to obtain a snapshot of all stack traces and states. The gaps visually indicate the time points in which the samples were taken.
Post Reply