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

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_r61779550
  
    --- Diff: 
engine/src/main/java/com/datatorrent/stram/webapp/StramWebServices.java ---
    @@ -492,6 +494,42 @@ public JSONObject 
getContainer(@PathParam("containerId") String containerId) thr
         return new JSONObject(objectMapper.writeValueAsString(ci));
       }
     
    +  @GET
    +  @Path(PATH_PHYSICAL_PLAN_CONTAINERS + "/{containerId}" + "/stackTrace")
    +  @Produces(MediaType.APPLICATION_JSON)
    +  public JSONObject getContainerStackTrace(@PathParam("containerId") 
String containerId) throws Exception
    +  {
    +    init();
    +
    +    if 
(containerId.equals(System.getenv(ApplicationConstants.Environment.CONTAINER_ID.toString())))
 {
    +      return new JSONObject(StackTrace.getJsonFormat());
    +    }
    +
    +    StreamingContainerAgent sca = 
dagManager.getContainerAgent(containerId);
    +
    +    if (sca == null) {
    +      throw new NotFoundException();
    +    }
    +
    +    if (!sca.getContainerInfo().state.equals("ACTIVE")) {
    +      throw new RuntimeException("Container is not active");
    +    }
    +
    +    int timeOut = 1000;
    --- End diff --
    
    We should probably make the constants 1000 and 10 be configurable, or at 
least make it a static final variable so that it's easily modified.


> 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