Package com.dianping.cat.message.internal

Examples of com.dianping.cat.message.internal.DefaultHeartbeat


    Metric.setTimestamp(timestamp);
    return Metric;
  }

  private Heartbeat newHeartbeat(String type, String name, long timestamp, String status, String data) {
    DefaultHeartbeat heartbeat = new DefaultHeartbeat(type, name);

    heartbeat.setStatus(status);
    heartbeat.addData(data);
    heartbeat.setTimestamp(timestamp);
    return heartbeat;
  }
View Full Code Here


        return parent;
      } else {
        return trace;
      }
    case 'H':
      DefaultHeartbeat heartbeat = new DefaultHeartbeat(type, name);
      String heartbeatStatus = helper.read(ctx, TAB);
      String heartbeatData = helper.read(ctx, TAB);

      helper.read(ctx, LF); // get rid of line feed
      heartbeat.setTimestamp(m_dateHelper.parse(timestamp));
      heartbeat.setStatus(heartbeatStatus);
      heartbeat.addData(heartbeatData);

      if (parent != null) {
        parent.addChild(heartbeat);
        return parent;
      } else {
View Full Code Here

        return parent;
      } else {
        return trace;
      }
    case 'H':
      DefaultHeartbeat heartbeat = new DefaultHeartbeat(type, name);
      String heartbeatStatus = helper.read(buf, TAB);
      String heartbeatData = helper.read(buf, TAB);

      helper.read(buf, LF); // get rid of line feed
      heartbeat.setTimestamp(m_dateHelper.parse(timestamp));
      heartbeat.setStatus(heartbeatStatus);
      heartbeat.addData(heartbeatData);

      if (parent != null) {
        parent.addChild(heartbeat);
        return parent;
      } else {
View Full Code Here

    metric.setTimestamp(timestamp);
    return metric;
  }

  private Heartbeat newHeartbeat(String type, String name, long timestamp, String status, String data) {
    DefaultHeartbeat heartbeat = new DefaultHeartbeat(type, name);

    heartbeat.setStatus(status);
    heartbeat.addData(data);
    heartbeat.setTimestamp(timestamp);
    return heartbeat;
  }
View Full Code Here

    return tree;
  }

  private Heartbeat newHeartbeat(String type, String name, long timestamp, String status) throws IOException {
    DefaultHeartbeat heartbeat = new DefaultHeartbeat(type, name);

    heartbeat.setStatus(status);
    heartbeat.setTimestamp(timestamp);

    if (m_status == null) {
      m_status = Files.forIO().readFrom(getClass().getResourceAsStream("status_info.xml"), "utf-8");
    }

    heartbeat.addData(m_status);

    return heartbeat;
  }
View Full Code Here

      DefaultEvent error = new DefaultEvent("Error", "Error", null);
     
      error.setTimestamp(m_timestamp);
      tree.setMessage(error);
    } else if (i < 20) {
      DefaultHeartbeat heartbeat = new DefaultHeartbeat("heartbeat", "heartbeat");
     
      heartbeat.setTimestamp(m_timestamp);
      tree.setMessage(heartbeat);
    } else {

      DefaultTransaction t = new DefaultTransaction("A", "n" + i % 2, null);

      t.setTimestamp(m_timestamp);
      t.setDurationInMillis(i * 50);

      switch (i % 7) {
      case 0:
        t.setType("URL");
        break;
      case 1:
        t.setType("Call");
        break;
      case 2:
        t.setType("Cache.");
        t.setDurationInMillis(i * 5);
        break;
      case 3:
        t.setType("SQL");
        break;
      case 4:
        t.setType("PigeonCall");
        break;
      case 5:
        t.setType("Service");
        break;
      case 6:
        t.setType("PigeonService");
        break;
      }

      Event error = new DefaultEvent("Error", "Error", null);
      Event exception = new DefaultEvent("Other", "Exception", null);
      Heartbeat heartbeat = new DefaultHeartbeat("heartbeat", "heartbeat");
      DefaultTransaction transaction = new DefaultTransaction("Transaction", "Transaction", null);

      transaction.setStatus(Transaction.SUCCESS);
      t.addChild(transaction);
      t.addChild(error);
View Full Code Here

TOP

Related Classes of com.dianping.cat.message.internal.DefaultHeartbeat

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.