Пример #1
0
  public WorkerSumm(WorkerSummary workerSummary) {
    this.port = String.valueOf(workerSummary.get_port());
    this.topology = workerSummary.get_topology();

    StringBuilder taskSB = new StringBuilder();
    StringBuilder componentSB = new StringBuilder();
    boolean isFirst = true;

    int minUptime = 0;
    taskSummList = workerSummary.get_tasks();
    for (TaskSummary taskSummary : taskSummList) {
      if (isFirst == false) {
        taskSB.append(',');
        componentSB.append(',');
      } else {
        minUptime = taskSummary.get_uptime_secs();
      }

      taskSB.append(taskSummary.get_task_id());
      componentSB.append(taskSummary.get_component_id());

      if (minUptime < taskSummary.get_uptime_secs()) {
        minUptime = taskSummary.get_uptime_secs();
      }

      isFirst = false;
    }

    this.uptime = StatBuckets.prettyUptimeStr(minUptime);
    this.tasks = taskSB.toString();
    this.components = componentSB.toString();
  }
Пример #2
0
  private void init() {
    FacesContext ctx = FacesContext.getCurrentInstance();
    if (ctx.getExternalContext().getRequestParameterMap().get("topologyid") != null) {
      topologyid = (String) ctx.getExternalContext().getRequestParameterMap().get("topologyid");
    }
    if (ctx.getExternalContext().getRequestParameterMap().get("window") != null) {
      window = (String) ctx.getExternalContext().getRequestParameterMap().get("window");
    }
    if (ctx.getExternalContext().getRequestParameterMap().get("componentid") != null) {
      componentid = (String) ctx.getExternalContext().getRequestParameterMap().get("componentid");
    }
    if (ctx.getExternalContext().getRequestParameterMap().get("taskid") != null) {
      taskid = (String) ctx.getExternalContext().getRequestParameterMap().get("taskid");
    }

    window = StatBuckets.getShowTimeStr(window);
  }