public List<UrlResponseTime> queryUrlResponseTimes(String applicationId) {
    Date startDate = DateUtil.getTodayBeginDate();
    Date endDate = new Date();
    List<Url> urls = applicationRepository.selectAllUrlsWithApplicationId(applicationId);
    List<UrlResponseTime> urlResponseTimes = new ArrayList<UrlResponseTime>();
    for (Url url : urls) {
      UrlResponseTime urlResponseTime =
          urlResponseTimeRepository.selectUrlResponseTimesForMonitorUrl(
              url.getId(), startDate, endDate, applicationId);
      urlResponseTime = urlResponseTime == null ? new UrlResponseTime() : urlResponseTime;

      urlResponseTime.setApplicationId(applicationId);
      urlResponseTime.setUrlId(url.getId());
      urlResponseTime.setUrl(url.getUrl());

      urlResponseTime.initViewValues();

      urlResponseTimes.add(urlResponseTime);
    }
    for (UrlResponseTime urlResponseTime : urlResponseTimes) {
      urlResponseTime.setHealthBar(
          healthStaCache.getHealthBar(applicationId, urlResponseTime.getUrlId()));
      urlResponseTime.setUrlHref(
          "<a href='javascript:void(0);' onclick=\"urlDetail('"
              + applicationId
              + "', '"
              + urlResponseTime.getUrlId()
              + "')\">"
              + urlResponseTime.getUrl()
              + "</a>");
    }
    return urlResponseTimes;
  }
  /**
   * 生成应用明细告警展示信息
   *
   * @param applicationId 所属应用ID
   * @return 告警展示信息
   */
  public ApplicationDetailAlarmViewModel generateAlarmViewModel(String applicationId) {
    Date startDate = DateUtil.getTodayBeginDate();
    Date endDate = new Date();

    Application application = applicationRepository.findApplicationbyId(applicationId);
    int interval = application.getInterval().intValue();
    ApplicationDetailAlarmViewModel applicationDetailAlarmViewModel =
        new ApplicationDetailAlarmViewModel();
    // 获得健康度
    SeverityLevel severityLevel = healthStaService.healthStaForCurrent(applicationId, interval);

    applicationDetailAlarmViewModel.setSeverityLevel(severityLevel);
    int criticalCount = alarmRepository.countCriticalByMonitorId(applicationId, startDate, endDate);

    Pageable pageable = new PageRequest(0, 10, Sort.Direction.DESC, "create_time");
    Page<Alarm> alarmPage =
        alarmRepository.selectCriticalAlarmsByMonitorId(
            pageable, applicationId, startDate, endDate);
    Iterator<Alarm> alarmIterator = alarmPage.iterator();
    while (alarmIterator.hasNext()) {
      applicationDetailAlarmViewModel.addAlarmInfo(alarmIterator.next().getMessage());
    }

    applicationDetailAlarmViewModel.setCriticalCount(criticalCount);
    return applicationDetailAlarmViewModel;
  }