MCPcopy Create free account
hub / github.com/dianping/cat / test

Method test

cat-home/src/test/java/com/dianping/cat/demo/TestCode.java:94–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92 }
93
94 public void test() throws InterruptedException {
95 Transaction t = Cat.newTransaction("Neocortex", "function1");
96 try {
97 int a = functionA();
98
99 if (a < 0) {
100 Cat.logError(new RuntimeException("sdsf"));
101 }
102
103 MessageTree tree = TraceContextHelper.threadLocal().getMessageTree();
104
105 ((DefaultMessageTree) tree).setDomain("NeoCortex");
106 t.setStatus(Transaction.SUCCESS);
107 } catch (Exception e) {
108
109 Cat.logError(e);
110 t.setStatus(e);
111
112 } finally {
113 t.complete();
114 }
115
116 }
117
118 private int functionA() {
119

Callers 1

test1Method · 0.95

Calls 8

newTransactionMethod · 0.95
functionAMethod · 0.95
logErrorMethod · 0.95
threadLocalMethod · 0.95
completeMethod · 0.95
getMessageTreeMethod · 0.65
setDomainMethod · 0.65
setStatusMethod · 0.65

Tested by

no test coverage detected