Package com.dianping.cat.report.page.problem

Examples of com.dianping.cat.report.page.problem.ProblemStatistics


  public Map<Object, Object> getRenderResult() {
    return m_result;
  }

  public void visitProblemReport(ProblemReport report) {
    ProblemStatistics problemStatistics = new ProblemStatistics();
    problemStatistics.setAllIp(true);

    problemStatistics.visitProblemReport(report);

    Collection<TypeStatistics> status = problemStatistics.getStatus().values();
    for (TypeStatistics statistic : status) {
      String type = statistic.getType();
      int count = statistic.getCount();
      String graphUrl = buildGraphUrl(type);
      Type temp = new Type();
View Full Code Here


    }
  }

  private void buildProblemReportResult(ProblemReport problemReport, String ip, String type, String name,
        Map<String, String> data) {
    ProblemStatistics problemStatistics = new ProblemStatistics();

    if (ip.equalsIgnoreCase(Payload.ALL)) {
      problemStatistics.setAllIp(true);
    } else {
      problemStatistics.setIp(ip);
    }
    problemStatistics.visitProblemReport(problemReport);

    if (StringUtils.isEmpty(name) && StringUtils.isEmpty(type)) {
      Map<String, TypeStatistics> status = problemStatistics.getStatus();

      for (Entry<String, TypeStatistics> temp : status.entrySet()) {
        String key = temp.getKey();
        TypeStatistics value = temp.getValue();
        data.put(key + COUNT, String.valueOf(value.getCount()));
      }
    } else if (StringUtils.isEmpty(name) && !StringUtils.isEmpty(type)) {
      Map<String, TypeStatistics> status = problemStatistics.getStatus();
      TypeStatistics value = status.get(type);

      if (value != null) {
        data.put(COUNT, String.valueOf(value.getCount()));
        for (Entry<String, StatusStatistics> temp : value.getStatus().entrySet()) {
          data.put(temp.getKey() + COUNT, String.valueOf(temp.getValue().getCount()));
        }
      }
    } else if (!StringUtils.isEmpty(name) && !StringUtils.isEmpty(type)) {
      Map<String, TypeStatistics> status = problemStatistics.getStatus();
      TypeStatistics value = status.get(type);

      if (value != null) {
        StatusStatistics nameValue = value.getStatus().get(name);
        if (nameValue != null) {
View Full Code Here

    }
    resultMap.put("distributeMap", distributes);
  }

  private void addFailureInfo(Map<Object, Object> resultMap, ProblemReport report) {
    ProblemStatistics problemStatistics = new ProblemStatistics();
    problemStatistics.setAllIp(true);
    problemStatistics.visitProblemReport(report);
    TypeStatistics failureStatus = problemStatistics.getStatus().get("error");

    if (failureStatus != null) {
      Map<Object, Object> statusMap = new HashMap<Object, Object>();

      for (StatusStatistics status : failureStatus.getStatus().values()) {
View Full Code Here

TOP

Related Classes of com.dianping.cat.report.page.problem.ProblemStatistics

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.