Package com.dianping.cat.message

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


            success = sendBatchEntities(dataEntities);
          } catch (Exception e) {
            Cat.logError(e);
          } finally {
            t.setStatus(Transaction.SUCCESS);
            t.complete();
          }

          if (!success) {
            Cat.logError(new RuntimeException("All cat servers: " + m_catServers.getServers()
                  + "are unreachable. DataEntity: " + dataEntities.toString()));
View Full Code Here


        }
        t.setStatus(Message.SUCCESS);
      } catch (Exception e) {
        t.setStatus(e);
      } finally {
        t.complete();
      }
    }

    private List<DependencyReport> fetchReport(Collection<String> domains) {
      long current = System.currentTimeMillis();
View Full Code Here

        }
        t.setStatus(Message.SUCCESS);
      } catch (Exception e) {
        t.setStatus(e);
      } finally {
        t.complete();
      }
      return reports;
    }

    @Override
View Full Code Here

          t.setStatus(Transaction.SUCCESS);
        } catch (Exception e) {
          m_logger.error(e.getMessage(), e);
          t.setStatus(e);
        } finally {
          t.complete();
        }
        long duration = System.currentTimeMillis() - current;

        try {
          int maxDuration = 60 * 1000;
 
View Full Code Here

      producer.logEvent("URL", "Payload", Message.SUCCESS, "host=my-host&ip=127.0.0.1&agent=...");
      t.setStatus(Message.SUCCESS);
    } catch (Exception e) {
      t.setStatus(e);
    } finally {
      t.complete();
    }

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

      producer.logEvent("URL", "Payload", Message.SUCCESS, "host=my-host&ip=127.0.0.1&agent=...");
      t.setStatus(Message.SUCCESS);
    } catch (Exception e) {
      t.setStatus(e);
    } finally {
      t.complete();
    }

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

    }

    t5.complete();
    t6.complete();
    t7.complete();
    t8.complete();
    t2.addData(convertException(new NullPointerException()));
    t2.setStatus(convertException(new NullPointerException()));
    t4.complete();
    t3.complete();
    t2.complete();
View Full Code Here

    while (!stack.isEmpty()) {
      Transaction t = stack.pop();

      t.setStatus(Message.SUCCESS);
      t.complete();
    }

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

      Assert.assertEquals("mock content here!", content);

      t.setStatus(Message.SUCCESS);
    } finally {
      t.complete();
    }

    TimeUnit.MILLISECONDS.sleep(100);
  }
View Full Code Here

    tree.setMessageId(rootId);

    Transaction t = Cat.newTransaction("Mock", "testMode2");
    Cat.logEvent("RemoteCall", url, Message.SUCCESS, id);
    t.setStatus(Message.SUCCESS);
    t.complete();

    TimeUnit.MILLISECONDS.sleep(100);
  }

  private String getHeader(Map<String, List<String>> headers, String name) {
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.