tree.setMessageId("" + i);
tree.setDomain(m_domain);
tree.setHostName("group001");
tree.setIpAddress("192.168.1.1");
DefaultTransaction t;
if (i % 3 == 0) {
t = new DefaultTransaction("URL", "TuanGouWeb", null);
t.setTimestamp(m_timestamp + i * MINITE);
DefaultEvent event = new DefaultEvent("URL", "ABTest");
DefaultMetric metric = new DefaultMetric("City", "/beijing");
metric.setTimestamp(m_timestamp + i * MINITE);
metric.setStatus("S");
metric.addData("10");
t.addChild(metric);
t.addChild(event);
} else if (i % 3 == 1) {
t = new DefaultTransaction("Service", "TuanGouWeb", null);
t.setTimestamp(m_timestamp + i * MINITE);
DefaultEvent event = new DefaultEvent("URL", "ABTest");
DefaultMetric metric = new DefaultMetric("", "/nanjing");
metric.setTimestamp(m_timestamp + i * MINITE);
metric.setStatus("S,C");
metric.addData("10,10");
t.addChild(metric);
t.addChild(event);
} else {
t = new DefaultTransaction("Metric", "TuanGouWeb", null);
t.setTimestamp(m_timestamp + 1000);
DefaultMetric metric = new DefaultMetric("", "/shanghai");
metric.setTimestamp(m_timestamp + i * MINITE);
metric.setStatus("C");
metric.addData("10");
t.addChild(metric);
DefaultMetric durationMetric = new DefaultMetric("", "/shenzhen");
durationMetric.setTimestamp(m_timestamp + i * MINITE);
durationMetric.setStatus("T");
durationMetric.addData("10");
t.addChild(durationMetric);
}
t.complete();
t.setDurationInMillis(i * 2);
tree.setMessage(t);
return tree;
}