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

    https://github.com/apache/incubator-flink/pull/43#discussion_r14295464
  
    --- Diff: 
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/ConfigurationServlet.java
 ---
    @@ -65,13 +90,53 @@ protected void doGet(HttpServletRequest req, 
HttpServletResponse resp)
                        try {
                                obj.put(k, globalC.getString(k, ""));
                        } catch (JSONException e) {
    -                           e.printStackTrace();
    +                           LOG.warn("Json object creation failed", e);
                        }
                }
                
                PrintWriter w = resp.getWriter();
                w.write(obj.toString());
    -
    +           
    +   }
    +   
    +   private void writeTaskmanagers(HttpServletResponse resp) throws 
IOException {
    +           
    +           Set<InstanceConnectionInfo> keys = 
jobmanager.getInstances().keySet();
    +           List<InstanceConnectionInfo> list = new 
ArrayList<InstanceConnectionInfo>(keys);
    +           Collections.sort(list);
    +                           
    +           JSONObject obj = new JSONObject();
    +           JSONArray array = new JSONArray();
    +           for (InstanceConnectionInfo k : list) {
    +                   JSONObject objInner = new JSONObject();
    +                   
    +                   Instance instance = jobmanager.getInstances().get(k);   
    +                   long time = new Date().getTime() - 
instance.getLastHeartBeat();
    +   
    +                   try {
    +                           objInner.put("inetAdress", k.getInetAdress());
    +                           objInner.put("ipcPort", k.ipcPort());
    +                           objInner.put("dataPort", k.dataPort());
    +                           objInner.put("timeSinceLastHeartbeat", time);
    --- End diff --
    
    can you divide the time by 1000 to make it seconds instead of miliseconds? 
(Its okay if the interface only says 0 or 1). The "Seconds since last 
heartbeat" column is mainly useful for detecting machines that are not 
reporting in fast enough.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to