Package com.dianping.cat.message

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


  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();
    }
  }

  @Test
  public void sendCacheTransactionWithMissed() throws Exception {
View Full Code Here


        t.setStatus("NoReport");
      }
    } catch (Exception e) {
      t.setStatus(e);
    } finally {
      t.complete();
    }

    return response;
  }
View Full Code Here

      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);
      t3.addData("key and value");
      Thread.sleep(3);
View Full Code Here

      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");
    t2.addData("key and value");
    Thread.sleep(2);
View Full Code Here

    }

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

  @Test
  public void sendMaxMessage() throws Exception {
View Full Code Here

                                                                 // timeout
    } catch (InterruptedException e) {
      // ignore it
      t.setStatus(e);
    } finally {
      t.complete();
    }

    ModelResponse<T> aggregated = new ModelResponse<T>();
    T report = merge(request, responses);
View Full Code Here

      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);
      t2.complete();

      Transaction t3 = Cat.getProducer().newTransaction("Cache.memcached", "Method" + i % 10);
      t3.addData("key and value");
      t3.setStatus(Message.SUCCESS);
      t3.complete();
View Full Code Here

      t2.complete();

      Transaction t3 = Cat.getProducer().newTransaction("Cache.memcached", "Method" + i % 10);
      t3.addData("key and value");
      t3.setStatus(Message.SUCCESS);
      t3.complete();

      Transaction t4 = Cat.getProducer().newTransaction("Cache.memcached", "Method" + i % 10);
      t4.addData("key and value");
      t4.setStatus(Message.SUCCESS);
      t4.complete();
View Full Code Here

      t3.complete();

      Transaction t4 = Cat.getProducer().newTransaction("Cache.memcached", "Method" + i % 10);
      t4.addData("key and value");
      t4.setStatus(Message.SUCCESS);
      t4.complete();

      Transaction t5 = Cat.getProducer().newTransaction("Cache.memcached", "Method" + i % 10);
      t5.addData("key and value");
      t5.setStatus(Message.SUCCESS);
      t5.complete();
View Full Code Here

      t4.complete();

      Transaction t5 = Cat.getProducer().newTransaction("Cache.memcached", "Method" + i % 10);
      t5.addData("key and value");
      t5.setStatus(Message.SUCCESS);
      t5.complete();

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