Exemplo n.º 1
0
  private List<String> queryAllDomain(Date start, Date end) {
    Set<String> domains = new LinkedHashSet<String>();

    try {
      List<Dailyreport> reports =
          m_dailyreportDao.findAllDomainsByNameDuration(
              start, end, "health", DailyreportEntity.READSET_DOMAIN_NAME);

      for (Dailyreport report : reports) {
        domains.add(report.getDomain());
      }
    } catch (DalException e) {
      Cat.logError(e);
    }
    return StringSortHelper.sort(domains);
  }
Exemplo n.º 2
0
 private void processOneDay(Date date, List<String> domains) {
   for (String domain : domains) {
     try {
       Dailyreport report =
           m_dailyreportDao.findByNameDomainPeriod(
               date, domain, "health", DailyreportEntity.READSET_FULL);
       HealthReport healthReport = DefaultSaxParser.parse(report.getContent());
       MachineInfo machine = healthReport.getMachineInfo();
       MonthDomain indicator = m_indicators.get(domain);
       if (indicator == null) {
         indicator = new MonthDomain();
         m_indicators.put(domain, indicator);
       }
       DomainInfo t = indicator.findOrCreatDomain(date);
       t.add(machine.getNumbers(), machine.getAvgMaxLoad(), machine.getAvgLoad());
     } catch (DalNotFoundException e) {
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
 }