Package com.dianping.cat.report.page

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


    vistor.visitTransactionReport(transactionReport);
    return vistor.getCacheReport();
  }

  private String buildPieChart(CacheReport report) {
    PieChart chart = new PieChart();
    List<Item> items = new ArrayList<Item>();
    List<CacheNameItem> nameItems = report.getNameItems();

    for (CacheNameItem cacheItem : nameItems) {
      String name = cacheItem.getName().getId();

      if (name.endsWith(":get") || name.endsWith(":mGet")) {
        items.add(new Item().setTitle(name).setNumber(cacheItem.getName().getTotalCount()));
      }
    }
    chart.addItems(items);
    return chart.getJsonString();
  }
View Full Code Here


    return buildChartData(datas, type);
  }

  public Pair<PieChart, List<PieChartDetailInfo>> buildPieChart(QueryEntity entity, AppDataGroupByField field) {
    List<PieChartDetailInfo> infos = new LinkedList<PieChartDetailInfo>();
    PieChart pieChart = new PieChart().setMaxSize(Integer.MAX_VALUE);
    List<Item> items = new ArrayList<Item>();
    List<AppDataCommand> datas = m_appDataService.queryAppDataCommandsByField(entity, field);

    for (AppDataCommand data : datas) {
      Pair<Integer, Item> pair = buildPieChartItem(entity.getCommand(), data, field);
      Item item = pair.getValue();
      PieChartDetailInfo info = new PieChartDetailInfo();

      info.setId(pair.getKey()).setTitle(item.getTitle()).setRequestSum(item.getNumber());
      infos.add(info);
      items.add(item);
    }
    pieChart.setTitle(field.getName() + "访问情况");
    pieChart.addItems(items);
    updatePieChartDetailInfo(infos);

    return new Pair<PieChart, List<PieChartDetailInfo>>(pieChart, infos);
  }
View Full Code Here

      model.setGraph4(graph4);
    }
  }

  private void buildTransactionNamePieChart(List<TransactionNameModel> names, Model model) {
    PieChart chart = new PieChart();
    List<Item> items = new ArrayList<Item>();

    for (int i = 1; i < names.size(); i++) {
      TransactionNameModel name = names.get(i);
      Item item = new Item();
      TransactionName transaction = name.getDetail();
      item.setNumber(transaction.getTotalCount()).setTitle(transaction.getId());
      items.add(item);
    }

    chart.addItems(items);
    model.setPieChart(new JsonBuilder().toJson(chart));
  }
View Full Code Here

  private List<PieChart> buildDetailPieChart(MetricReport report) {
    Map<String, Statistic> statics = report.getStatistics();
    List<PieChart> charts = new ArrayList<PieChart>();

    for (Entry<String, Statistic> entry : statics.entrySet()) {
      PieChart chart = new PieChart().setMaxSize(Integer.MAX_VALUE);
      List<Item> items = new ArrayList<Item>();
      Statistic values = entry.getValue();
      Map<String, StatisticsItem> statisticsItems = values.getStatisticsItems();

      for (StatisticsItem tmp : statisticsItems.values()) {
        Item item = new Item();

        item.setNumber(tmp.getCount());
        item.setTitle(tmp.getId());
        items.add(item);
      }
      chart.setTitle(entry.getKey());
      chart.addItems(items);
      charts.add(chart);
    }
    return charts;
  }
View Full Code Here

        Date endDate, final Map<String, double[]> dataWithOutFutures) {
    LineChart lineChart = new LineChart();
    int step = m_dataExtractor.getStep();
    lineChart.setStart(startDate);
    lineChart.setStep(step * TimeHelper.ONE_MINUTE);
    PieChart pieChart = new PieChart();
    List<PieChart.Item> items = new ArrayList<PieChart.Item>();

    pieChart.addItems(items);
    for (Entry<String, double[]> entry : dataWithOutFutures.entrySet()) {
      String key = entry.getKey();
      double[] value = entry.getValue();
      Map<Long, Double> all = convertToMap(datas.get(key), startDate, 1);
      Map<Long, Double> current = convertToMap(dataWithOutFutures.get(key), startDate, step);
View Full Code Here

      model.setGraph2(graph2);
    }
  }

  private void buildEventNamePieChart(List<EventNameModel> names, Model model) {
    PieChart chart = new PieChart();
    List<Item> items = new ArrayList<Item>();

    for (int i = 1; i < names.size(); i++) {
      EventNameModel name = names.get(i);
      Item item = new Item();
      EventName event = name.getDetail();
      item.setNumber(event.getTotalCount()).setTitle(event.getId());
      items.add(item);
    }

    chart.addItems(items);
    model.setPieChart(new JsonBuilder().toJson(chart));
  }
View Full Code Here

    m_type = type;
    m_status = status;
  }

  public PieChart getPieChart() {
    PieChart chart = new PieChart();
    List<Item> items = new ArrayList<Item>();

    for (java.util.Map.Entry<String, Integer> entry : m_items.entrySet()) {
      Item item = new Item();

      item.setNumber(entry.getValue()).setTitle(entry.getKey());
      items.add(item);
    }
    chart.addItems(items);
   
    return chart;
  }
View Full Code Here

TOP

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

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.