[ 
https://issues.apache.org/jira/browse/APEXCORE-330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15267766#comment-15267766
 ] 

ASF GitHub Bot commented on APEXCORE-330:
-----------------------------------------

Github user davidyan74 commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/321#discussion_r61824191
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/StramUtils.java ---
    @@ -81,4 +89,48 @@
         }
       }
     
    +  public static JSONObject getJsonFormat()
    +  {
    +    Map<Thread, StackTraceElement[]> stackTraces = 
Thread.getAllStackTraces();
    +
    +    JSONObject jsonObject = new JSONObject();
    +    JSONArray jsonArray = new JSONArray();
    +
    +    for (Map.Entry<Thread,StackTraceElement[]> elements : 
stackTraces.entrySet()) {
    +
    +      JSONObject jsonThreads = new JSONObject();
    +
    +      Thread thread = elements.getKey();
    +
    +      try {
    +
    +        jsonThreads.put("name", thread.getName());
    +        jsonThreads.put("state", thread.getState());
    +        jsonThreads.put("id", thread.getId());
    +
    +        JSONArray stacks = new JSONArray();
    --- End diff --
    
    stacks -> stackTraceElements


> Ability to obtain a thread dump from a container
> ------------------------------------------------
>
>                 Key: APEXCORE-330
>                 URL: https://issues.apache.org/jira/browse/APEXCORE-330
>             Project: Apache Apex Core
>          Issue Type: Improvement
>            Reporter: Thomas Weise
>            Assignee: Sandesh
>
> To analyze issues such as "stuck operator", it is useful to obtain stats from 
> the running JVM. Often needed are GC stats and thread dump. In production 
> environments users often don't have direct access to the machines, making it 
> available through the REST API will help.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to