提交 f5856043 编写于 作者: F Frankie Wu

add rootMessageId, parentMessageId to message tree

上级 f76b49f6
...@@ -57,6 +57,10 @@ public class Cat { ...@@ -57,6 +57,10 @@ public class Cat {
public static MessageProducer getProducer() { public static MessageProducer getProducer() {
return getInstance().m_producer; return getInstance().m_producer;
} }
public static MessageManager getManager() {
return getInstance().m_manager;
}
// this should be called during application initialization time // this should be called during application initialization time
public static void initialize(File configFile) { public static void initialize(File configFile) {
...@@ -131,8 +135,8 @@ public class Cat { ...@@ -131,8 +135,8 @@ public class Cat {
// this should be called when a thread starts to create some thread local // this should be called when a thread starts to create some thread local
// data // data
public static void setup(String sessionToken, String requestToken) { public static void setup(String sessionToken) {
getInstance().m_manager.setup(sessionToken, requestToken); getInstance().m_manager.setup();
} }
void setContainer(PlexusContainer container) { void setContainer(PlexusContainer container) {
......
...@@ -95,6 +95,11 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan ...@@ -95,6 +95,11 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
return m_serverConfig; return m_serverConfig;
} }
@Override
public MessageTree getThreadLocalMessageTree() {
return getContext().m_tree;
}
@Override @Override
public void initializeClient(Config clientConfig) { public void initializeClient(Config clientConfig) {
if (clientConfig != null) { if (clientConfig != null) {
...@@ -132,8 +137,8 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan ...@@ -132,8 +137,8 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
} }
@Override @Override
public void setup(String sessionToken, String requestToken) { public void setup() {
Context ctx = new Context(m_domain, m_hostName, m_ipAddress, sessionToken, requestToken); Context ctx = new Context(m_domain, m_hostName, m_ipAddress);
m_context.set(ctx); m_context.set(ctx);
} }
...@@ -153,19 +158,16 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan ...@@ -153,19 +158,16 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
private Stack<Transaction> m_stack; private Stack<Transaction> m_stack;
public Context(String domain, String hostName, String ipAddress, String sessionToken, String requestToken) { public Context(String domain, String hostName, String ipAddress) {
m_tree = new DefaultMessageTree(); m_tree = new DefaultMessageTree();
m_stack = new Stack<Transaction>(); m_stack = new Stack<Transaction>();
m_tree.setDomain(domain);
m_tree.setSessionToken(sessionToken);
m_tree.setRequestToken(requestToken);
Thread thread = Thread.currentThread(); Thread thread = Thread.currentThread();
m_tree.setThreadId(Long.toHexString(thread.getId())); m_tree.setThreadId(Long.toHexString(thread.getId()));
m_tree.setThreadId(thread.getName()); m_tree.setThreadId(thread.getName());
m_tree.setDomain(domain);
m_tree.setHostName(hostName); m_tree.setHostName(hostName);
m_tree.setIpAddress(ipAddress); m_tree.setIpAddress(ipAddress);
} }
...@@ -175,7 +177,7 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan ...@@ -175,7 +177,7 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
MessageTree tree = m_tree.copy(); MessageTree tree = m_tree.copy();
tree.setMessage(message); tree.setMessage(message);
tree.setMessageId(UUID.randomUUID().toString()); tree.setMessageId(createMessageId());
manager.flush(tree); manager.flush(tree);
} else { } else {
Transaction entry = m_stack.peek(); Transaction entry = m_stack.peek();
...@@ -184,6 +186,10 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan ...@@ -184,6 +186,10 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
} }
} }
String createMessageId() {
return UUID.randomUUID().toString();
}
public void end(DefaultMessageManager manager, Transaction transaction) { public void end(DefaultMessageManager manager, Transaction transaction) {
if (!m_stack.isEmpty()) { if (!m_stack.isEmpty()) {
Transaction current = m_stack.peek(); Transaction current = m_stack.peek();
...@@ -200,7 +206,6 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan ...@@ -200,7 +206,6 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
MessageTree tree = m_tree.copy(); MessageTree tree = m_tree.copy();
m_tree.setMessage(null); m_tree.setMessage(null);
tree.setMessageId(UUID.randomUUID().toString());
manager.flush(tree); manager.flush(tree);
} }
} }
...@@ -212,6 +217,7 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan ...@@ -212,6 +217,7 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
entry.addChild(transaction); entry.addChild(transaction);
} else { } else {
m_tree.setMessageId(createMessageId());
m_tree.setMessage(transaction); m_tree.setMessage(transaction);
} }
......
...@@ -4,23 +4,80 @@ import com.dianping.cat.configuration.model.entity.Config; ...@@ -4,23 +4,80 @@ import com.dianping.cat.configuration.model.entity.Config;
import com.dianping.cat.message.Message; import com.dianping.cat.message.Message;
import com.dianping.cat.message.Transaction; import com.dianping.cat.message.Transaction;
/**
* Message manager to help build CAT message.
* <p>
*
* Notes: This method is reserved for internal usage only. Application developer
* should never call this method directly.
*/
public interface MessageManager { public interface MessageManager {
public void add(Message message); public void add(Message message);
/**
* Be triggered when a transaction ends, whatever it's the root transaction
* or nested transaction. However, if it's the root transaction then it will
* be flushed to back-end CAT server asynchronously.
* <p>
*
* @param transaction
*/
public void end(Transaction transaction); public void end(Transaction transaction);
/**
* Return configuration for CAT client.
*
* @return CAT configuration
*/
public Config getClientConfig(); public Config getClientConfig();
/**
* Return configuration for CAT client.
*
* @return CAT configuration
*/
public Config getServerConfig(); public Config getServerConfig();
/**
* Initialize CAT client with given CAT configuration.
*
* @param config
* CAT configuration
*/
public void initializeClient(Config config); public void initializeClient(Config config);
/**
* Initialize CAT server with given CAT configuration.
*
* @param config
* CAT configuration
*/
public void initializeServer(Config config); public void initializeServer(Config config);
/**
* Do cleanup for current thread environment in order to release resources in
* thread local objects.
*/
public void reset(); public void reset();
public void setup(String sessionToken, String requestToken); /**
* Do setup for current thread environment in order to prepare thread local
* objects.
*/
public void setup();
/**
* Be triggered when a new transaction starts, whatever it's the root
* transaction or nested transaction.
*
* @param transaction
*/
public void start(Transaction transaction); public void start(Transaction transaction);
/**
* Get thread local message information.
*
* @return message tree
*/
public MessageTree getThreadLocalMessageTree();
} }
\ No newline at end of file
...@@ -15,7 +15,9 @@ public interface MessageTree extends Cloneable { ...@@ -15,7 +15,9 @@ public interface MessageTree extends Cloneable {
public String getMessageId(); public String getMessageId();
public String getRequestToken(); public String getParentMessageId();
public String getRootMessageId();
public String getSessionToken(); public String getSessionToken();
...@@ -33,7 +35,9 @@ public interface MessageTree extends Cloneable { ...@@ -33,7 +35,9 @@ public interface MessageTree extends Cloneable {
public void setMessageId(String messageId); public void setMessageId(String messageId);
public void setRequestToken(String requestToken); public void setParentMessageId(String parentMessageId);
public void setRootMessageId(String rootMessageId);
public void setSessionToken(String sessionToken); public void setSessionToken(String sessionToken);
......
...@@ -20,7 +20,8 @@ import com.dianping.cat.message.spi.StringRope; ...@@ -20,7 +20,8 @@ import com.dianping.cat.message.spi.StringRope;
import com.site.lookup.annotation.Inject; import com.site.lookup.annotation.Inject;
/** /**
* Local use only, do not use it over network since it only supports one-way encoding * Local use only, do not use it over network since it only supports one-way
* encoding
*/ */
public class HtmlMessageCodec implements MessageCodec { public class HtmlMessageCodec implements MessageCodec {
private static final String ID = "HT1"; // HTML version 1 private static final String ID = "HT1"; // HTML version 1
...@@ -28,6 +29,9 @@ public class HtmlMessageCodec implements MessageCodec { ...@@ -28,6 +29,9 @@ public class HtmlMessageCodec implements MessageCodec {
@Inject @Inject
private BufferWriter m_writer; private BufferWriter m_writer;
@Inject
private String m_logViewPrefix;
private BufferHelper m_bufferHelper = new BufferHelper(m_writer); private BufferHelper m_bufferHelper = new BufferHelper(m_writer);
private DateHelper m_dateHelper = new DateHelper(); private DateHelper m_dateHelper = new DateHelper();
...@@ -69,7 +73,8 @@ public class HtmlMessageCodec implements MessageCodec { ...@@ -69,7 +73,8 @@ public class HtmlMessageCodec implements MessageCodec {
count += helper.td(buf, tree.getThreadId()); count += helper.td(buf, tree.getThreadId());
count += helper.td(buf, tree.getThreadName()); count += helper.td(buf, tree.getThreadName());
count += helper.td(buf, tree.getMessageId()); count += helper.td(buf, tree.getMessageId());
count += helper.td(buf, tree.getRequestToken()); count += helper.td(buf, tree.getParentMessageId());
count += helper.td(buf, tree.getRootMessageId());
count += helper.td(buf, tree.getSessionToken()); count += helper.td(buf, tree.getSessionToken());
count += helper.tr2(buf); count += helper.tr2(buf);
count += helper.crlf(buf); count += helper.crlf(buf);
...@@ -111,7 +116,7 @@ public class HtmlMessageCodec implements MessageCodec { ...@@ -111,7 +116,7 @@ public class HtmlMessageCodec implements MessageCodec {
if (Message.SUCCESS.equals(message.getStatus())) { if (Message.SUCCESS.equals(message.getStatus())) {
count += helper.td(buf, message.getStatus()); count += helper.td(buf, message.getStatus());
} else { } else {
count += helper.td(buf, message.getStatus(), "error"); count += helper.td(buf, message.getStatus(), "class=\"error\"");
} }
Object data = message.getData(); Object data = message.getData();
...@@ -145,9 +150,42 @@ public class HtmlMessageCodec implements MessageCodec { ...@@ -145,9 +150,42 @@ public class HtmlMessageCodec implements MessageCodec {
return count; return count;
} }
protected int encodeLogViewLink(Message message, ChannelBuffer buf, int level, LineCounter counter) {
BufferHelper helper = m_bufferHelper;
int count = 0;
if (counter != null) {
counter.inc();
count += helper.tr1(buf, counter.getCount() % 2 != 0 ? "odd" : "even");
} else {
count += helper.tr1(buf, null);
}
count += helper.td1(buf, "colspan=\"5\"");
count += helper.nbsp(buf, level * 2); // 2 spaces per level
count += helper.write(buf, "<a href=\"");
count += helper.write(buf, m_logViewPrefix);
count += helper.write(buf, message.getData().toString());
count += helper.write(buf, "\">[:: show ::]</a>");
count += helper.td2(buf);
count += helper.tr2(buf);
count += helper.crlf(buf);
return count;
}
public int encodeMessage(Message message, ChannelBuffer buf, int level, LineCounter counter) { public int encodeMessage(Message message, ChannelBuffer buf, int level, LineCounter counter) {
if (message instanceof Event) { if (message instanceof Event) {
return encodeLine(message, buf, 'E', Policy.DEFAULT, level, counter); String type = message.getType();
if ("RemoteCall".equals(type)) {
return encodeLogViewLink(message, buf, level, counter);
} else {
return encodeLine(message, buf, 'E', Policy.DEFAULT, level, counter);
}
} else if (message instanceof Transaction) { } else if (message instanceof Transaction) {
Transaction transaction = (Transaction) message; Transaction transaction = (Transaction) message;
List<Message> children = transaction.getChildren(); List<Message> children = transaction.getChildren();
...@@ -183,6 +221,10 @@ public class HtmlMessageCodec implements MessageCodec { ...@@ -183,6 +221,10 @@ public class HtmlMessageCodec implements MessageCodec {
m_bufferHelper = new BufferHelper(m_writer); m_bufferHelper = new BufferHelper(m_writer);
} }
public void setLogViewPrefix(String logViewPrefix) {
m_logViewPrefix = logViewPrefix;
}
protected static class BufferHelper { protected static class BufferHelper {
private static byte[] TABLE1 = "<table class=\"logview\">".getBytes(); private static byte[] TABLE1 = "<table class=\"logview\">".getBytes();
...@@ -233,7 +275,7 @@ public class HtmlMessageCodec implements MessageCodec { ...@@ -233,7 +275,7 @@ public class HtmlMessageCodec implements MessageCodec {
return td(buf, str, null); return td(buf, str, null);
} }
public int td(ChannelBuffer buf, String str, String styleClass) { public int td(ChannelBuffer buf, String str, String attributes) {
if (str == null) { if (str == null) {
str = "null"; str = "null";
} }
...@@ -241,11 +283,11 @@ public class HtmlMessageCodec implements MessageCodec { ...@@ -241,11 +283,11 @@ public class HtmlMessageCodec implements MessageCodec {
byte[] data = str.getBytes(); byte[] data = str.getBytes();
int count = 0; int count = 0;
if (styleClass == null) { if (attributes == null) {
buf.writeBytes(TD1); buf.writeBytes(TD1);
count += TD1.length; count += TD1.length;
} else { } else {
String tag = "<td class=\"" + styleClass + "\">"; String tag = "<td " + attributes + ">";
byte[] bytes = tag.getBytes(); byte[] bytes = tag.getBytes();
buf.writeBytes(bytes); buf.writeBytes(bytes);
...@@ -266,6 +308,19 @@ public class HtmlMessageCodec implements MessageCodec { ...@@ -266,6 +308,19 @@ public class HtmlMessageCodec implements MessageCodec {
return TD1.length; return TD1.length;
} }
public int td1(ChannelBuffer buf, String attributes) {
if (attributes == null) {
buf.writeBytes(TD1);
return TD1.length;
} else {
String tag = "<td " + attributes + ">";
byte[] bytes = tag.getBytes();
buf.writeBytes(bytes);
return bytes.length;
}
}
public int td2(ChannelBuffer buf) { public int td2(ChannelBuffer buf) {
buf.writeBytes(TD2); buf.writeBytes(TD2);
return TD2.length; return TD2.length;
......
...@@ -55,7 +55,8 @@ public class PlainTextMessageCodec implements MessageCodec { ...@@ -55,7 +55,8 @@ public class PlainTextMessageCodec implements MessageCodec {
String threadId = helper.read(buf, TAB); String threadId = helper.read(buf, TAB);
String threadName = helper.read(buf, TAB); String threadName = helper.read(buf, TAB);
String messageId = helper.read(buf, TAB); String messageId = helper.read(buf, TAB);
String requestToken = helper.read(buf, TAB); String parentMessageId = helper.read(buf, TAB);
String rootMessageId = helper.read(buf, TAB);
String sessionToken = helper.read(buf, LF); String sessionToken = helper.read(buf, LF);
if (ID.equals(id)) { if (ID.equals(id)) {
...@@ -65,7 +66,8 @@ public class PlainTextMessageCodec implements MessageCodec { ...@@ -65,7 +66,8 @@ public class PlainTextMessageCodec implements MessageCodec {
tree.setThreadId(threadId); tree.setThreadId(threadId);
tree.setThreadName(threadName); tree.setThreadName(threadName);
tree.setMessageId(messageId); tree.setMessageId(messageId);
tree.setRequestToken(requestToken); tree.setParentMessageId(parentMessageId);
tree.setRootMessageId(rootMessageId);
tree.setSessionToken(sessionToken); tree.setSessionToken(sessionToken);
} else { } else {
throw new RuntimeException(String.format("Unrecognized id(%s) for plain text message codec!", id)); throw new RuntimeException(String.format("Unrecognized id(%s) for plain text message codec!", id));
...@@ -214,7 +216,9 @@ public class PlainTextMessageCodec implements MessageCodec { ...@@ -214,7 +216,9 @@ public class PlainTextMessageCodec implements MessageCodec {
count += helper.write(buf, TAB); count += helper.write(buf, TAB);
count += helper.write(buf, tree.getMessageId()); count += helper.write(buf, tree.getMessageId());
count += helper.write(buf, TAB); count += helper.write(buf, TAB);
count += helper.write(buf, tree.getRequestToken()); count += helper.write(buf, tree.getParentMessageId());
count += helper.write(buf, TAB);
count += helper.write(buf, tree.getRootMessageId());
count += helper.write(buf, TAB); count += helper.write(buf, TAB);
count += helper.write(buf, tree.getSessionToken()); count += helper.write(buf, tree.getSessionToken());
count += helper.write(buf, LF); count += helper.write(buf, LF);
......
...@@ -18,7 +18,9 @@ public class DefaultMessageTree implements MessageTree { ...@@ -18,7 +18,9 @@ public class DefaultMessageTree implements MessageTree {
private String m_messageId; private String m_messageId;
private String m_requestToken; private String m_parentMessageId;
private String m_rootMessageId;
private String m_sessionToken; private String m_sessionToken;
...@@ -31,20 +33,41 @@ public class DefaultMessageTree implements MessageTree { ...@@ -31,20 +33,41 @@ public class DefaultMessageTree implements MessageTree {
@Override @Override
public DefaultMessageTree copy() { public DefaultMessageTree copy() {
DefaultMessageTree tree = new DefaultMessageTree(); DefaultMessageTree tree = new DefaultMessageTree();
tree.setDomain(m_domain); tree.setDomain(m_domain);
tree.setHostName(m_hostName); tree.setHostName(m_hostName);
tree.setIpAddress(m_ipAddress); tree.setIpAddress(m_ipAddress);
tree.setMessageId(m_messageId); tree.setMessageId(m_messageId);
tree.setRequestToken(m_requestToken); tree.setParentMessageId(m_parentMessageId);
tree.setRootMessageId(m_rootMessageId);
tree.setSessionToken(m_sessionToken); tree.setSessionToken(m_sessionToken);
tree.setThreadId(m_threadId); tree.setThreadId(m_threadId);
tree.setThreadName(m_threadName); tree.setThreadName(m_threadName);
tree.setMessage(m_message); tree.setMessage(m_message);
return tree; return tree;
} }
@Override
public String getParentMessageId() {
return m_parentMessageId;
}
@Override
public void setParentMessageId(String parentMessageId) {
m_parentMessageId = parentMessageId;
}
@Override
public String getRootMessageId() {
return m_rootMessageId;
}
@Override
public void setRootMessageId(String rootMessageId) {
m_rootMessageId = rootMessageId;
}
@Override @Override
public String getDomain() { public String getDomain() {
return m_domain; return m_domain;
...@@ -70,11 +93,6 @@ public class DefaultMessageTree implements MessageTree { ...@@ -70,11 +93,6 @@ public class DefaultMessageTree implements MessageTree {
return m_messageId; return m_messageId;
} }
@Override
public String getRequestToken() {
return m_requestToken;
}
@Override @Override
public String getSessionToken() { public String getSessionToken() {
return m_sessionToken; return m_sessionToken;
...@@ -114,11 +132,6 @@ public class DefaultMessageTree implements MessageTree { ...@@ -114,11 +132,6 @@ public class DefaultMessageTree implements MessageTree {
m_messageId = messageId; m_messageId = messageId;
} }
@Override
public void setRequestToken(String requestToken) {
m_requestToken = requestToken;
}
@Override @Override
public void setSessionToken(String sessionToken) { public void setSessionToken(String sessionToken) {
m_sessionToken = sessionToken; m_sessionToken = sessionToken;
......
...@@ -10,7 +10,7 @@ public abstract class CatTestCase extends ComponentTestCase { ...@@ -10,7 +10,7 @@ public abstract class CatTestCase extends ComponentTestCase {
@Before @Before
public void before() throws Exception { public void before() throws Exception {
Cat.initialize(getContainer(), null); Cat.initialize(getContainer(), null);
Cat.setup(null, null); Cat.setup(null);
} }
@After @After
......
...@@ -25,6 +25,7 @@ public class HtmlMessageCodecTest { ...@@ -25,6 +25,7 @@ public class HtmlMessageCodecTest {
ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
codec.setBufferWriter(new HtmlEncodingBufferWriter()); codec.setBufferWriter(new HtmlEncodingBufferWriter());
codec.setLogViewPrefix("/cat/m/");
codec.encodeMessage(message, buf, 0, null); codec.encodeMessage(message, buf, 0, null);
String actual = buf.toString(Charset.forName("utf-8")); String actual = buf.toString(Charset.forName("utf-8"));
...@@ -68,7 +69,8 @@ public class HtmlMessageCodecTest { ...@@ -68,7 +69,8 @@ public class HtmlMessageCodecTest {
tree.setHostName("hostName"); tree.setHostName("hostName");
tree.setIpAddress("ipAddress"); tree.setIpAddress("ipAddress");
tree.setMessageId("messageId"); tree.setMessageId("messageId");
tree.setRequestToken("requestToken"); tree.setParentMessageId("parentMessageId");
tree.setRootMessageId("rootMessageId");
tree.setSessionToken("sessionToken"); tree.setSessionToken("sessionToken");
tree.setThreadId("threadId"); tree.setThreadId("threadId");
tree.setThreadName("threadName"); tree.setThreadName("threadName");
...@@ -164,6 +166,35 @@ public class HtmlMessageCodecTest { ...@@ -164,6 +166,35 @@ public class HtmlMessageCodecTest {
+ "<tr><td>T15:33:42.087</td><td>URL</td><td>Review</td><td>0</td><td>100ms /review/2468</td></tr>\r\n"); + "<tr><td>T15:33:42.087</td><td>URL</td><td>Review</td><td>0</td><td>100ms /review/2468</td></tr>\r\n");
} }
@Test
public void testTransactionWithRemoteCall() {
long timestamp = 1325489621987L;
Transaction root = newTransaction("URL", "Review", timestamp, "0", 100, "/review/2468");
root.addChild(newEvent("URL", "Payload", timestamp, "0", "ip=127.0.0.1&ua=Mozilla 5.0...&refer=...&..."));
root.addChild(newTransaction("Service", "Auth", timestamp, "0", 20, "userId=1357&token=..."));
root.addChild(newTransaction("Cache", "findReviewByPK", timestamp + 22, "Missing", 1, "2468") //
.addChild(newEvent("CacheHost", "host-1", timestamp + 22, "0", "ip=192.168.8.123")));
root.addChild(newEvent("Service", "ReviewService", timestamp + 23, "0", "message_id"));
root.addChild(newEvent("RemoteCall", "Pigeon", timestamp + 23, "0", "message_id"));
root.addChild(newTransaction("DAL", "findReviewByPK", timestamp + 25, "0", 5,
"select title,content from Review where id = ?"));
root.addChild(newEvent("URL", "View", timestamp + 40, "0", "view=HTML"));
check(root,
"<tr><td>t15:33:41.987</td><td>URL</td><td>Review</td><td></td><td></td></tr>\r\n"
+ "<tr><td>&nbsp;&nbsp;E15:33:41.987</td><td>URL</td><td>Payload</td><td>0</td><td>ip=127.0.0.1&amp;ua=Mozilla 5.0...&amp;refer=...&amp;...</td></tr>\r\n"
+ "<tr><td>&nbsp;&nbsp;A15:33:41.987</td><td>Service</td><td>Auth</td><td>0</td><td>20ms userId=1357&amp;token=...</td></tr>\r\n"
+ "<tr><td>&nbsp;&nbsp;t15:33:42.009</td><td>Cache</td><td>findReviewByPK</td><td></td><td></td></tr>\r\n"
+ "<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;E15:33:42.009</td><td>CacheHost</td><td>host-1</td><td>0</td><td>ip=192.168.8.123</td></tr>\r\n"
+ "<tr><td>&nbsp;&nbsp;T15:33:42.010</td><td>Cache</td><td>findReviewByPK</td><td class=\"error\">Missing</td><td>1ms 2468</td></tr>\r\n"
+ "<tr><td>&nbsp;&nbsp;E15:33:42.010</td><td>Service</td><td>ReviewService</td><td>0</td><td>message_id</td></tr>\r\n"
+ "<tr><td colspan=\"5\">&nbsp;&nbsp;<a href=\"/cat/m/message_id\">[:: show ::]</a></td></tr>\r\n" //
+ "<tr><td>&nbsp;&nbsp;A15:33:42.012</td><td>DAL</td><td>findReviewByPK</td><td>0</td><td>5ms select title,content from Review where id = ?</td></tr>\r\n"
+ "<tr><td>&nbsp;&nbsp;E15:33:42.027</td><td>URL</td><td>View</td><td>0</td><td>view=HTML</td></tr>\r\n"
+ "<tr><td>T15:33:42.087</td><td>URL</td><td>Review</td><td>0</td><td>100ms /review/2468</td></tr>\r\n");
}
@Test @Test
public void testTransactionSimple() { public void testTransactionSimple() {
long timestamp = 1325489621987L; long timestamp = 1325489621987L;
......
...@@ -78,7 +78,8 @@ public class PlainTextMessageCodecTest { ...@@ -78,7 +78,8 @@ public class PlainTextMessageCodecTest {
tree.setHostName("hostName"); tree.setHostName("hostName");
tree.setIpAddress("ipAddress"); tree.setIpAddress("ipAddress");
tree.setMessageId("messageId"); tree.setMessageId("messageId");
tree.setRequestToken("requestToken"); tree.setParentMessageId("parentMessageId");
tree.setRootMessageId("rootMessageId");
tree.setSessionToken("sessionToken"); tree.setSessionToken("sessionToken");
tree.setThreadId("threadId"); tree.setThreadId("threadId");
tree.setThreadName("threadName"); tree.setThreadName("threadName");
...@@ -128,7 +129,7 @@ public class PlainTextMessageCodecTest { ...@@ -128,7 +129,7 @@ public class PlainTextMessageCodecTest {
public void testMessageTree() { public void testMessageTree() {
DefaultMessageTree tree = newMessageTree(); DefaultMessageTree tree = newMessageTree();
long timestamp = 1325489621987L; long timestamp = 1325489621987L;
String expected = "PT1\tdomain\thostName\tipAddress\tthreadId\tthreadName\tmessageId\trequestToken\tsessionToken\n"; String expected = "PT1\tdomain\thostName\tipAddress\tthreadId\tthreadName\tmessageId\tparentMessageId\trootMessageId\tsessionToken\n";
checkTree(tree, expected); checkTree(tree, expected);
......
...@@ -20,7 +20,8 @@ public class BucketTest extends ComponentTestCase { ...@@ -20,7 +20,8 @@ public class BucketTest extends ComponentTestCase {
tree.setHostName("hostName"); tree.setHostName("hostName");
tree.setIpAddress("ipAddress"); tree.setIpAddress("ipAddress");
tree.setMessageId(id); tree.setMessageId(id);
tree.setRequestToken("requestToken"); tree.setParentMessageId("parentMessageId");
tree.setRootMessageId("rootMessageId");
tree.setSessionToken("sessionToken"); tree.setSessionToken("sessionToken");
tree.setThreadId("threadId"); tree.setThreadId("threadId");
tree.setThreadName("threadName"); tree.setThreadName("threadName");
......
package com.dianping.cat.report.page.failure;
import com.dianping.cat.consumer.failure.model.entity.Entry;
import com.dianping.cat.consumer.failure.model.entity.FailureReport;
import com.dianping.cat.consumer.failure.model.entity.Threads;
import com.dianping.cat.consumer.failure.model.transform.DefaultMerger;
public class FailureReportMerger extends DefaultMerger {
public FailureReportMerger(FailureReport failureReport) {
super(failureReport);
}
@Override
protected void mergeEntry(Entry old, Entry entry) {
// TODO Auto-generated method stub
super.mergeEntry(old, entry);
}
@Override
protected void mergeThreads(Threads old, Threads threads) {
old.getThreads().addAll(threads.getThreads());
}
}
package com.dianping.cat.report.page.transaction;
import java.util.List;
import com.dianping.cat.consumer.transaction.model.entity.TransactionName;
import com.dianping.cat.consumer.transaction.model.entity.TransactionReport;
import com.dianping.cat.consumer.transaction.model.entity.TransactionType;
import com.dianping.cat.consumer.transaction.model.transform.DefaultMerger;
public class TransactionReportMerger extends DefaultMerger {
public TransactionReportMerger(TransactionReport transactionReport) {
super(transactionReport);
}
public TransactionReport mergesFrom(TransactionReport report) {
report.accept(this);
return getTransactionReport();
}
public static TransactionReport merges(List<TransactionReport> reports) {
TransactionReportMerger merger = new TransactionReportMerger(new TransactionReport(""));
for (TransactionReport report : reports) {
report.accept(merger);
}
return merger.getTransactionReport();
}
@Override
protected void mergeName(TransactionName old, TransactionName other) {
old.setTotalCount(old.getTotalCount() + other.getTotalCount());
old.setFailCount(old.getFailCount() + other.getFailCount());
if (other.getMin() < old.getMin()) {
old.setMin(other.getMin());
}
if (other.getMax() > old.getMax()) {
old.setMax(other.getMax());
}
old.setSum(old.getSum() + other.getSum());
old.setSum2(old.getSum2() + other.getSum2());
if (old.getTotalCount() > 0) {
old.setFailPercent(old.getFailCount() * 100.0 / old.getTotalCount());
old.setAvg(old.getSum() / old.getTotalCount());
old.setStd(std(old.getTotalCount(), old.getAvg(), old.getSum2()));
}
}
@Override
protected void mergeType(TransactionType old, TransactionType other) {
old.setTotalCount(old.getTotalCount() + other.getTotalCount());
old.setFailCount(old.getFailCount() + other.getFailCount());
if (other.getMin() < old.getMin()) {
old.setMin(other.getMin());
}
if (other.getMax() > old.getMax()) {
old.setMax(other.getMax());
}
old.setSum(old.getSum() + other.getSum());
old.setSum2(old.getSum2() + other.getSum2());
if (old.getTotalCount() > 0) {
old.setFailPercent(old.getFailCount() * 100.0 / old.getTotalCount());
old.setAvg(old.getSum() / old.getTotalCount());
old.setStd(std(old.getTotalCount(), old.getAvg(), old.getSum2()));
}
}
protected double std(long count, double ave, double sum2) {
return Math.sqrt(sum2 / count - 2 * ave * ave + ave * ave);
}
}
...@@ -52,27 +52,26 @@ public class ReportUtils { ...@@ -52,27 +52,26 @@ public class ReportUtils {
public static void mergeTransactionReport(TransactionReport targetReport, TransactionReport mergeReport) { public static void mergeTransactionReport(TransactionReport targetReport, TransactionReport mergeReport) {
mergeReport.accept(new com.dianping.cat.consumer.transaction.model.transform.DefaultMerger(targetReport) { mergeReport.accept(new com.dianping.cat.consumer.transaction.model.transform.DefaultMerger(targetReport) {
private double std(long count, double ave, double sum2) { private double std(long count, double ave, double sum2) {
return Math.sqrt(sum2 / count - 2 * ave * ave + ave * ave); return Math.sqrt(sum2 / count - 2 * ave * ave + ave * ave);
} }
@Override @Override
protected void mergeName(TransactionName old, TransactionName name) { protected void mergeName(TransactionName old, TransactionName name) {
if(old.getId()==null){ if (old.getId() == null) {
System.out.println("TransactionName old is null"); System.out.println("TransactionName old is null");
old = name; old = name;
} } else if (name.getId() == null) {
else if(name.getId()==null){
System.out.println("TransactionName new is null"); System.out.println("TransactionName new is null");
return; return;
} }
// TODO Auto-generated method stub // TODO Auto-generated method stub
//super.mergeName(old, name); // super.mergeName(old, name);
old.setTotalCount(old.getTotalCount() + name.getTotalCount()); old.setTotalCount(old.getTotalCount() + name.getTotalCount());
old.setFailCount(old.getFailCount() + name.getFailCount()); old.setFailCount(old.getFailCount() + name.getFailCount());
old.setFailPercent(old.getFailCount()* 100.0 / old.getTotalCount()); old.setFailPercent(old.getFailCount() * 100.0 / old.getTotalCount());
double min = name.getMin(); double min = name.getMin();
if (min < old.getMin()) { if (min < old.getMin()) {
old.setMin(min); old.setMin(min);
...@@ -83,11 +82,11 @@ public class ReportUtils { ...@@ -83,11 +82,11 @@ public class ReportUtils {
old.setMax(max); old.setMax(max);
} }
old.setSum(old.getSum()+name.getSum()); old.setSum(old.getSum() + name.getSum());
old.setAvg((double)old.getSum()/(double)old.getTotalCount()); old.setAvg((double) old.getSum() / (double) old.getTotalCount());
old.setSum2(old.getSum2()+name.getSum2()); old.setSum2(old.getSum2() + name.getSum2());
double std = std(old.getTotalCount(), old.getAvg(), old.getSum2()); double std = std(old.getTotalCount(), old.getAvg(), old.getSum2());
old.setStd(std); old.setStd(std);
} }
...@@ -96,26 +95,24 @@ public class ReportUtils { ...@@ -96,26 +95,24 @@ public class ReportUtils {
protected void mergeTransactionReport(TransactionReport old, TransactionReport transactionReport) { protected void mergeTransactionReport(TransactionReport old, TransactionReport transactionReport) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
super.mergeTransactionReport(old, transactionReport); super.mergeTransactionReport(old, transactionReport);
} }
@Override @Override
protected void mergeType(TransactionType old, TransactionType name) { protected void mergeType(TransactionType old, TransactionType name) {
if(old.getId()==null){ if (old.getId() == null) {
System.out.println("TransactionType old is null"); System.out.println("TransactionType old is null");
old = name; old = name;
} } else if (name.getId() == null) {
else if(name.getId()==null){
System.out.println("TransactionType new is null"); System.out.println("TransactionType new is null");
return; return;
} }
// TODO Auto-generated method stub // TODO Auto-generated method stub
//super.mergeType(old, type); // super.mergeType(old, type);
old.setTotalCount(old.getTotalCount() + name.getTotalCount()); old.setTotalCount(old.getTotalCount() + name.getTotalCount());
old.setFailCount(old.getFailCount() + name.getFailCount()); old.setFailCount(old.getFailCount() + name.getFailCount());
old.setFailPercent( old.getFailCount()* 100.0 / old.getTotalCount()); old.setFailPercent(old.getFailCount() * 100.0 / old.getTotalCount());
double min = name.getMin(); double min = name.getMin();
if (min < old.getMin()) { if (min < old.getMin()) {
old.setMin(min); old.setMin(min);
...@@ -126,11 +123,11 @@ public class ReportUtils { ...@@ -126,11 +123,11 @@ public class ReportUtils {
old.setMax(max); old.setMax(max);
} }
old.setSum(old.getSum()+name.getSum()); old.setSum(old.getSum() + name.getSum());
old.setAvg((double)old.getSum()/(double)old.getTotalCount()); old.setAvg((double) old.getSum() / (double) old.getTotalCount());
old.setSum2(old.getSum2()+name.getSum2()); old.setSum2(old.getSum2() + name.getSum2());
double std = std(old.getTotalCount(), old.getAvg(), old.getSum2()); double std = std(old.getTotalCount(), old.getAvg(), old.getSum2());
old.setStd(std); old.setStd(std);
} }
......
...@@ -5,9 +5,9 @@ import org.junit.runners.Suite; ...@@ -5,9 +5,9 @@ import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses; import org.junit.runners.Suite.SuiteClasses;
import com.dianping.cat.report.page.ip.DisplayModelTest; import com.dianping.cat.report.page.ip.DisplayModelTest;
import com.dianping.cat.report.page.transaction.TransactionReportMergerTest;
import com.dianping.cat.report.tool.FailureReportToolTest; import com.dianping.cat.report.tool.FailureReportToolTest;
import com.dianping.cat.report.tool.IpReportToolTest; import com.dianping.cat.report.tool.IpReportToolTest;
import com.dianping.cat.report.tool.TransactionReportToolTest;
@RunWith(Suite.class) @RunWith(Suite.class)
@SuiteClasses({ @SuiteClasses({
...@@ -20,7 +20,7 @@ FailureReportToolTest.class, ...@@ -20,7 +20,7 @@ FailureReportToolTest.class,
IpReportToolTest.class, IpReportToolTest.class,
TransactionReportToolTest.class TransactionReportMergerTest.class
}) })
public class AllTests { public class AllTests {
......
...@@ -27,7 +27,7 @@ public class Demo extends ComponentTestCase { ...@@ -27,7 +27,7 @@ public class Demo extends ComponentTestCase {
Cat.initialize(getContainer(), configFile); Cat.initialize(getContainer(), configFile);
} }
Cat.setup(null, null); Cat.setup(null);
} }
@After @After
......
package com.dianping.cat.report.tool; package com.dianping.cat.report.page.transaction;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
...@@ -7,19 +7,23 @@ import org.unidal.webres.helper.Files; ...@@ -7,19 +7,23 @@ import org.unidal.webres.helper.Files;
import com.dianping.cat.consumer.transaction.model.entity.TransactionReport; import com.dianping.cat.consumer.transaction.model.entity.TransactionReport;
import com.dianping.cat.consumer.transaction.model.transform.DefaultXmlBuilder; import com.dianping.cat.consumer.transaction.model.transform.DefaultXmlBuilder;
import com.dianping.cat.consumer.transaction.model.transform.DefaultXmlParser; import com.dianping.cat.consumer.transaction.model.transform.DefaultXmlParser;
import com.dianping.cat.report.page.transaction.TransactionReportMerger;
public class TransactionReportToolTest { public class TransactionReportMergerTest {
@Test @Test
public void testTransactionReportMerge() throws Exception{ public void testTransactionReportMerge() throws Exception {
String oldXml = Files.forIO().readFrom(TransactionReportToolTest.class.getResourceAsStream("TransactionReportOld.xml"),"utf-8"); String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("TransactionReportOld.xml"), "utf-8");
String newXml = Files.forIO().readFrom(TransactionReportToolTest.class.getResourceAsStream("TransactionReportNew.xml"),"utf-8"); String newXml = Files.forIO().readFrom(getClass().getResourceAsStream("TransactionReportNew.xml"), "utf-8");
TransactionReport reportOld = new DefaultXmlParser().parse(oldXml); TransactionReport reportOld = new DefaultXmlParser().parse(oldXml);
TransactionReport reportNew = new DefaultXmlParser().parse(newXml); TransactionReport reportNew = new DefaultXmlParser().parse(newXml);
String result = Files.forIO().readFrom(TransactionReportToolTest.class.getResourceAsStream("TransactionReportMergeResult.xml"),"utf-8"); String expected = Files.forIO().readFrom(getClass().getResourceAsStream("TransactionReportMergeResult.xml"),
"utf-8");
ReportUtils.mergeTransactionReport(reportOld, reportNew); TransactionReportMerger merger = new TransactionReportMerger(reportOld);
Assert.assertEquals("Chech the merage result!",result,new DefaultXmlBuilder().buildXml(reportOld));
merger.mergesFrom(reportNew);
String actual = new DefaultXmlBuilder().buildXml(reportOld);
Assert.assertEquals("Check the merge result!", expected.replace("\r", ""), actual.replace("\r", ""));
} }
} }
...@@ -9,17 +9,18 @@ import com.dianping.cat.consumer.failure.model.transform.DefaultXmlBuilder; ...@@ -9,17 +9,18 @@ import com.dianping.cat.consumer.failure.model.transform.DefaultXmlBuilder;
import com.dianping.cat.consumer.failure.model.transform.DefaultXmlParser; import com.dianping.cat.consumer.failure.model.transform.DefaultXmlParser;
public class FailureReportToolTest { public class FailureReportToolTest {
@Test @Test
public void testFailureReportMerge() throws Exception{ public void testFailureReportMerge() throws Exception {
String oldXml = Files.forIO().readFrom(FailureReportToolTest.class.getResourceAsStream("FailureReportOld.xml"),"utf-8"); String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("FailureReportOld.xml"), "utf-8");
String newXml = Files.forIO().readFrom(FailureReportToolTest.class.getResourceAsStream("FailureReportNew.xml"),"utf-8"); String newXml = Files.forIO().readFrom(getClass().getResourceAsStream("FailureReportNew.xml"), "utf-8");
FailureReport reportOld = new DefaultXmlParser().parse(oldXml); FailureReport reportOld = new DefaultXmlParser().parse(oldXml);
FailureReport reportNew = new DefaultXmlParser().parse(newXml); FailureReport reportNew = new DefaultXmlParser().parse(newXml);
String result = Files.forIO().readFrom(FailureReportToolTest.class.getResourceAsStream("FailureReportMergeResult.xml"),"utf-8"); String expected = Files.forIO().readFrom(getClass().getResourceAsStream("FailureReportMergeResult.xml"), "utf-8");
ReportUtils.mergeFailureReport(reportOld, reportNew); ReportUtils.mergeFailureReport(reportOld, reportNew);
Assert.assertEquals("Chech the merage result!",result,new DefaultXmlBuilder().buildXml(reportOld));
String actual = new DefaultXmlBuilder().buildXml(reportOld);
Assert.assertEquals("Chech the merage result!", expected.replace("\r", ""), actual.replace("\r", ""));
} }
} }
...@@ -9,17 +9,18 @@ import com.dianping.cat.consumer.ip.model.transform.DefaultXmlParser; ...@@ -9,17 +9,18 @@ import com.dianping.cat.consumer.ip.model.transform.DefaultXmlParser;
import com.dianping.cat.consumer.ip.model.entity.IpReport; import com.dianping.cat.consumer.ip.model.entity.IpReport;
public class IpReportToolTest { public class IpReportToolTest {
@Test @Test
public void testIpReportMerge() throws Exception{ public void testIpReportMerge() throws Exception {
String oldXml = Files.forIO().readFrom(IpReportToolTest.class.getResourceAsStream("IpReportOld.xml"),"utf-8"); String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("IpReportOld.xml"), "utf-8");
String newXml = Files.forIO().readFrom(IpReportToolTest.class.getResourceAsStream("IpReportNew.xml"),"utf-8"); String newXml = Files.forIO().readFrom(getClass().getResourceAsStream("IpReportNew.xml"), "utf-8");
IpReport reportOld = new DefaultXmlParser().parse(oldXml); IpReport reportOld = new DefaultXmlParser().parse(oldXml);
IpReport reportNew = new DefaultXmlParser().parse(newXml); IpReport reportNew = new DefaultXmlParser().parse(newXml);
String result = Files.forIO().readFrom(IpReportToolTest.class.getResourceAsStream("IpReportMergeResult.xml"),"utf-8"); String expected = Files.forIO().readFrom(getClass().getResourceAsStream("IpReportMergeResult.xml"), "utf-8");
ReportUtils.mergeIpReport(reportOld, reportNew); ReportUtils.mergeIpReport(reportOld, reportNew);
Assert.assertEquals("Chech the merage result!",result,new DefaultXmlBuilder().buildXml(reportOld));
String actual = new DefaultXmlBuilder().buildXml(reportOld);
Assert.assertEquals("Chech the merage result!", expected.replace("\r", ""), actual.replace("\r", ""));
} }
} }
<transaction-report domain="Cat" startTime="2012-02-16 23:00:00" endTime="2012-02-16 23:59:00"> <transaction-report domain="Cat" startTime="2012-02-16 23:00:00" endTime="2012-02-16 23:59:00">
<domain>Cat</domain> <domain>Cat</domain>
<type id="URL" totalCount="22" failCount="11" failPercent="50.00" min="0.0" max="194.0" avg="47.1" sum="1036.0" sum2="147884.0" std="67.1"> <type id="URL" totalCount="22" failCount="4" failPercent="18.18" min="0.0" max="194.0" avg="47.1" sum="1036.0" sum2="147884.0" std="67.1">
<name id="home" totalCount="2" failCount="0" failPercent="0.00" min="175.0" max="175.0" avg="175.0" sum="350.0" sum2="61250.0" std="0.0"> <name id="home" totalCount="2" failCount="0" failPercent="0.00" min="175.0" max="175.0" avg="175.0" sum="350.0" sum2="61250.0" std="0.0">
</name> </name>
<name id="service" totalCount="16" failCount="4" failPercent="25.00" min="1.0" max="58.0" avg="13.0" sum="208.0" sum2="7904.0" std="18.0"> <name id="service" totalCount="16" failCount="4" failPercent="25.00" min="1.0" max="58.0" avg="13.0" sum="208.0" sum2="7904.0" std="18.0">
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<name id="ip" totalCount="2" failCount="0" failPercent="0.00" min="46.0" max="46.0" avg="46.0" sum="92.0" sum2="4232.0" std="0.0"> <name id="ip" totalCount="2" failCount="0" failPercent="0.00" min="46.0" max="46.0" avg="46.0" sum="92.0" sum2="4232.0" std="0.0">
</name> </name>
</type> </type>
<type id="MVC" totalCount="66" failCount="44" failPercent="66.67" min="0.0" max="191.0" avg="15.1" sum="998.0" sum2="136754.0" std="42.9"> <type id="MVC" totalCount="66" failCount="11" failPercent="16.67" min="0.0" max="191.0" avg="15.1" sum="998.0" sum2="136754.0" std="42.9">
<name id="InboundPhase" totalCount="22" failCount="0" failPercent="0.00" min="0.0" max="17.0" avg="1.5" sum="34.0" sum2="578.0" std="4.9"> <name id="InboundPhase" totalCount="22" failCount="0" failPercent="0.00" min="0.0" max="17.0" avg="1.5" sum="34.0" sum2="578.0" std="4.9">
</name> </name>
<name id="TransitionPhase" totalCount="22" failCount="0" failPercent="0.00" min="0.0" max="4.9E-324" avg="0.0" sum="0.0" sum2="0.0" std="0.0"> <name id="TransitionPhase" totalCount="22" failCount="4" failPercent="18.18" min="0.0" max="4.9E-324" avg="0.0" sum="0.0" sum2="0.0" std="0.0">
</name> </name>
<name id="OutboundPhase" totalCount="22" failCount="0" failPercent="0.00" min="1.0" max="191.0" avg="43.8" sum="964.0" sum2="136176.0" std="65.3"> <name id="OutboundPhase" totalCount="22" failCount="7" failPercent="31.82" min="1.0" max="191.0" avg="43.8" sum="964.0" sum2="136176.0" std="65.3">
</name> </name>
</type> </type>
<type id="OLD1" totalCount="33" failCount="0" failPercent="0.00" min="0.0" max="191.0" avg="15.1" sum="499.0" sum2="68377.0" std="42.9"> <type id="OLD1" totalCount="33" failCount="0" failPercent="0.00" min="0.0" max="191.0" avg="15.1" sum="499.0" sum2="68377.0" std="42.9">
......
<transaction-report domain="Cat" startTime="2012-02-16 23:00:00" <transaction-report domain="Cat" startTime="2012-02-16 23:00:00"
endTime="2012-02-16 23:59:00"> endTime="2012-02-16 23:59:00">
<domain>Cat</domain> <domain>Cat</domain>
<type id="URL" totalCount="11" failCount="0" failPercent="0.00" <type id="URL" totalCount="11" failCount="4" failPercent="0.00"
min="1.0" max="193.0" avg="47.1" sum="518.0" sum2="73942.0" std="67.1"> min="1.0" max="193.0" avg="47.1" sum="518.0" sum2="73942.0" std="67.1">
<name id="home" totalCount="1" failCount="0" failPercent="0.00" <name id="home" totalCount="1" failCount="0" failPercent="0.00"
min="175.0" max="175.0" avg="175.0" sum="175.0" sum2="30625.0" std="0.0"> min="175.0" max="175.0" avg="175.0" sum="175.0" sum2="30625.0" std="0.0">
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
<successmessageurl>20120216/23/Cat/1168a02c-664b-440c-9ef4-a87bac4d9cb1.html <successmessageurl>20120216/23/Cat/1168a02c-664b-440c-9ef4-a87bac4d9cb1.html
</successmessageurl> </successmessageurl>
</name> </name>
<name id="TransitionPhase" totalCount="11" failCount="0" <name id="TransitionPhase" totalCount="11" failCount="4"
failPercent="0.00" min="0.0" max="4.9E-324" avg="0.0" sum="0.0" sum2="0.0" failPercent="0.00" min="0.0" max="4.9E-324" avg="0.0" sum="0.0" sum2="0.0"
std="0.0"> std="0.0">
<successmessageurl>20120216/23/Cat/1168a02c-664b-440c-9ef4-a87bac4d9cb1.html <successmessageurl>20120216/23/Cat/1168a02c-664b-440c-9ef4-a87bac4d9cb1.html
</successmessageurl> </successmessageurl>
</name> </name>
<name id="OutboundPhase" totalCount="11" failCount="0" <name id="OutboundPhase" totalCount="11" failCount="7"
failPercent="0.00" min="1.0" max="191.0" avg="43.8" sum="482.0" sum2="68088.0" failPercent="0.00" min="1.0" max="191.0" avg="43.8" sum="482.0" sum2="68088.0"
std="65.3"> std="65.3">
<successmessageurl>20120216/23/Cat/1168a02c-664b-440c-9ef4-a87bac4d9cb1.html <successmessageurl>20120216/23/Cat/1168a02c-664b-440c-9ef4-a87bac4d9cb1.html
......
...@@ -10,7 +10,7 @@ public abstract class CatTestCase extends ComponentTestCase { ...@@ -10,7 +10,7 @@ public abstract class CatTestCase extends ComponentTestCase {
@Before @Before
public void before() throws Exception { public void before() throws Exception {
Cat.initialize(getContainer(), null); Cat.initialize(getContainer(), null);
Cat.setup(null, null); Cat.setup(null);
} }
@After @After
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册