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

    https://github.com/apache/incubator-flink/pull/43#discussion_r14295367
  
    --- 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);
    +                           objInner.put("slotsNumber", 
instance.getNumberOfSlots());
    +                           objInner.put("freeSlots", 
instance.getNumberOfAvailableSlots());
    +                           objInner.put("cpuCores", 
instance.getHardwareDescription().getNumberOfCPUCores());
    +                           objInner.put("physicalMemory", 
instance.getHardwareDescription().getSizeOfPhysicalMemory() / 1000);
    --- End diff --
    
    you have to divide by 1048576 here. Dividing by 1024 will turn bytes to 
kilobytes. The interface shows megabytes.


---
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