Package com.dianping.cat.message

Examples of com.dianping.cat.message.Heartbeat


  }

  @Test
  public void testHeartbeat() {
    long timestamp = 1325489621987L;
    Heartbeat heartbeat = newHeartbeat("type", "name", timestamp, "0", "here is the data.");

    check(heartbeat, "H2012-01-02 15:33:41.987\ttype\tname\t0\there is the data.\t\n");
  }
View Full Code Here


    event.complete();
  }

  @Override
  public void logHeartbeat(String type, String name, String status, String nameValuePairs) {
    Heartbeat heartbeat = newHeartbeat(type, name);

    heartbeat.addData(nameValuePairs);
    heartbeat.setStatus(status);
    heartbeat.complete();
  }
View Full Code Here

    while (m_active) {
      long start = MilliSecondTimer.currentTimeMillis();

      if (m_manager.isCatEnabled()) {
        Transaction t = cat.newTransaction("System", "Status");
        Heartbeat h = cat.newHeartbeat("Heartbeat", m_ipAddress);
        StatusInfo status = new StatusInfo();

        t.addData("dumpLocked", m_manager.isDumpLocked());
        try {
          StatusInfoCollector statusInfoCollector = new StatusInfoCollector(m_statistics, m_jars);

          status.accept(statusInfoCollector.setDumpLocked(m_manager.isDumpLocked()));

          buildExtensionData(status);
          h.addData(status.toString());
          h.setStatus(Message.SUCCESS);
        } catch (Throwable e) {
          h.setStatus(e);
          cat.logError(e);
        } finally {
          h.complete();
        }
        t.setStatus(Message.SUCCESS);
        t.complete();
      }
      long elapsed = MilliSecondTimer.currentTimeMillis() - start;
View Full Code Here

  }

  @Test
  public void testHeartbeat() throws Exception {
    long timestamp = 1325489621987L;
    Heartbeat heartbeat = newHeartbeat("type", "name", timestamp, "0", "here is the data.");

    MessageTree tree = new DefaultMessageTree();
    tree.setMessage(heartbeat);
    check(tree, heartbeat,
          "<tr><td>H15:33:41.987</td><td>type</td><td>name</td><td>&nbsp;</td><td>here is the data.</td></tr>\r\n");
View Full Code Here

    tree.setHostName("group001");
    tree.setIpAddress("192.168.1.1");

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

    Heartbeat heartbeat = newHeartbeat("heartbeat", "fail", m_timestamp, "0");

    t.addChild(heartbeat);

    t.complete();
    t.setDurationInMillis(i * 2);
 
View Full Code Here

        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.Heartbeat

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.