Package com.dianping.cat.message.spi

Examples of com.dianping.cat.message.spi.MessageTree


public class MatrixPerformanceTest extends ComponentTestCase {

  @Test
  public void test() throws Exception {
    MatrixAnalyzer analyzer = (MatrixAnalyzer)lookup(MessageAnalyzer.class,MatrixAnalyzer.ID);
    MessageTree tree = buildMessage();

    long current = System.currentTimeMillis();

    int size = 10000000;
    for (int i = 0; i < size; i++) {
View Full Code Here


    heartbeat.setTimestamp(timestamp);
    return heartbeat;
  }

  private MessageTree newMessageTree() {
    MessageTree tree = new DefaultMessageTree();

    tree.setDomain("domain");
    tree.setHostName("hostName");
    tree.setIpAddress("ipAddress");
    tree.setMessageId("messageId");
    tree.setParentMessageId("parentMessageId");
    tree.setRootMessageId("rootMessageId");
    tree.setSessionToken("sessionToken");
    tree.setThreadGroupName("threadGroupName");
    tree.setThreadId("threadId");
    tree.setThreadName("threadName");

    return tree;
  }
View Full Code Here

        return t;
      }
    }.build();

    MessageTree tree = new DefaultMessageTree();
    tree.setDomain("cat");
    tree.setHostName("test");
    tree.setIpAddress("test");
    tree.setThreadGroupName("test");
    tree.setThreadId("test");
    tree.setThreadName("test");
    tree.setMessage(message);
    return tree;
  }
View Full Code Here

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

  @Test
  public void testMessageTree() {
    MessageTree tree = newMessageTree();
    long timestamp = 1325489621987L;
    String expected = "PT1\tdomain\thostName\tipAddress\tthreadGroupName\tthreadId\tthreadName\tmessageId\tparentMessageId\trootMessageId\tsessionToken\n";

    checkTree(tree, expected);

    expected += "E2012-01-02 15:33:41.987\ttype\tname\t0\there is the data.\t\n";

    tree.setMessage(newEvent("type", "name", timestamp, "0", "here is the data."));
    checkTree(tree, expected);
  }
View Full Code Here

public class MetricPerformanceTest extends ComponentTestCase {

  @Test
  public void test() throws Exception {
    MetricAnalyzer analyzer = (MetricAnalyzer)lookup(MessageAnalyzer.class,MetricAnalyzer.ID);
    MessageTree tree = buildMessage();

    System.out.println(tree);
    long current = System.currentTimeMillis();

    long size = 10000000l;
View Full Code Here

        return t;
      }
    }.build();

    MessageTree tree = new DefaultMessageTree();
    tree.setDomain("TuanGou");
    tree.setHostName("test");
    tree.setIpAddress("test");
    tree.setThreadGroupName("test");
    tree.setThreadId("test");
    tree.setThreadName("test");
    tree.setMessage(message);
    return tree;
  }
View Full Code Here

  private Logger m_logger;

  @Override
  public MessageTree decode(ChannelBuffer buf) {
    MessageTree tree = new DefaultMessageTree();

    decode(buf, tree);
    return tree;
  }
View Full Code Here

  private void checkMessage(String expected) {
    StringBuilder sb = new StringBuilder(1024);
    MessageCodec codec = new MockMessageCodec(sb);

    while (true) {
      MessageTree tree = m_queue.poll();

      if (tree != null) {
        codec.encode(tree, null);
      } else {
        break;
View Full Code Here

      defaultMetric.addData(String.valueOf(value));
    } else {
      throw new RuntimeException("Error type in metric api, type: " + type);
    }

    MessageTree tree = Cat.getManager().getThreadLocalMessageTree();
    Message message = tree.getMessage();

    if (message instanceof Transaction) {
      ((DefaultTransaction) message).setTimestamp(time);
    }
    if (!isNetwork(group) && !isSystem(group)) {
      tree.setDomain(domain);
    }
    return defaultMetric;
  }
View Full Code Here

  @Test
  public void test() throws Exception {
    ProblemAnalyzer analyzer = (ProblemAnalyzer) lookup(
        MessageAnalyzer.class, ProblemAnalyzer.ID);
    MessageTree tree = buildMessage();

    long current = System.currentTimeMillis();

    long size = 1000000000l;
    for (int i = 0; i < size; i++) {
View Full Code Here

TOP

Related Classes of com.dianping.cat.message.spi.MessageTree

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.