Package com.dianping.cat.report.page

Examples of com.dianping.cat.report.page.LineChart


      }
    }
  }

  protected void put(Map<String, LineChart> charts, Map<String, LineChart> result, String key) {
    LineChart value = charts.get(key);

    if (value != null) {
      result.put(key, charts.get(key));
    }
  }
View Full Code Here


        double[] data = graphData.get(name);
        for (int i = 0; i < data.length; i++) {
          data[i] = data[i] / (K * K * K);
        }
        String title = name + "[GB]";
        LineChart disk = getGraphItem(title, name, start, size, graphData);
        diskInfo.add(disk);
      }
    }
    return diskInfo;
  }
View Full Code Here

    }
    return diskInfo;
  }

  private LineChart getGraphItem(String title, String key, Date start, int size, Map<String, double[]> graphData) {
    LineChart item = new LineChart();
    item.setStart(start);
    item.setSize(size);
    item.setTitle(title);
    item.addSubTitle(title);
    item.setStep(TimeHelper.ONE_MINUTE);
    double[] activeThread = graphData.get(key);
    item.addValue(activeThread);
    return item;
  }
View Full Code Here

    }
    return sb.toString().substring(0, sb.length() - 1);
  }

  private LineChart buildLineChart(String title, Map<String, Item> items) {
    LineChart result = new LineChart();

    result.setSize(60);
    result.setStep(TimeHelper.ONE_MINUTE);
    result.setTitle(title);
    result.setStart(m_start);
    if (items != null) {
      for (Entry<String, Item> entry : items.entrySet()) {
        String subTitle = entry.getKey();
        Item item = entry.getValue();

        result.addSubTitle(subTitle);
        result.addValue(item.getValue());
      }
    }
    return result;
  }
View Full Code Here

    }
    return min;
  }

  public LineChart buildChartData(final List<Double[]> datas, String type) {
    LineChart lineChart = new LineChart();
    lineChart.setId("app");
    lineChart.setUnit("");
    lineChart.setHtmlTitle(queryType(type));

    if (AppDataService.SUCCESS.equals(type)) {
      lineChart.setMinYlable(queryMinYlable(datas));
      lineChart.setMaxYlabel(100D);
    }

    for (int i = 0; i < datas.size(); i++) {
      Double[] data = datas.get(i);

      if (i == 0) {
        lineChart.add("当前值", data);
      } else if (i == 1) {
        lineChart.add("对比值", data);
      }
    }
    return lineChart;
  }
View Full Code Here

      if (report != null) {
        reports.add(report);
      }
    }
    int day = (int) ((end.getTime() - start.getTime()) / TimeHelper.ONE_HOUR);
    LineChart item = new LineChart();

    item.setStart(start).setSize(day).setTitle(key).setStep(TimeHelper.ONE_HOUR);
    item.addSubTitle(key);
    item.addValue(getDataFromHourlySummary(reports, start.getTime(), day, key, ip));
    return item;
  }
View Full Code Here

    }
    return result;
  }

  private LineChart getHourlyGraph(StateReport report, String domain, Date start, Date end, String key, String ip) {
    LineChart item = new LineChart();

    item.setStart(start).setSize(60).setTitle(key).setStep(TimeHelper.ONE_MINUTE);
    item.addSubTitle(key);
    item.addValue(getDataFromHourlyDetail(report, start.getTime(), 60, key, ip));
    return item;
  }
View Full Code Here

    case METRIC:
      model.setLineCharts(new ArrayList<LineChart>(allCharts.values()));
      break;
    case JSON:
      String id = payload.getId();
      LineChart lineChart = allCharts.get(id);

      if (lineChart != null) {
        model.setJson(lineChart.getJsonString());
      }
      break;
    }
    List<String> tags = m_metricConfigManager.queryTags();
View Full Code Here

    int step = m_dataExtractor.getStep();

    for (Entry<String, double[]> entry : dataWithOutFutures.entrySet()) {
      String key = entry.getKey();
      double[] value = entry.getValue();
      LineChart lineChart = new LineChart();

      buildLineChartTitle(alertKeys, lineChart, key);
      lineChart.setStart(startDate);
      lineChart.setSize(value.length);
      lineChart.setStep(step * TimeHelper.ONE_MINUTE);
      double[] baselines = queryBaseline(key, startDate, endDate);
      Map<Long, Double> all = convertToMap(datas.get(key), startDate, 1);
      Map<Long, Double> current = convertToMap(dataWithOutFutures.get(key), startDate, step);

      addLastMinuteData(current, all, m_lastMinute, endDate);
      lineChart.add(Chinese.CURRENT_VALUE, current);
      lineChart.add(Chinese.BASELINE_VALUE, convertToMap(m_dataExtractor.extract(baselines), startDate, step));
      charts.put(key, lineChart);
    }
    return charts;
  }
View Full Code Here

    Action action = payload.getAction();

    normalize(model, payload);
    String key = payload.getKey();
    StateReport report = null;
    LineChart item = null;
    switch (action) {
    case HOURLY:
      report = getHourlyReport(payload);
      model.setMessage(buildCatInfoMessage(report));
      break;
View Full Code Here

TOP

Related Classes of com.dianping.cat.report.page.LineChart

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.