System Thread monitoring

Hello all,

does anyone know how I am able to monitor IS system threads via custom java service? or flow service?
I am trying to figure out how to periodically check for hung system threads and send a notification if there are.

the thread data I am trying to access is located on the IS page included in the attachment.

I have gone through WM database to see if any tables were being used to hold the thread information (start time, name…ect), I also checked the WM Java classes to see if there was a way to access system thread information that way, but no luck.

thanks for your time

-C
Capture.PNG

You can find the corresponding service by checking the DSP file /WmRoot/server-threads-new.dsp.
The service name is “wm.server.query:getThreadList”.

Yes this is a WmRoot service.

But will this service give’s hung only threads or all threads and I believe here the deal to know/track the hung threads (long running one’s with start time ) correct?

HTH,
RMG

Thank you both for the reply. .

I’ll let you know what I find.

best

-C

If you have skills in Java, you can plonk the following in a Java service:

Set threadSet = Thread.getAllStackTraces().keySet();

Then you can iterate through the set and filter out the blocked threads.

Chris

Bekker, with the one Wang suggested, you can able to find the threads but it doesn’t give hung threads. Try the approach Christian suggested, let us know if you face issues.

Thanks,

Hi All,
I used Wang’s approach and used wm.server.query:getThreadList.

I simply created a flow service which invokes wm.server.query:getThreadList. Once I have the list of threads I check all the start times. The start time is only available if the thread is currently in use. Using the start time I can find out how long the thread has been running. If the thread has been running for longer than 10min than it sends a notification.

This does not guarantee that the thread is hung, nonetheless any thread running more than 10min in our system should be looked at since that is well above our threshold.

thanks for the help!

Hi Cory,

Thanks for the update!

So it looks like you are on track with that getThreadList service solution with the allowed startTime threshold and it should be all set as long the current work around satisfies your needs!!!

Yes some times it does not guarantee if a particular thread is in hung state (various factors can cause delays) but atleast it can alert you some thing is long running due :slight_smile:

HTH,
RMG

I need the date time format from the getThreadList service. I see its something like Mon, 15 April 2019 20:30:30. How do I represent it in the datetimeformat?

Hi Corey, is it possible to share your code?

You can setup the Integration Server with a JMX port, then use any JMX utility to monitor remotely. In addition to providing a thread dump, you can also monitor various other parts of the Integration Server.

  • To setup a JMX port you will need to specify the appropriate properties in one of the Integration Server startup scripts.
  • For choice of JMX utility jvisualvm is popular because it is installed in most JDKs.

You can even use JMX in a production environment. I don’t know your use case for looking at threads, but there is a fair bit of information you can gather from using JMX.