Ejemplo n.º 1
0
 /**
  * create a summary of the application's runtime.
  *
  * @param app {@link RMApp} whose summary is to be created, cannot be <code>null</code>.
  */
 public static SummaryBuilder createAppSummary(RMApp app) {
   String trackingUrl = "N/A";
   String host = "N/A";
   RMAppAttempt attempt = app.getCurrentAppAttempt();
   if (attempt != null) {
     trackingUrl = attempt.getTrackingUrl();
     host = attempt.getHost();
   }
   RMAppMetrics metrics = app.getRMAppMetrics();
   SummaryBuilder summary =
       new SummaryBuilder()
           .add("appId", app.getApplicationId())
           .add("name", app.getName())
           .add("user", app.getUser())
           .add("queue", app.getQueue())
           .add("state", app.getState())
           .add("trackingUrl", trackingUrl)
           .add("appMasterHost", host)
           .add("startTime", app.getStartTime())
           .add("finishTime", app.getFinishTime())
           .add("finalStatus", app.getFinalApplicationStatus())
           .add("memorySeconds", metrics.getMemorySeconds())
           .add("vcoreSeconds", metrics.getVcoreSeconds())
           .add("preemptedAMContainers", metrics.getNumAMContainersPreempted())
           .add("preemptedNonAMContainers", metrics.getNumNonAMContainersPreempted())
           .add("preemptedResources", metrics.getResourcePreempted())
           .add("applicationType", app.getApplicationType());
   return summary;
 }
Ejemplo n.º 2
0
 /**
  * create a summary of the application's runtime.
  *
  * @param app {@link RMApp} whose summary is to be created, cannot be <code>null</code>.
  */
 public static SummaryBuilder createAppSummary(RMApp app) {
   String trackingUrl = "N/A";
   String host = "N/A";
   RMAppAttempt attempt = app.getCurrentAppAttempt();
   if (attempt != null) {
     trackingUrl = attempt.getTrackingUrl();
     host = attempt.getHost();
   }
   SummaryBuilder summary =
       new SummaryBuilder()
           .add("appId", app.getApplicationId())
           .add("name", app.getName())
           .add("user", app.getUser())
           .add("queue", app.getQueue())
           .add("state", app.getState())
           .add("trackingUrl", trackingUrl)
           .add("appMasterHost", host)
           .add("startTime", app.getStartTime())
           .add("finishTime", app.getFinishTime())
           .add("finalStatus", app.getFinalApplicationStatus());
   return summary;
 }