Package com.dianping.cat.message.internal

Examples of com.dianping.cat.message.internal.DefaultTransaction


    tree.setMessageId("" + i);
    tree.setDomain(m_domain);
    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);
    t.setTimestamp(m_timestamp + 1000);
    tree.setMessage(t);

    return tree;
  }
View Full Code Here


     
      heartbeat.setTimestamp(m_timestamp);
      tree.setMessage(heartbeat);
    } else {

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

      t.setTimestamp(m_timestamp);
      t.setDurationInMillis(i * 50);

      switch (i % 7) {
      case 0:
        t.setType("URL");
        break;
      case 1:
        t.setType("Call");
        break;
      case 2:
        t.setType("Cache.");
        t.setDurationInMillis(i * 5);
        break;
      case 3:
        t.setType("SQL");
        break;
      case 4:
        t.setType("PigeonCall");
        break;
      case 5:
        t.setType("Service");
        break;
      case 6:
        t.setType("PigeonService");
        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);
      t.addChild(exception);
      t.addChild(heartbeat);
      tree.setMessage(t);
View Full Code Here

    return tree;
  }

  private Transaction newTransaction(String type, String name, long timestamp, String status, int duration, String data) {
    DefaultTransaction transaction = new DefaultTransaction(type, name, null);

    transaction.setStatus(status);
    transaction.addData(data);
    transaction.complete();
    transaction.setTimestamp(timestamp);
    transaction.setDurationInMillis(duration);

    return transaction;
  }
View Full Code Here

TOP

Related Classes of com.dianping.cat.message.internal.DefaultTransaction

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.