提交 91c5aa79 编写于 作者: Y youyong205

fix cat bug

上级 d5e13f22
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<plugin> <plugin>
<groupId>org.unidal.maven.plugins</groupId> <groupId>org.unidal.maven.plugins</groupId>
<artifactId>codegen-maven-plugin</artifactId> <artifactId>codegen-maven-plugin</artifactId>
<version>2.0.8</version> <version>2.0.5</version>
<executions> <executions>
<execution> <execution>
<id>generate plexus component descriptor</id> <id>generate plexus component descriptor</id>
......
...@@ -174,7 +174,9 @@ public class Handler implements PageHandler<Context> { ...@@ -174,7 +174,9 @@ public class Handler implements PageHandler<Context> {
m_externalInfoBuilder.buildExceptionInfoOnGraph(payload, model, topologyGraph); m_externalInfoBuilder.buildExceptionInfoOnGraph(payload, model, topologyGraph);
model.setReportStart(new Date(payload.getDate())); model.setReportStart(new Date(payload.getDate()));
model.setReportEnd(new Date(payload.getDate() + TimeUtil.ONE_HOUR - 1)); model.setReportEnd(new Date(payload.getDate() + TimeUtil.ONE_HOUR - 1));
model.setTopologyGraph(new DefaultJsonBuilder().build(topologyGraph)); String build = new DefaultJsonBuilder().buildJson(topologyGraph);
model.setTopologyGraph(build);
break; break;
case LINE_CHART: case LINE_CHART:
DependencyReport dependencyReport = queryDependencyReport(payload); DependencyReport dependencyReport = queryDependencyReport(payload);
......
...@@ -69,7 +69,7 @@ public class Model extends AbstractReportModel<Action, Context> { ...@@ -69,7 +69,7 @@ public class Model extends AbstractReportModel<Action, Context> {
} }
public String getBugs() { public String getBugs() {
return new DefaultJsonBuilder().build(m_bugReport); return new DefaultJsonBuilder().buildJson(m_bugReport);
} }
public List<Service> getCacheServices() { public List<Service> getCacheServices() {
......
...@@ -85,7 +85,7 @@ public class Handler implements PageHandler<Context> { ...@@ -85,7 +85,7 @@ public class Handler implements PageHandler<Context> {
if (payload != null && report != null) { if (payload != null && report != null) {
boolean isCurrent = payload.getPeriod().isCurrent(); boolean isCurrent = payload.getPeriod().isCurrent();
double seconds; double seconds;
if (isCurrent) { if (isCurrent) {
seconds = (System.currentTimeMillis() - payload.getCurrentDate()) / (double) 1000; seconds = (System.currentTimeMillis() - payload.getCurrentDate()) / (double) 1000;
} else { } else {
...@@ -175,7 +175,6 @@ public class Handler implements PageHandler<Context> { ...@@ -175,7 +175,6 @@ public class Handler implements PageHandler<Context> {
normalize(model, payload); normalize(model, payload);
String type = payload.getType(); String type = payload.getType();
switch (payload.getAction()) { switch (payload.getAction()) {
case HOURLY_REPORT: case HOURLY_REPORT:
showHourlyReport(model, payload); showHourlyReport(model, payload);
......
app.name=test
app.swimlane=test
\ No newline at end of file
package com.dianping.cat.report.page.dependency;
import org.junit.Test;
import org.unidal.helper.Files;
import com.dianping.cat.home.dependency.graph.entity.TopologyGraph;
import com.dianping.cat.home.dependency.graph.transform.DefaultJsonBuilder;
import com.dianping.cat.home.dependency.graph.transform.DefaultSaxParser;
public class DependencyGraphReport {
@Test
public void test() throws Exception {
String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("graph.xml"), "utf-8");
TopologyGraph front = DefaultSaxParser.parse(oldXml);
DefaultJsonBuilder build = new DefaultJsonBuilder();
System.out.println(build.build(front));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册