Package com.dianping.cat.report.page.top

Examples of com.dianping.cat.report.page.top.TopMetric$StringCompartor


  public void buildTopErrorInfo(Payload payload, Model model) {
    int minuteCount = payload.getMinuteCounts();
    int minute = model.getMinute();
    TopReport report = queryTopReport(payload);
    List<String> excludeDomains = Arrays.asList(Constants.FRONT_END);
    TopMetric topMetric = new TopMetric(minuteCount, payload.getTopCounts(), m_configManager, excludeDomains);
    Date end = new Date(payload.getDate() + TimeHelper.ONE_MINUTE * minute);
    Date start = new Date(end.getTime() - TimeHelper.ONE_MINUTE * minuteCount);

    topMetric.setStart(start).setEnd(end);
    if (minuteCount > minute) {
      Payload lastPayload = new Payload();
      Date lastHour = new Date(payload.getDate() - TimeHelper.ONE_HOUR);
      lastPayload.setDate(new SimpleDateFormat("yyyyMMddHH").format(lastHour));

      topMetric.visitTopReport(queryTopReport(lastPayload));
    }
    topMetric.visitTopReport(report);
    model.setTopReport(report);
    model.setTopMetric(topMetric);
  }
View Full Code Here


  private static final int ALERT_PERIOD = 1;

  private TopMetric buildTopMetric(Date date) {
    TopReport topReport = queryTopReport(date);
    TopMetric topMetric = new TopMetric(ALERT_PERIOD, Integer.MAX_VALUE, m_exceptionConfigManager);

    topMetric.setStart(date).setEnd(new Date(date.getTime() + TimeHelper.ONE_MINUTE));
    topMetric.visitTopReport(topReport);
    return topMetric;
  }
View Full Code Here

    while (active) {
      long current = System.currentTimeMillis();
      Transaction t = Cat.newTransaction("AlertException", TimeHelper.getMinuteStr());

      try {
        TopMetric topMetric = buildTopMetric(new Date(current - TimeHelper.ONE_MINUTE * 2));
        Collection<List<Item>> itemLists = topMetric.getError().getResult().values();
        List<Item> itemList = new ArrayList<Item>();

        if (!itemLists.isEmpty()) {
          itemList = itemLists.iterator().next();
        }
View Full Code Here

TOP

Related Classes of com.dianping.cat.report.page.top.TopMetric$StringCompartor

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.