Package com.dianping.cat.message

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


        List<String> emails = m_scheduledManager.queryEmailsBySchReportId(report.getId());
        AlertMessageEntity message = new AlertMessageEntity(domain, title, "ScheduledJob", content, emails);
        boolean result = m_sendManager.sendAlert(AlertChannel.MAIL, message);

        insertMailLog(report.getId(), content, title, result, emails);
        t.addData(emails.toString());
        t.setStatus(Transaction.SUCCESS);
      } catch (Exception e) {
        Cat.logError(e);
        t.setStatus(e);
      } finally {
View Full Code Here


      String cmdb = String.format(CMDB_DOMAIN_URL, ip);
      InputStream in = Urls.forIO().readTimeout(1000).connectTimeout(1000).openStream(cmdb);
      String content = Files.forIO().readFrom(in, "utf-8");

      t.setStatus(Transaction.SUCCESS);
      t.addData(content);
      return parseDomain(content.trim());
    } catch (Exception e) {
      Cat.logError(e);
      t.setStatus(e);
    } finally {
View Full Code Here

      String cmdb = String.format(CMDB_HOSTNAME_URL, ip);
      InputStream in = Urls.forIO().readTimeout(1000).connectTimeout(1000).openStream(cmdb);
      String content = Files.forIO().readFrom(in, "utf-8");

      t.setStatus(Transaction.SUCCESS);
      t.addData(content);
      return parseHostname(content.trim());
    } catch (Exception e) {
      t.setStatus(e);
    } finally {
      t.complete();
View Full Code Here

      String cmdb = String.format(CMDB_INFO_URL, cmdbDomain);
      InputStream in = Urls.forIO().readTimeout(1000).connectTimeout(1000).openStream(cmdb);
      String content = Files.forIO().readFrom(in, "utf-8");

      t.setStatus(Transaction.SUCCESS);
      t.addData(content);
      return parseInfos(content.trim());
    } catch (Exception e) {
      t.setStatus(e);
    } finally {
      t.complete();
View Full Code Here

    try {
      InputStream in = Urls.forIO().readTimeout(1000).connectTimeout(1000).openStream(url);
      String content = Files.forIO().readFrom(in, "utf-8");

      t.setStatus(Transaction.SUCCESS);
      t.addData(content);
      return parseInfo(content, jsonName, attrName);
    } catch (Exception e) {
      t.setStatus(e);
    } finally {
      t.complete();
View Full Code Here

  @Override
  protected boolean processTask(Task doing) {
    boolean result = false;
    Transaction t = Cat.newTransaction("Task", doing.getReportName());

    t.addData(doing.toString());
    try {
      result = m_reportFacade.builderReport(doing);
      t.setStatus(Transaction.SUCCESS);
    } catch (Exception e) {
      Cat.logError(e);
View Full Code Here

    MessageProducer producer = Cat.getProducer();
    Transaction t = producer.newTransaction("URL", "MyPage");

    try {
      // do your business here
      t.addData("k1", "v1");
      t.addData("k2", "v2");
      t.addData("k3", "v3");

      Thread.sleep(20);
View Full Code Here

    Transaction t = producer.newTransaction("URL", "MyPage");

    try {
      // do your business here
      t.addData("k1", "v1");
      t.addData("k2", "v2");
      t.addData("k3", "v3");

      Thread.sleep(20);

      producer.logEvent("URL", "Payload", Message.SUCCESS, "host=my-host&ip=127.0.0.1&agent=...");
View Full Code Here

    try {
      // do your business here
      t.addData("k1", "v1");
      t.addData("k2", "v2");
      t.addData("k3", "v3");

      Thread.sleep(20);

      producer.logEvent("URL", "Payload", Message.SUCCESS, "host=my-host&ip=127.0.0.1&agent=...");
      t.setStatus(Message.SUCCESS);
View Full Code Here

    MessageProducer producer = Cat.getProducer();
    Transaction t = producer.newTransaction("URL", "MyPage");

    try {
      // do your business here
      t.addData("k1", "v1");
      t.addData("k2", "v2");
      t.addData("k3", "v3");

      Thread.sleep(20);
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.