Package com.dianping.cat.message

Examples of com.dianping.cat.message.Transaction.addData()


  @Test
  public void sendCacheTransaction() throws Exception {
    for (int i = 0; i < 100; i++) {
      Transaction t = Cat.getProducer().newTransaction("Cache.kvdb", "Method6");
      Cat.getProducer().newEvent("PigeonService.client", "192.168.7.77");
      t.addData("key and value");

      Thread.sleep(11);
      Transaction t2 = Cat.getProducer().newTransaction("Cache.local", "Method");
      Cat.getProducer().newEvent("PigeonService.client", "192.168.7.77");
      t2.addData("key and value");
View Full Code Here


      t.addData("key and value");

      Thread.sleep(11);
      Transaction t2 = Cat.getProducer().newTransaction("Cache.local", "Method");
      Cat.getProducer().newEvent("PigeonService.client", "192.168.7.77");
      t2.addData("key and value");

      Thread.sleep(11);
      t2.complete();
      t.complete();
    }
View Full Code Here

  @Test
  public void sendLongCacheTransaction() throws Exception {
    for (int i = 0; i < 100; i++) {
      Transaction t = Cat.getProducer().newTransaction("Cache.kvdb", "Method6");
      Cat.getProducer().newEvent("PigeonService.client", "192.168.7.77");
      t.addData("key and value");

      Thread.sleep(11);
      Transaction t2 = Cat.getProducer().newTransaction("Cache.local", "Method");
      Cat.getProducer().newEvent("PigeonService.client", "192.168.7.77");
      t2.addData("key and value");
View Full Code Here

      t.addData("key and value");

      Thread.sleep(11);
      Transaction t2 = Cat.getProducer().newTransaction("Cache.local", "Method");
      Cat.getProducer().newEvent("PigeonService.client", "192.168.7.77");
      t2.addData("key and value");

      Thread.sleep(11);
      t2.complete();
      t.complete();
    }
View Full Code Here

  @Test
  public void sendLongURLTransaction() throws Exception {
    for (int i = 0; i < 10; i++) {
      Transaction t = Cat.getProducer().newTransaction("URL", "Method6");
      t.addData("key and value");
      Thread.sleep(60);
      t.complete();
    }
  }
View Full Code Here

    Transaction t = newTransaction("ModelService", getClass().getSimpleName());

    try {
      URL url = buildUrl(request);

      t.addData(url.toString());

      InputStream in = Urls.forIO().connectTimeout(1000).readTimeout(5000).openStream(url.toExternalForm());
      GZIPInputStream gzip = new GZIPInputStream(in);
      String xml = Files.forIO().readFrom(gzip, "utf-8");
View Full Code Here

      GZIPInputStream gzip = new GZIPInputStream(in);
      String xml = Files.forIO().readFrom(gzip, "utf-8");

      int len = xml == null ? 0 : xml.length();

      t.addData("length", len);

      if (len > 0) {
        T report = buildModel(xml);

        response.setModel(report);
View Full Code Here

  public void test() throws Exception {
    while (true) {
      for (int i = 0; i < 1000; i++) {
        Transaction t = Cat.newTransaction("URL", "/index");
        Cat.logEvent("RemoteLink", "sina", Event.SUCCESS, "http://sina.com.cn/");
        t.addData("channel=channel" + i % 5);
       
        Cat.logMetricForCount("Receipt Verify Success");

        MessageTree tree = (MessageTree) Cat.getManager().getThreadLocalMessageTree();
        tree.setDomain(TuanGou);
View Full Code Here

      for (int i = 0; i < 900; i++) {
        Transaction t = Cat.newTransaction("URL", "/detail");
        MessageTree tree = (MessageTree) Cat.getManager().getThreadLocalMessageTree();

        tree.setDomain(TuanGou);
        t.addData("channel=channel" + i % 5);
        t.complete();
      }

      for (int i = 0; i < 500; i++) {
        Transaction t = Cat.newTransaction("URL", "/order/submitOrder");
View Full Code Here

        tree.setDomain(PayOrder);
        Cat.logMetric("order", "quantity", 1, "channel", "channel" + i % 5);
        Cat.logMetric("payment.pending", "amount", i, "channel", "channel" + i % 5);
        Cat.logMetric("payment.success", "amount", i, "channel", "channel" + i % 5);
        t.addData("channel=channel" + i % 5);
        t.complete();
      }

      for (int i = 0; i < 1000; i++) {
        Transaction t = Cat.newTransaction("URL", "t");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.