Package com.dianping.cat.home.dal.report

Examples of com.dianping.cat.home.dal.report.Event


    @Override
    public void run() {
      boolean active = true;
      while (active) {
        try {
          Event error = m_errors.poll(5, TimeUnit.MILLISECONDS);

          if (error != null) {
            m_eventDao.insert(error);

            long date = error.getDate().getTime();
            long minute = date - date % TimeHelper.ONE_MINUTE;
            String domain = error.getDomain();

            findOrCreateEvents(minute, domain).add(error);
            m_events.remove(minute - TimeHelper.ONE_HOUR * 3);
          }
        } catch (InterruptedException e) {
View Full Code Here


    int type = payload.getType();
    String ip = payload.getIp();
    String subject = payload.getTitle();
    String content = payload.getContent();
    String time = payload.getTime();
    Event event = new Event();

    if (StringUtils.isEmpty(subject)) {
      subject = content;
    }
    if (type == EventCollectManager.DB_ERROR) {
      event.setDomain(payload.getDatabase());
    } else {
      String domain = m_hostinfoService.queryDomainByIp(ip);

      event.setDomain(domain);
    }
    event.setIp(ip);
    event.setType(type);
    event.setContent(content);
    event.setSubject(subject);
    event.setLink(payload.getLink());
    try {
      event.setDate(m_sdf.parse(time));
    } catch (ParseException e) {
      event.setDate(new Date());
      try {
        event.setDate(new Date(Integer.parseInt(time)));
      } catch (Exception ex) {
        event.setDate(new Date());
        Cat.logError(ex);
      }
    }
    m_errorCollectManager.addEvent(event);
    model.setAction(Action.VIEW);
View Full Code Here

TOP

Related Classes of com.dianping.cat.home.dal.report.Event

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.