Package com.dianping.cat.message

Examples of com.dianping.cat.message.Message


        / 1000);
    // cost 64
  }

  public MessageTree buildMessage() {
    Message message = new MockMessageBuilder() {
      @Override
      public MessageHolder define() {
        TransactionHolder t = t("WEB CLUSTER", "GET", 112819)
            //
            .at(1348374838231L)
View Full Code Here


    Pair<Boolean, Long> pair = new Pair<Boolean, Long>(true, t.getDurationInMicros());
    List<Message> children = t.getChildren();
    int size = children.size();

    if (tree.getMessage() == t && size > 0) { // root transaction with children
      Message last = children.get(size - 1);

      if (last instanceof Event) {
        String type = last.getType();
        String name = last.getName();

        if (type.equals("RemoteCall") && name.equals("Next")) {
          pair.setKey(false);
        } else if (type.equals("TruncatedTransaction") && name.equals("TotalDuration")) {
          try {
            long delta = Long.parseLong(last.getData().toString());

            pair.setValue(delta);
          } catch (Exception e) {
            Cat.logError(e);
          }
View Full Code Here

  @Override
  public void process(MessageTree tree) {
    String domain = tree.getDomain();
    TransactionReport report = m_reportManager.getHourlyReport(getStartTime(), domain, true);
    Message message = tree.getMessage();

    report.addIp(tree.getIpAddress());

    if (message instanceof Transaction) {
      Transaction root = (Transaction) message;
View Full Code Here

    entries.add(entry);
    return entry;
  }

  protected int getSegmentByMessage(MessageTree tree) {
    Message message = tree.getMessage();
    long current = message.getTimestamp() / 1000 / 60;
    int min = (int) (current % (60));

    return min;
  }
View Full Code Here

  @Inject
  private Set<String> m_failureTypes;

  @Override
  public void handle(Machine machine, MessageTree tree) {
    Message message = tree.getMessage();

    if (message instanceof Transaction) {
      String type = message.getType();

      //TODO remove me
      if (!"ABTest".equals(type)) {
        processTransaction(machine, (Transaction) message, tree);
      }
View Full Code Here

    System.out.println("Cost " + (System.currentTimeMillis() - current) / 1000);
    //cost 62
  }

  public MessageTree buildMessage() {
    Message message = new MockMessageBuilder() {
      @Override
      public MessageHolder define() {
        TransactionHolder t = t("WEB CLUSTER", "GET", 112819) //
              .at(1348374838231L) //
              .after(1300).child(t("QUICKIE SERVICE", "gimme_stuff", 1571)) //
View Full Code Here

      return report;
    }
  }

  public MessageTree buildMessage() {
    Message message = new MockMessageBuilder() {
      @Override
      public MessageHolder define() {
        TransactionHolder t = t("URL", "GET", 112819)
              .child(
                    t("PigeonCall",
View Full Code Here

    }
  }

  protected void decodeMessage(Context ctx, MessageTree tree) {
    Stack<DefaultTransaction> stack = new Stack<DefaultTransaction>();
    Message parent = decodeLine(ctx, null, stack, tree);

    tree.setMessage(parent);

    while (ctx.getBuffer().readableBytes() > 0) {
      Message message = decodeLine(ctx, (DefaultTransaction) parent, stack, tree);

      if (message instanceof DefaultTransaction) {
        parent = message;
      } else {
        break;
View Full Code Here

        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

    }
  }

  protected void decodeMessage(ChannelBuffer buf, MessageTree tree) {
    Stack<DefaultTransaction> stack = new Stack<DefaultTransaction>();
    Message parent = decodeLine(buf, null, stack, tree);

    tree.setMessage(parent);

    while (buf.readableBytes() > 0) {
      Message message = decodeLine(buf, (DefaultTransaction) parent, stack, tree);

      if (message instanceof DefaultTransaction) {
        parent = message;
      } else {
        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.