Package com.dianping.cat.message

Examples of com.dianping.cat.message.Message


  @Override
  public void process(MessageTree tree) {
    String domain = tree.getDomain();
    DependencyReport report = findOrCreateReport(domain);
    Message message = tree.getMessage();

    if (message instanceof Transaction) {
      processTransaction(report, tree, (Transaction) message);
    } else if (message instanceof Event) {
      processEvent(report, tree, (Event) message);
View Full Code Here


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

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

      if (m_serverConfigManager.discardTransaction((Transaction) message)) {
        return;
      }
      if (messageType.equals("URL") || messageType.equals("Service") || messageType.equals("PigeonService")) {
        Matrix matrix = report.findOrCreateMatrix(message.getName());
        matrix.setType(message.getType());
        matrix.setName(message.getName());
        long duration = ((Transaction) message).getDurationInMicros();
        matrix.incCount();
        matrix.setTotalTime(matrix.getTotalTime() + duration);

        Map<String, Ratio> ratios = new HashMap<String, Ratio>();
View Full Code Here

  public void process(MessageTree tree) {
    String domain = tree.getDomain();
    String group = m_productLineConfigManager.queryProductLineByDomain(domain);
    MetricReport report = findOrCreateReport(group);

    Message message = tree.getMessage();

    if (message instanceof Transaction) {
      processTransaction(report, tree, (Transaction) message);
    } else if (message instanceof Metric) {
      processMetric(report, tree, (Metric) message);
View Full Code Here

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

    Message message = tree.getMessage();
    report.addIp(tree.getIpAddress());

    if (message instanceof Transaction) {
      processTransaction(report, tree, (Transaction) message);
    }
View Full Code Here

    // please stop CAT server when you run this test case
    Assert.assertEquals("One message should be in the queue.", 1, m_queue.size());

    MessageTree tree = m_queue.poll();
    Message m = tree.getMessage();

    Assert.assertTrue(Transaction.class.isAssignableFrom(m.getClass()));

    Transaction trans = (Transaction) m;

    Assert.assertEquals("URL", trans.getType());
    Assert.assertEquals("MyPage", trans.getName());
    Assert.assertEquals("0", trans.getStatus());
    Assert.assertTrue(trans.getDurationInMillis() > 0);
    Assert.assertEquals("k1=v1&k2=v2&k3=v3", trans.getData().toString());

    Assert.assertEquals(1, trans.getChildren().size());

    Message c = trans.getChildren().get(0);

    Assert.assertEquals("URL", c.getType());
    Assert.assertEquals("Payload", c.getName());
    Assert.assertEquals("0", c.getStatus());
    Assert.assertEquals("host=my-host&ip=127.0.0.1&agent=...", c.getData().toString());
  }
View Full Code Here

      result.setBuffer(buf);
    }
  }

  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

    // please stop CAT server when you run this test case
    Assert.assertEquals("One message should be in the queue.", 1, m_queue.size());

    MessageTree tree = m_queue.poll();
    Message m = tree.getMessage();

    Assert.assertTrue(Transaction.class.isAssignableFrom(m.getClass()));

    Transaction trans = (Transaction) m;

    Assert.assertEquals("URL", trans.getType());
    Assert.assertEquals("MyPage", trans.getName());
    Assert.assertEquals("0", trans.getStatus());
    Assert.assertTrue(trans.getDurationInMillis() > 0);
    Assert.assertEquals("k1=v1&k2=v2&k3=v3", trans.getData().toString());

    Assert.assertEquals(1, trans.getChildren().size());

    Message c = trans.getChildren().get(0);

    Assert.assertEquals("URL", c.getType());
    Assert.assertEquals("Payload", c.getName());
    Assert.assertEquals("0", c.getStatus());
    Assert.assertEquals("host=my-host&ip=127.0.0.1&agent=...", c.getData().toString());
  }
View Full Code Here

    codec.decode(buf, result);
    Assert.assertEquals(tree.toString(), result.toString());
  }

  public MessageTree buildMessage() {
    Message message = new MockMessageBuilder() {
      @Override
      public MessageHolder define() {
        TransactionHolder t = t("\n\nWEBC$$$$LUSTER\t\n", "GET\t\n","This&123123&1231&3&\n\n\n\n&\t\t\t&&&&\n\n\n\n\n\n is test data\t\t\n\n", 112819) //
              .at(1348374838231L) //
              .after(1300).child(t("QUICKIESERVICE", "gimme_stuff", 1571)) //
View Full Code Here

  }

  @Override
  protected void process(MessageTree tree) {
    String domain = tree.getDomain();
    Message message = tree.getMessage();
    HeartbeatReport report = findOrCreateReport(domain);
    report.addIp(tree.getIpAddress());

    if (message instanceof Transaction) {
      processTransaction(report, tree, (Transaction) message);
View Full Code Here

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

  public MessageTree buildMessage() {
    Message message = new MockMessageBuilder() {
      @Override
      public MessageHolder define() {
        TransactionHolder t = t("URL", "GET", 112819)
              .child(
                    t("PigeonCall",
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.