Package com.dianping.cat.message

Examples of com.dianping.cat.message.Message


        int len = children.size();

        count += encodeLine(transaction, buf, 't', Policy.WITHOUT_STATUS);

        for (int i = 0; i < len; i++) {
          Message child = children.get(i);

          count += encodeMessage(child, buf);
        }

        count += encodeLine(transaction, buf, 'T', Policy.WITH_DURATION);
View Full Code Here


    CrossInfo info = analyzer.parseCorssTransaction(t, tree);

    Assert.assertEquals(info.getLocalAddress(), "192.168.0.1");
    Assert.assertEquals(info.getRemoteAddress(), "Unknown");

    Message message = new DefaultEvent("PigeonCall.server", "10.1.1.1", null);
    Message messageApp = new DefaultEvent("PigeonCall.app", "myDomain", null);
    t.addChild(message);
    t.addChild(messageApp);

    info = analyzer.parseCorssTransaction(t, tree);
View Full Code Here

    CrossInfo info = analyzer.parseCorssTransaction(t, tree);

    Assert.assertEquals(info.getLocalAddress(), "192.168.0.1");
    Assert.assertEquals(info.getRemoteAddress(), "192.168.7.70");

    Message message = new DefaultEvent("PigeonService.client", "192.168.7.71", null);
    Message messageApp = new DefaultEvent("PigeonService.app", "myDomain", null);
    t.addChild(message);
    t.addChild(messageApp);

    info = analyzer.parseCorssTransaction(t, tree);
View Full Code Here

    DefaultTransaction t = new DefaultTransaction("Service", "method1", null);
    MessageTree tree = buildMockMessageTree();
    CrossInfo info = analyzer.parseCorssTransaction(t, tree);

    Message message = new DefaultEvent("PigeonService.client", "192.168.7.71:29987", null);
    Message messageApp = new DefaultEvent("PigeonService.app", "myDomain", null);
    t.addChild(message);
    t.addChild(messageApp);

    info = analyzer.parseCorssTransaction(t, tree);
View Full Code Here

    throw new UnsupportedOperationException("HtmlMessageCodec only supports one-way encoding!");
  }

  @Override
  public void encode(MessageTree tree, ChannelBuffer buf) {
    Message message = tree.getMessage();

    if (message instanceof Transaction) {
      int count = 0;
      int index = buf.writerIndex();
      BufferHelper helper = m_bufferHelper;
View Full Code Here

    count += encodeTransactionLine(tree, transaction, buf, locator, ruler);

    int len = children.size();

    for (int i = 0; i < len; i++) {
      Message child = children.get(i);

      locator.setLast(i == len - 1);

      if (child instanceof Transaction) {
        count += encodeTransaction(tree, (Transaction) child, buf, locator, ruler);
      } else if (child instanceof Event && "RemoteCall".equals(child.getType())) {
        count += encodeRemoteCall(tree, (Event) child, buf, locator, ruler);
      }
    }

    locator.upLevel();
View Full Code Here

    }

    public void truncateAndFlush(Context ctx, long timestamp) {
      MessageTree tree = ctx.m_tree;
      Stack<Transaction> stack = ctx.m_stack;
      Message message = tree.getMessage();

      if (message instanceof DefaultTransaction) {
        String id = tree.getMessageId();
        String rootId = tree.getRootMessageId();
        String childId = nextMessageId();
View Full Code Here

      if (transaction.isStandalone()) {
        List<Message> children = transaction.getChildren();
        int len = children.size();

        for (int i = 0; i < len; i++) {
          Message message = children.get(i);

          if (message instanceof Transaction) {
            validate(transaction, (Transaction) message);
          }
        }
View Full Code Here

    } else { // if it's not completed explicitly
      long duration = 0;
      int len = m_children == null ? 0 : m_children.size();

      if (len > 0) {
        Message lastChild = m_children.get(len - 1);

        if (lastChild instanceof Transaction) {
          DefaultTransaction trx = (DefaultTransaction) lastChild;

          duration = (trx.getTimestamp() - getTimestamp()) * 1000L + trx.getDurationInMicros();
        } else {
          duration = (lastChild.getTimestamp() - getTimestamp()) * 1000L;
        }
      }

      return duration;
    }
View Full Code Here

  protected void replaceChild(Message from, Message to) {
    int len = m_children.size();

    for (int i = 0; i < len; i++) {
      Message message = m_children.get(i);

      if (message == from) {
        m_children.set(i, to);
        break;
      }
View Full Code Here

TOP

Related Classes of com.dianping.cat.message.Message

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.