Package com.dianping.cat.message

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


      try {
        writer.write("mock content here!");

        // no status set by purpose
      } finally {
        t.complete();
      }
    }
  }
}
View Full Code Here


      Cat.logMetricForCount("MemberCardSuccess");
      Cat.logMetricForCount("MemberCardFail", 2);

      MessageTree tree = Cat.getManager().getThreadLocalMessageTree();
      ((DefaultMessageTree) tree).setDomain("MobileMembercardMainApiWeb");
      t.complete();
    }
    Thread.sleep(100000);
  }

  public void sample() {
View Full Code Here

     
      t.setStatus(Transaction.SUCCESS);//设置状态
    } catch (Exception e) {
      t.setStatus(e);//设置错误状态
    } finally {
      t.complete();//结束Transaction
    }
  }
 
  private void yourBusiness(){
   
View Full Code Here

      String version = getVersion(i);

      MessageTree tree = Cat.getManager().getThreadLocalMessageTree();
      ((DefaultMessageTree) tree).setIpAddress(plateform + ":" + version);
      ((DefaultMessageTree) tree).setDomain("CrashLogWeb");
      t.complete();
    }
    Thread.sleep(10000);
    // code nullpoint
  }
View Full Code Here

      } catch (Exception e) {
        t.setStatus(Transaction.SUCCESS);
        Cat.logError(e);
        throw e;
      } finally {
        t.complete();
      }
    }
    Thread.sleep(10000);
  }
 
View Full Code Here

    for (int i = 0; i < 100; i++) {
      Transaction t = Cat.getProducer().newTransaction("URL", "Test");

      t.addData("key and value");
      t.setStatus(new NullPointerException());
      t.complete();
    }
    Thread.sleep(10000);
  }

  @Test
View Full Code Here

    } catch (Exception e) {
      Cat.logError(e);
      t.setStatus(e);
      response.setException(e);
    } finally {
      t.complete();
    }
    return response;
  }

  @Override
View Full Code Here

    for (int i = 0; i < 100; i++) {
      Transaction t = Cat.getProducer().newTransaction("Call", "Test");

      t.addData("key and value");
      t.setStatus(new NullPointerException());
      t.complete();

    }
    Thread.sleep(1000);
  }
View Full Code Here

    for (int i = 0; i < 100; i++) {
      Transaction t = Cat.getProducer().newTransaction("SQL", "Test");

      t.addData("key and value");
      t.setStatus(new NullPointerException());
      t.complete();
    }
    Thread.sleep(1000);
  }

  @Test
View Full Code Here

  public void sendMessage() throws Exception {
    for (int i = 0; i < 100; i++) {
      Transaction t = Cat.getProducer().newTransaction("Test", "Test");

      t.addData("key and value");
      t.complete();

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