提交 bba52f51 编写于 作者: Y youyong205

modify the analyzer

上级 cae69518
......@@ -556,7 +556,7 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
String childId = nextMessageId();
DefaultTransaction source = (DefaultTransaction) message;
DefaultTransaction target = new DefaultTransaction(source.getType(), source.getName(),
DefaultMessageManager.this);
DefaultMessageManager.this);
target.setTimestamp(source.getTimestamp());
target.setDurationInMicros(source.getDurationInMicros());
......
......@@ -47,6 +47,8 @@ public class TcpSocketSender implements Task, MessageSender, LogEnabled {
private MessageQueue m_queue = new DefaultMessageQueue(SIZE);
private BlockingQueue<MessageTree> m_atomicTrees = new LinkedBlockingQueue<MessageTree>(SIZE);
private List<InetSocketAddress> m_serverAddresses;
private ChannelManager m_manager;
......@@ -59,8 +61,6 @@ public class TcpSocketSender implements Task, MessageSender, LogEnabled {
private AtomicInteger m_attempts = new AtomicInteger();
private BlockingQueue<MessageTree> m_atomicTrees = new LinkedBlockingQueue<MessageTree>(SIZE * 10);
private static final int MAX_CHILD_NUMBER = 200;
private boolean checkWritable(ChannelFuture future) {
......@@ -127,6 +127,8 @@ public class TcpSocketSender implements Task, MessageSender, LogEnabled {
if (count % 1000 == 0 || count == 1) {
m_logger.error("Message queue is full in tcp socket sender! Count: " + count);
}
tree = null;
}
private MessageTree mergeTree(BlockingQueue<MessageTree> trees) {
......
......@@ -70,18 +70,18 @@ public class EventAnalyzer extends AbstractMessageAnalyzer<EventReport> implemen
if (m_serverConfigManager.validateDomain(domain)) {
EventReport report = m_reportManager.getHourlyReport(getStartTime(), domain, true);
Message message = tree.getMessage();
String ip = tree.getIpAddress();
if (message instanceof Transaction) {
processTransaction(report, tree, (Transaction) message);
processTransaction(report, tree, (Transaction) message, ip);
} else if (message instanceof Event) {
processEvent(report, tree, (Event) message);
processEvent(report, tree, (Event) message, ip);
}
}
}
private void processEvent(EventReport report, MessageTree tree, Event event) {
private void processEvent(EventReport report, MessageTree tree, Event event, String ip) {
int count = 1;
String ip = tree.getIpAddress();
EventType type = report.findOrCreateMachine(ip).findOrCreateType(event.getType());
EventName name = type.findOrCreateName(event.getName());
String messageId = tree.getMessageId();
......@@ -127,14 +127,14 @@ public class EventAnalyzer extends AbstractMessageAnalyzer<EventReport> implemen
}
}
private void processTransaction(EventReport report, MessageTree tree, Transaction t) {
private void processTransaction(EventReport report, MessageTree tree, Transaction t, String ip) {
List<Message> children = t.getChildren();
for (Message child : children) {
if (child instanceof Transaction) {
processTransaction(report, tree, (Transaction) child);
processTransaction(report, tree, (Transaction) child, ip);
} else if (child instanceof Event) {
processEvent(report, tree, (Event) child);
processEvent(report, tree, (Event) child, ip);
}
}
}
......@@ -142,4 +142,5 @@ public class EventAnalyzer extends AbstractMessageAnalyzer<EventReport> implemen
public void setReportManager(ReportManager<EventReport> reportManager) {
m_reportManager = reportManager;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册