Package com.dianping.cat.message

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


      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) {
        String report = buildModel(xml);

        response.setModel(report);
View Full Code Here


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

        response.setModel(report);
        t.addData("hit", "true");
      }
      t.setStatus(Message.SUCCESS);
    } catch (Exception e) {
      t.setStatus(Message.SUCCESS);
    } finally {
View Full Code Here

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

  @Test
  public void sendCacheTransactionWithMissed() throws Exception {
    for (int i = 0; i < 130; i++) {
      Transaction t = Cat.getProducer().newTransaction("Cache.kvdb", "Method" + i % 10);
      Cat.getProducer().newEvent("Cache.kvdb", "Method" + i % 10 + ":missed");
      t.addData("key and value");

      Transaction t2 = Cat.getProducer().newTransaction("Cache.web", "Method" + i % 10);
      Cat.getProducer().newEvent("Cache.web", "Method" + i % 10 + ":missed");
      t2.addData("key and value");
      Thread.sleep(2);
View Full Code Here

      Cat.getProducer().newEvent("Cache.kvdb", "Method" + i % 10 + ":missed");
      t.addData("key and value");

      Transaction t2 = Cat.getProducer().newTransaction("Cache.web", "Method" + i % 10);
      Cat.getProducer().newEvent("Cache.web", "Method" + i % 10 + ":missed");
      t2.addData("key and value");
      Thread.sleep(2);
      t2.complete();
      t.complete();

      Transaction t3 = Cat.getProducer().newTransaction("Cache.memcached", "Method" + i % 10);
View Full Code Here

      Thread.sleep(2);
      t2.complete();
      t.complete();

      Transaction t3 = Cat.getProducer().newTransaction("Cache.memcached", "Method" + i % 10);
      t3.addData("key and value");
      Thread.sleep(3);
      t3.complete();
    }

    Transaction t2 = Cat.getProducer().newTransaction("Cache.web", "Method");
View Full Code Here

      Thread.sleep(3);
      t3.complete();
    }

    Transaction t2 = Cat.getProducer().newTransaction("Cache.web", "Method");
    t2.addData("key and value");
    Thread.sleep(2);
    t2.complete();
    Thread.sleep(1000);
  }
View Full Code Here

    final Semaphore semaphore = new Semaphore(0);
    final Transaction t = Cat.getProducer().newTransaction("ModelService", getClass().getSimpleName());
    int count = 0;

    t.setStatus(Message.SUCCESS);
    t.addData("request", request);
    t.addData("thread", Thread.currentThread());

    for (final ModelService<T> service : m_allServices) {
      if (!service.isEligable(request)) {
        continue;
View Full Code Here

    final Transaction t = Cat.getProducer().newTransaction("ModelService", getClass().getSimpleName());
    int count = 0;

    t.setStatus(Message.SUCCESS);
    t.addData("request", request);
    t.addData("thread", Thread.currentThread());

    for (final ModelService<T> service : m_allServices) {
      if (!service.isEligable(request)) {
        continue;
      }
View Full Code Here

      i++;
      Transaction total = Cat.newTransaction("cat", "Test");
      Transaction t = Cat.getProducer().newTransaction("Cache.kvdb", "Method" + i % 10);
      t.setStatus(Message.SUCCESS);
      Cat.getProducer().newEvent("Cache.kvdb", "Method" + i % 10 + ":missed");
      t.addData("key and value");

      Transaction t2 = Cat.getProducer().newTransaction("Cache.web", "Method" + i % 10);
      Cat.getProducer().newEvent("Cache.web", "Method" + i % 10 + ":missed");
      t2.addData("key and value");
      t2.setStatus(Message.SUCCESS);
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.