Hi andfer
I'm on shaky ground on this but from what I know, the average response time is the java agent/auto probe listening for the request, method call, and the response or return of the method call.
The Stall metric is based on the active thread id and monitors threads within the thread pool of the JVM. Autoprobe/java agent will capture the thread ids within the thread pool and compare the active thread ids to the previously captured thread ids.
This would be like a J2EE data source or EJB pool.
I'm going to try to provide an example of what I think I know...again shaky ground ahead.
1. Request is sent from client to server
2. Server uses a process thread, web container thread from the web container pool. Thread 1234
3. Autoprobe - stall captures that thread 1234 is within the current metric measurement cycle
4. Autoprobe - average response time clocks request on 1234
5. Web container thread processes the request which includes a call to your process thread pool
6. Process thread pool currently has no threads within the thread pool so creates thread 5678
7. The process thread pool assigns thread 5678 to the thread 1234 transactional context
8. Autoprobe - average response time clocks request on 5678
9. Autoprobe - stall captures that thread 5678 is within the current metric measurement cycle
10. Thread 5678 processes the request and returns the data response
11. Autoprobe - clocks response on 5678, determines average response time on thread 5678
12. Process thread pool returns response to thread 1234
13. At this point, the thread 5678 is returned to the process thread pool and still listed within the threads of the JVM. Since your custom thread pool isn't one of the standard JVM thread pools, auto-probe would not recognize that the thread is a thread in a pool and monitors it like any other JVM thread.
14. Web Container thread 1234, returns response to original client thread
15. Autoprobe - clocks response to 1234 determines average response time on thread 1234
16. Autoprobe enters next measurement cycle
15. There are no client threads but the thread enlisted at step 11 is still active. Stall captures that thread 5678 is still active
16. Now, if that thread ages out of the pool or gets used by another then the stall capture, I'm guessing, would then understand that the thread is processing a different request thus resetting the stall marker. If not each cycle that the pool exists, it becomes another stall tick
17. If the thread is still marked for presence within the JVM thread pool for one more cycle then it is reported as a stall.
Hoping Hiko_Davis will correct me so I can understand how the ART and stall stuff works.
Billy