Package com.dianping.cat.message.spi

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


  @Test
  public void testEvent() throws Exception {
    long timestamp = 1325489621987L;
    Event event = newEvent("type", "name", timestamp, "0", "here is the data.");

    MessageTree tree = new DefaultMessageTree();
    tree.setMessage(event);
    check(tree, event,
          "<tr><td>E15: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


  @Test
  public void testMetric() throws Exception {
    long timestamp = 1325489621987L;
    Metric Metric = newMetric("type", "name", timestamp, "0", "here is the data.");

    MessageTree tree = new DefaultMessageTree();
    tree.setMessage(Metric);
    check(tree, Metric,
          "<tr><td>M15: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

    String trace = "java.lang.Exception\n"
          + "\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testEventForException(PlainTextMessageCodecTest.java:112)\n"
          + "\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testEventForException(PlainTextMessageCodecTest.java:108)\n";
    Event event = newEvent("Exception", Exception.class.getName(), timestamp, "ERROR", trace);

    MessageTree tree = new DefaultMessageTree();
    tree.setMessage(event);
    check(tree,
          event,
          "<tr><td>E15:33:41.987</td><td>Exception</td><td>java.lang.Exception</td><td class=\"error\">ERROR</td><td>java.lang.Exception\n<br>"
                + "\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testEventForException(PlainTextMessageCodecTest.java:112)\n<br>"
                + "\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testEventForException(PlainTextMessageCodecTest.java:108)\n<br>"
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

          "<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");
  }

  @Test
  public void testMessageTree() throws Exception {
    MessageTree tree = newMessageTree();
    long timestamp = 1325489621987L;
    String expected1 = "<table class=\"logview\">\r\n"
          + "<tr class=\"header\"><td colspan=5><a href=\'rootMessageId?domain=domain\'>RootLogview</a>&nbsp;&nbsp;"
          + "<a href=\'parentMessageId?domain=domain\'>ParentLogview</a> HT2 domain hostName ipAddress threadGroupName threadId threadName messageId parentMessageId rootMessageId sessionToken </td></tr></table>";

    checkTree(tree, expected1);

    String expected2 = "<table class=\"logview\">\r\n"
          + "<tr class=\"header\"><td colspan=5><a href=\'rootMessageId?domain=domain\'>RootLogview</a>&nbsp;&nbsp;<a href=\'parentMessageId?domain=domain\'>ParentLogview</a> HT2 domain hostName ipAddress threadGroupName threadId threadName messageId parentMessageId rootMessageId sessionToken </td></tr><tr class=\"odd\"><td>E15:33:41.987</td><td>type</td><td>name</td><td>&nbsp;</td><td>here is the data.</td></tr>"
          + "\r\n</table>";

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

  @Test
  public void testTrace() throws Exception {
    long timestamp = 1325489621987L;
    Trace trace = newTrace("type", "name", timestamp, "0", "here is the data.");

    MessageTree tree = new DefaultMessageTree();
    tree.setMessage(trace);
    check(tree, trace,
          "<tr><td>L15: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

    String exception = "java.lang.Exception\n"
          + "\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testTraceForException(PlainTextMessageCodecTest.java:112)\n"
          + "\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testTraceForException(PlainTextMessageCodecTest.java:108)\n";
    Trace trace = newTrace("Exception", Exception.class.getName(), timestamp, "ERROR", exception);

    MessageTree tree = new DefaultMessageTree();
    tree.setMessage(trace);
    check(tree,
          trace,
          "<tr><td>L15:33:41.987</td><td>Exception</td><td>java.lang.Exception</td><td class=\"error\">ERROR</td><td>java.lang.Exception\n<br>"
                + "\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testTraceForException(PlainTextMessageCodecTest.java:112)\n<br>"
                + "\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testTraceForException(PlainTextMessageCodecTest.java:108)\n<br>"
View Full Code Here

          .addChild(newEvent("CacheHost", "host-1", timestamp + 22, "0", "ip=192.168.8.123")));
    root.addChild(newTransaction("DAL", "findReviewByPK", timestamp + 25, "0", 5,
          "select title,content from Review where id = ?"));
    root.addChild(newEvent("URL", "View", timestamp + 40, "0", "view=HTML"));

    MessageTree tree = new DefaultMessageTree();
    tree.setMessage(root);
    check(tree,
          root,
          "<tr><td>t15:33:41.987</td><td>URL</td><td>Review</td><td></td><td></td></tr>\r\n"
                + "<tr><td>&nbsp;&nbsp;E15:33:41.987</td><td>URL</td><td>Payload</td><td>&nbsp;</td><td>ip=127.0.0.1&amp;ua=Mozilla 5.0...&amp;refer=...&amp;...</td></tr>\r\n"
                + "<tr><td>&nbsp;&nbsp;A15:33:41.987</td><td>Service</td><td>Auth</td><td>&nbsp;</td><td>20ms userId=1357&amp;token=...</td></tr>\r\n"
View Full Code Here

  @Test
  public void testTransactionSimple() throws Exception {
    long timestamp = 1325489621987L;
    Transaction transaction = newTransaction("type", "name", timestamp, "0", 10, "here is the data.");

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

    root.addChild(newEvent("RemoteCall", "Pigeon", timestamp + 23, "0", "domain1-c0a83f99-135bdb7825c-1"));
    root.addChild(newTransaction("DAL", "findReviewByPK", timestamp + 25, "0", 5,
          "select title,content from Review where id = ?"));
    root.addChild(newEvent("URL", "View", timestamp + 40, "0", "view=HTML"));

    MessageTree tree = new DefaultMessageTree();
    tree.setMessage(root);
    tree.setMessageId("1637924287");
    check(tree,
          root,
          "<tr><td>t15:33:41.987</td><td>URL</td><td>Review</td><td></td><td></td></tr>\r\n"
                + "<tr><td>&nbsp;&nbsp;E15:33:41.987</td><td>URL</td><td>Payload</td><td>&nbsp;</td><td>ip=127.0.0.1&amp;ua=Mozilla 5.0...&amp;refer=...&amp;...</td></tr>\r\n"
                + "<tr><td>&nbsp;&nbsp;A15:33:41.987</td><td>Service</td><td>Auth</td><td>&nbsp;</td><td>20ms userId=1357&amp;token=...</td></tr>\r\n"
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.