From 06f675ac9b85c0af3e3519c707c154b600db7b1f Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Sat, 20 Jan 2018 22:21:56 +0800
Subject: [PATCH 01/36] Changed dependency graphql-java from 6.0 to 7.0.
---
apm-protocol/apm-ui-protocol/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apm-protocol/apm-ui-protocol/pom.xml b/apm-protocol/apm-ui-protocol/pom.xml
index 0e7e75784..ca05ad164 100644
--- a/apm-protocol/apm-ui-protocol/pom.xml
+++ b/apm-protocol/apm-ui-protocol/pom.xml
@@ -33,7 +33,7 @@
com.graphql-java
graphql-java
- 6.0
+ 7.0
From 1152135a0b0674f061a7c89efa5c05c8b86a7339 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Sat, 20 Jan 2018 22:26:08 +0800
Subject: [PATCH 02/36] initialize collector ui graphql module.
---
.../collector-ui-graphql/pom.xml | 40 +++++++++++++++++++
.../collector-ui-jetty-provider/pom.xml | 5 +++
apm-collector/apm-collector-ui/pom.xml | 1 +
3 files changed, 46 insertions(+)
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml b/apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml
new file mode 100644
index 000000000..1ce46b840
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+ apm-collector-ui
+ org.apache.skywalking
+ 5.0.0-alpha
+
+ 4.0.0
+
+ collector-ui-graphql
+ jar
+
+
+
+ com.graphql-java
+ graphql-java-tools
+ 4.3.0
+
+
+
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/pom.xml b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/pom.xml
index 83086aaa8..94469c388 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/pom.xml
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/pom.xml
@@ -36,6 +36,11 @@
collector-ui-define
${project.version}
+
+ org.apache.skywalking
+ collector-ui-graphql
+ ${project.version}
+
org.apache.skywalking
collector-cluster-define
diff --git a/apm-collector/apm-collector-ui/pom.xml b/apm-collector/apm-collector-ui/pom.xml
index e35d06d3b..a34095e71 100644
--- a/apm-collector/apm-collector-ui/pom.xml
+++ b/apm-collector/apm-collector-ui/pom.xml
@@ -31,6 +31,7 @@
pom
collector-ui-define
+ collector-ui-graphql
collector-ui-jetty-provider
From 6b3aa98b82ec93e608b1fe06fb3f5c2a53528305 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Sat, 20 Jan 2018 22:33:33 +0800
Subject: [PATCH 03/36] Initialize the java class entity for mapping graphql
protocol.
---
.../collector-ui-graphql/pom.xml | 5 ++
.../apm/collector/ui/graphql/Mutation.java | 27 +++++++++
.../apm/collector/ui/graphql/Query.java | 27 +++++++++
.../collector/ui/graphql/VersionMutation.java | 26 +++++++++
.../collector/ui/graphql/VersionQuery.java | 26 +++++++++
.../apm/collector/ui/graphql/alarm/Alarm.java | 29 ++++++++++
.../collector/ui/graphql/alarm/AlarmItem.java | 30 ++++++++++
.../ui/graphql/alarm/AlarmQuery.java | 33 +++++++++++
.../collector/ui/graphql/alarm/AlarmType.java | 28 +++++++++
.../collector/ui/graphql/alarm/CauseType.java | 27 +++++++++
.../graphql/application/ApplicationNode.java | 36 ++++++++++++
.../graphql/application/ApplicationQuery.java | 48 +++++++++++++++
.../graphql/application/ConjecturalNode.java | 27 +++++++++
.../apm/collector/ui/graphql/common/Call.java | 31 ++++++++++
.../collector/ui/graphql/common/Duration.java | 30 ++++++++++
.../collector/ui/graphql/common/Mutation.java | 26 +++++++++
.../apm/collector/ui/graphql/common/Node.java | 28 +++++++++
.../ui/graphql/common/Pagination.java | 28 +++++++++
.../ui/graphql/common/ResponseTimeTrend.java | 28 +++++++++
.../collector/ui/graphql/common/SLATrend.java | 28 +++++++++
.../apm/collector/ui/graphql/common/Step.java | 30 ++++++++++
.../ui/graphql/common/ThroughputTrend.java | 28 +++++++++
.../collector/ui/graphql/common/Topology.java | 29 ++++++++++
.../ui/graphql/common/VisualUserNode.java | 25 ++++++++
.../ui/graphql/config/AlarmThreshold.java | 31 ++++++++++
.../ui/graphql/config/ConfigMutation.java | 36 ++++++++++++
.../ui/graphql/config/ConfigQuery.java | 36 ++++++++++++
.../config/ExistedAlarmThresholdItem.java | 29 ++++++++++
.../config/ExistedAlarmThresholds.java | 28 +++++++++
.../ui/graphql/config/ExistedTTLConfigs.java | 28 +++++++++
.../apm/collector/ui/graphql/config/TTL.java | 29 ++++++++++
.../ui/graphql/config/TTLConfigItem.java | 29 ++++++++++
.../ui/graphql/overview/AlarmTrend.java | 28 +++++++++
.../ui/graphql/overview/ClusterBrief.java | 30 ++++++++++
.../ui/graphql/overview/ConjecturalApp.java | 27 +++++++++
.../graphql/overview/ConjecturalAppBrief.java | 28 +++++++++
.../graphql/overview/OverViewLayerQuery.java | 56 ++++++++++++++++++
.../ui/graphql/server/AppServerInfo.java | 33 +++++++++++
.../collector/ui/graphql/server/CPUTrend.java | 28 +++++++++
.../collector/ui/graphql/server/GCTrend.java | 29 ++++++++++
.../ui/graphql/server/MemoryTrend.java | 31 ++++++++++
.../ui/graphql/server/ServerQuery.java | 58 +++++++++++++++++++
.../ui/graphql/service/ServiceInfo.java | 29 ++++++++++
.../ui/graphql/service/ServiceNode.java | 30 ++++++++++
.../ui/graphql/service/ServiceQuery.java | 52 +++++++++++++++++
.../ui/graphql/trace/BasicTrace.java | 30 ++++++++++
.../collector/ui/graphql/trace/KeyValue.java | 27 +++++++++
.../collector/ui/graphql/trace/LogEntity.java | 29 ++++++++++
.../apm/collector/ui/graphql/trace/Ref.java | 29 ++++++++++
.../collector/ui/graphql/trace/RefType.java | 27 +++++++++
.../collector/ui/graphql/trace/Segment.java | 31 ++++++++++
.../apm/collector/ui/graphql/trace/Span.java | 43 ++++++++++++++
.../apm/collector/ui/graphql/trace/Trace.java | 28 +++++++++
.../ui/graphql/trace/TraceBrief.java | 29 ++++++++++
.../ui/graphql/trace/TraceQuery.java | 34 +++++++++++
.../ui/graphql/trace/TraceQueryCondition.java | 36 ++++++++++++
.../ui/graphql/UIGraphQLProtocolTestCase.java | 57 ++++++++++++++++++
57 files changed, 1785 insertions(+)
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Mutation.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Query.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionMutation.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmItem.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmType.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/CauseType.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationNode.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ConjecturalNode.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Call.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Mutation.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Node.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ResponseTimeTrend.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/SLATrend.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Step.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ThroughputTrend.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Topology.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/VisualUserNode.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/AlarmThreshold.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigMutation.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholdItem.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholds.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedTTLConfigs.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTL.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTLConfigItem.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/AlarmTrend.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ClusterBrief.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalApp.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalAppBrief.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/OverViewLayerQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/AppServerInfo.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/CPUTrend.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/GCTrend.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/MemoryTrend.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/ServerQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceInfo.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceNode.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/BasicTrace.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/KeyValue.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/LogEntity.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Ref.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/RefType.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Segment.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Span.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Trace.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceBrief.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQueryCondition.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/UIGraphQLProtocolTestCase.java
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml b/apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml
index 1ce46b840..7e82b5ad6 100644
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml
@@ -36,5 +36,10 @@
graphql-java-tools
4.3.0
+
+ org.apache.skywalking
+ apm-ui-protocol
+ ${project.version}
+
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Mutation.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Mutation.java
new file mode 100644
index 000000000..6967911aa
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Mutation.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql;
+
+import com.coxautodev.graphql.tools.GraphQLMutationResolver;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface Mutation extends GraphQLMutationResolver {
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Query.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Query.java
new file mode 100644
index 000000000..735089000
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Query.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql;
+
+import com.coxautodev.graphql.tools.GraphQLQueryResolver;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface Query extends GraphQLQueryResolver {
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionMutation.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionMutation.java
new file mode 100644
index 000000000..3b4295c18
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionMutation.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql;
+
+/**
+ * @author peng-yongsheng
+ */
+public class VersionMutation implements Mutation {
+ private String version;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionQuery.java
new file mode 100644
index 000000000..bba61bc8f
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionQuery.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql;
+
+/**
+ * @author peng-yongsheng
+ */
+public class VersionQuery implements Query {
+ private String version;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java
new file mode 100644
index 000000000..2f021b431
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.alarm;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Alarm {
+ private List items;
+ private Integer count;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmItem.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmItem.java
new file mode 100644
index 000000000..bae35fba4
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmItem.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.alarm;
+
+/**
+ * @author peng-yongsheng
+ */
+public class AlarmItem {
+ private String title;
+ private String content;
+ private String startTime;
+ private AlarmType alertType;
+ private CauseType causeType;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java
new file mode 100644
index 000000000..0dd131eb1
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.alarm;
+
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
+import org.apache.skywalking.apm.collector.ui.graphql.common.Pagination;
+
+/**
+ * @author peng-yongsheng
+ */
+public class AlarmQuery implements Query {
+ public Alarm loadAlertList(String keyword, AlarmType alarmType, Duration duration,
+ Pagination pagination) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmType.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmType.java
new file mode 100644
index 000000000..d36d547c0
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmType.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.alarm;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum AlarmType {
+ APPLICATION,
+ SERVER,
+ SERVICE
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/CauseType.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/CauseType.java
new file mode 100644
index 000000000..5d5986b06
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/CauseType.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.alarm;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum CauseType {
+ LOW_SUCCESS_RATE,
+ SLOW_RESPONSE
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationNode.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationNode.java
new file mode 100644
index 000000000..45bc62c4a
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationNode.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.application;
+
+import org.apache.skywalking.apm.collector.ui.graphql.common.Node;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ApplicationNode extends Node {
+ private Float sla;
+ private Long callsPerSec;
+ private Integer responseTimePerSec;
+ private Long calls;
+ private Float apdex;
+ private Boolean isAlarm;
+ private Integer numOfServer;
+ private Integer numOfServerAlarm;
+ private Integer numOfServiceAlarm;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationQuery.java
new file mode 100644
index 000000000..44e735152
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationQuery.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.application;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
+import org.apache.skywalking.apm.collector.ui.graphql.common.Topology;
+import org.apache.skywalking.apm.collector.ui.graphql.server.AppServerInfo;
+import org.apache.skywalking.apm.collector.ui.graphql.service.ServiceInfo;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ApplicationQuery implements Query {
+
+ public List getAllApplication(Duration duration) {
+ return null;
+ }
+
+ public Topology getApplicationTopology(int applicationId, Duration duration) {
+ return null;
+ }
+
+ public List getSlowService(int applicationId, Duration duration, Integer top) {
+ return null;
+ }
+
+ public List getServerThroughput(int applicationId, Duration duration, Integer top) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ConjecturalNode.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ConjecturalNode.java
new file mode 100644
index 000000000..8cd678afc
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ConjecturalNode.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.application;
+
+import org.apache.skywalking.apm.collector.ui.graphql.common.Node;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ConjecturalNode extends Node {
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Call.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Call.java
new file mode 100644
index 000000000..3c039e036
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Call.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Call {
+ private String source;
+ private String target;
+ private Boolean isAlert;
+ private String callType;
+ private Integer callsPerSec;
+ private Integer responseTimePerSec;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java
new file mode 100644
index 000000000..9bdeda4e7
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Duration {
+
+ private String start;
+ private String end;
+ private Step step;
+
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Mutation.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Mutation.java
new file mode 100644
index 000000000..82f21b500
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Mutation.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Mutation {
+ private String version;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Node.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Node.java
new file mode 100644
index 000000000..388e1f308
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Node.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class Node {
+ private String id;
+ private String name;
+ private String type;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java
new file mode 100644
index 000000000..6a690678d
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Pagination {
+ private Integer pageNum;
+ private Integer pageSize;
+ private Boolean needTotal;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ResponseTimeTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ResponseTimeTrend.java
new file mode 100644
index 000000000..21f7967a9
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ResponseTimeTrend.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ResponseTimeTrend {
+ private List trendList;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/SLATrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/SLATrend.java
new file mode 100644
index 000000000..4d2526584
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/SLATrend.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class SLATrend {
+ private List trendList;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Step.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Step.java
new file mode 100644
index 000000000..b4d4c4c56
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Step.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum Step {
+ MONTH,
+ DAY,
+ HOUR,
+ MINUTE,
+ SECOND
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ThroughputTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ThroughputTrend.java
new file mode 100644
index 000000000..504464dde
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ThroughputTrend.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ThroughputTrend {
+ private List trendList;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Topology.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Topology.java
new file mode 100644
index 000000000..6f618ef7c
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Topology.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Topology {
+ private List nodes;
+ private List calls;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/VisualUserNode.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/VisualUserNode.java
new file mode 100644
index 000000000..0ede1446a
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/VisualUserNode.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public class VisualUserNode extends Node {
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/AlarmThreshold.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/AlarmThreshold.java
new file mode 100644
index 000000000..e4ae4fc08
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/AlarmThreshold.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.config;
+
+import org.apache.skywalking.apm.collector.ui.graphql.alarm.AlarmType;
+import org.apache.skywalking.apm.collector.ui.graphql.alarm.CauseType;
+
+/**
+ * @author peng-yongsheng
+ */
+public class AlarmThreshold {
+ private AlarmType type;
+ private Integer threshold;
+ private CauseType causeType;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigMutation.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigMutation.java
new file mode 100644
index 000000000..828926c7e
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigMutation.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.config;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.ui.graphql.Mutation;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ConfigMutation implements Mutation {
+
+ public Boolean setDataTTLConfigs(List ttl) {
+ return null;
+ }
+
+ public Boolean setAlarmThreshold(List thresholds) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigQuery.java
new file mode 100644
index 000000000..4959eec6b
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigQuery.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.config;
+
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.ui.graphql.alarm.AlarmType;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ConfigQuery implements Query {
+
+ public ExistedTTLConfigs queryAllDataTTLConfigs() {
+ return null;
+ }
+
+ public ExistedAlarmThresholds queryAlarmThresholds(AlarmType alarmType) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholdItem.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholdItem.java
new file mode 100644
index 000000000..2efd4c897
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholdItem.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.config;
+
+import org.apache.skywalking.apm.collector.ui.graphql.alarm.CauseType;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ExistedAlarmThresholdItem {
+ private Integer threshold;
+ private CauseType causeType;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholds.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholds.java
new file mode 100644
index 000000000..e6c32e618
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholds.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.config;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ExistedAlarmThresholds {
+ private List items;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedTTLConfigs.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedTTLConfigs.java
new file mode 100644
index 000000000..ad76dbd1c
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedTTLConfigs.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.config;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ExistedTTLConfigs {
+ private List ttl;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTL.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTL.java
new file mode 100644
index 000000000..6d65c0384
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTL.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.config;
+
+import org.apache.skywalking.apm.collector.ui.graphql.common.Step;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TTL {
+ private Step unit;
+ private Integer value;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTLConfigItem.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTLConfigItem.java
new file mode 100644
index 000000000..bb16bbf4a
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTLConfigItem.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.config;
+
+import org.apache.skywalking.apm.collector.ui.graphql.common.Step;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TTLConfigItem {
+ private Step unit;
+ private Integer value;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/AlarmTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/AlarmTrend.java
new file mode 100644
index 000000000..604e5da20
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/AlarmTrend.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.overview;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class AlarmTrend {
+ public List numOfAlarmRate;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ClusterBrief.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ClusterBrief.java
new file mode 100644
index 000000000..59177bd23
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ClusterBrief.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.overview;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ClusterBrief {
+ private int numOfApplication;
+ private int numOfService;
+ private int numOfDatabase;
+ private int numOfCache;
+ private int numOfMQ;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalApp.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalApp.java
new file mode 100644
index 000000000..60688bd98
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalApp.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.overview;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ConjecturalApp {
+ private String name;
+ private int num;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalAppBrief.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalAppBrief.java
new file mode 100644
index 000000000..74c9c8a7b
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalAppBrief.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.overview;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ConjecturalAppBrief {
+ private List apps;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/OverViewLayerQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/OverViewLayerQuery.java
new file mode 100644
index 000000000..11c8c610d
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/OverViewLayerQuery.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.overview;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
+import org.apache.skywalking.apm.collector.ui.graphql.common.Topology;
+import org.apache.skywalking.apm.collector.ui.graphql.server.AppServerInfo;
+import org.apache.skywalking.apm.collector.ui.graphql.service.ServiceInfo;
+
+/**
+ * @author peng-yongsheng
+ */
+public class OverViewLayerQuery implements Query {
+
+ public Topology getClusterTopology(Duration duration) {
+ return null;
+ }
+
+ public ClusterBrief getClusterBrief(Duration duration) {
+ return null;
+ }
+
+ public AlarmTrend getAlarmTrend(Duration duration) {
+ return null;
+ }
+
+ public ConjecturalAppBrief getConjecturalApps(Duration duration) {
+ return null;
+ }
+
+ public List getTopNSlowService(Duration duration, int topN) {
+ return null;
+ }
+
+ public List getTopNServerThroughput(Duration duration, int topN) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/AppServerInfo.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/AppServerInfo.java
new file mode 100644
index 000000000..206b5221f
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/AppServerInfo.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.server;
+
+/**
+ * @author peng-yongsheng
+ */
+public class AppServerInfo {
+ private int id;
+ private String name;
+ private int tps;
+ private String os;
+ private String host;
+ private int pid;
+ private String ipv4;
+ private String ipv6;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/CPUTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/CPUTrend.java
new file mode 100644
index 000000000..2c1ae10f4
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/CPUTrend.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.server;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class CPUTrend {
+ private List cost;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/GCTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/GCTrend.java
new file mode 100644
index 000000000..47309ad96
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/GCTrend.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.server;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class GCTrend {
+ private List youngGC;
+ private List oldGC;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/MemoryTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/MemoryTrend.java
new file mode 100644
index 000000000..4dba1d842
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/MemoryTrend.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.server;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class MemoryTrend {
+ private List heap;
+ private List maxHeap;
+ private List noheap;
+ private List maxNoheap;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/ServerQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/ServerQuery.java
new file mode 100644
index 000000000..96aa50ebb
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/ServerQuery.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.server;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
+import org.apache.skywalking.apm.collector.ui.graphql.common.ResponseTimeTrend;
+import org.apache.skywalking.apm.collector.ui.graphql.common.ThroughputTrend;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ServerQuery implements Query {
+ public List searchServer(String keyword, Duration duration) {
+ return null;
+ }
+
+ public List getAllServer(String applicationId, Duration duration) {
+ return null;
+ }
+
+ public ResponseTimeTrend getServerResponseTimeTrend(int serverId, Duration duration) {
+ return null;
+ }
+
+ public ThroughputTrend getServerTPSTrend(int serverId, Duration duration) {
+ return null;
+ }
+
+ public CPUTrend getCPUTrend(int serverId, Duration duration) {
+ return null;
+ }
+
+ public GCTrend getGCTrend(int serverId, Duration duration) {
+ return null;
+ }
+
+ public MemoryTrend getMemoryTrend(int serverId, Duration duration) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceInfo.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceInfo.java
new file mode 100644
index 000000000..6a44722d7
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceInfo.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.service;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ServiceInfo {
+ private int id;
+ private String name;
+ private int avgResponseTime;
+ private int tps;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceNode.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceNode.java
new file mode 100644
index 000000000..c29c0fea1
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceNode.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.service;
+
+import org.apache.skywalking.apm.collector.ui.graphql.common.Node;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ServiceNode extends Node {
+ private Float sla;
+ private Long calls;
+ private Integer numOfServiceAlarm;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceQuery.java
new file mode 100644
index 000000000..5ed158f8e
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceQuery.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.service;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
+import org.apache.skywalking.apm.collector.ui.graphql.common.ResponseTimeTrend;
+import org.apache.skywalking.apm.collector.ui.graphql.common.SLATrend;
+import org.apache.skywalking.apm.collector.ui.graphql.common.ThroughputTrend;
+import org.apache.skywalking.apm.collector.ui.graphql.common.Topology;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ServiceQuery implements Query {
+ public List searchService(String keyword, Duration duration, Integer topN) {
+ return null;
+ }
+
+ public ResponseTimeTrend getServiceResponseTimeTrend(int serviceId, Duration duration) {
+ return null;
+ }
+
+ public ThroughputTrend getServiceTPSTrend(int serviceId, Duration duration) {
+ return null;
+ }
+
+ public SLATrend getServiceSLATrend(int serviceId, Duration duration) {
+ return null;
+ }
+
+ public Topology getServiceTopology(int serviceId, Duration duration) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/BasicTrace.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/BasicTrace.java
new file mode 100644
index 000000000..2b2151906
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/BasicTrace.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+/**
+ * @author peng-yongsheng
+ */
+public class BasicTrace {
+ private String operationName;
+ private int duration;
+ private String start;
+ private Boolean isError;
+ private String traceId;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/KeyValue.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/KeyValue.java
new file mode 100644
index 000000000..28710cd0d
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/KeyValue.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+/**
+ * @author peng-yongsheng
+ */
+public class KeyValue {
+ private String key;
+ private String value;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/LogEntity.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/LogEntity.java
new file mode 100644
index 000000000..d2938d4c1
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/LogEntity.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class LogEntity {
+ private String time;
+ private List data;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Ref.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Ref.java
new file mode 100644
index 000000000..ef226f4f7
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Ref.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Ref {
+ private String traceId;
+ private Integer parentSegmentId;
+ private Integer parentSpanId;
+ private RefType type;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/RefType.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/RefType.java
new file mode 100644
index 000000000..6c3ce9fe4
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/RefType.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum RefType {
+ CROSS_PROCESS,
+ CROSS_THREAD
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Segment.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Segment.java
new file mode 100644
index 000000000..50dbe6cf2
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Segment.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Segment {
+ private int segmentId;
+ private String appName;
+ private Boolean isSizeLimited;
+ private List spans;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Span.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Span.java
new file mode 100644
index 000000000..516eba00e
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Span.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Span {
+ private String traceId;
+ private String segmentId;
+ private Integer spanId;
+ private Integer parentSpanId;
+ private List[ refs;
+ private String applicationCode;
+ private Long startTime;
+ private Long endTime;
+ private String operationName;
+ private String type;
+ private String peer;
+ private String component;
+ private Boolean isError;
+ private String layer;
+ private List tags;
+ private List logs;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Trace.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Trace.java
new file mode 100644
index 000000000..05b1ba19d
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Trace.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Trace {
+ private List spans;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceBrief.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceBrief.java
new file mode 100644
index 000000000..b9353370a
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceBrief.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TraceBrief {
+ private List traces;
+ private Integer total;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQuery.java
new file mode 100644
index 000000000..76b370b1b
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQuery.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TraceQuery implements Query {
+ public TraceBrief queryBasicTraces(TraceQueryCondition condition) {
+ return null;
+ }
+
+ public Trace queryTrace(String id) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQueryCondition.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQueryCondition.java
new file mode 100644
index 000000000..5dd8fdd01
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQueryCondition.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.trace;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TraceQueryCondition {
+ private List applicationCodes;
+ private String traceId;
+ private String operationName;
+ private Duration queryDuration;
+ private int minTraceDuration;
+ private int maxTraceDuration;
+ private Boolean topN;
+ private int needTotal;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/UIGraphQLProtocolTestCase.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/UIGraphQLProtocolTestCase.java
new file mode 100644
index 000000000..fc0853694
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/UIGraphQLProtocolTestCase.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql;
+
+import com.coxautodev.graphql.tools.SchemaParser;
+import org.apache.skywalking.apm.collector.ui.graphql.alarm.AlarmQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.application.ApplicationQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.application.ConjecturalNode;
+import org.apache.skywalking.apm.collector.ui.graphql.common.VisualUserNode;
+import org.apache.skywalking.apm.collector.ui.graphql.config.ConfigMutation;
+import org.apache.skywalking.apm.collector.ui.graphql.config.ConfigQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.overview.OverViewLayerQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.server.ServerQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.service.ServiceQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.trace.TraceQuery;
+import org.junit.Test;
+
+/**
+ * @author peng-yongsheng
+ */
+public class UIGraphQLProtocolTestCase {
+
+ @Test
+ public void test() {
+ SchemaParser.newParser()
+ .file("ui-graphql/alarm.graphqls")
+ .file("ui-graphql/application-layer.graphqls")
+ .file("ui-graphql/common.graphqls")
+ .file("ui-graphql/config.graphqls")
+ .file("ui-graphql/overview-layer.graphqls")
+ .file("ui-graphql/server-layer.graphqls")
+ .file("ui-graphql/service-layer.graphqls")
+ .file("ui-graphql/trace.graphqls")
+ .resolvers(new VersionQuery(), new VersionMutation(), new AlarmQuery(), new ApplicationQuery())
+ .resolvers(new OverViewLayerQuery(), new ServerQuery(), new ServiceQuery(), new TraceQuery())
+ .resolvers(new ConfigQuery(), new ConfigMutation())
+ .dictionary(ConjecturalNode.class, VisualUserNode.class)
+ .build()
+ .makeExecutableSchema();
+ }
+}
From 96197120b900e79697e031289c4070527e54689f Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Sun, 21 Jan 2018 11:44:06 +0800
Subject: [PATCH 04/36] Provide GraphQL jetty servlet do get method.
---
.../collector/server/jetty/JettyHandler.java | 7 +-
.../collector/ui/graphql/GraphQLCreator.java | 59 ++++++++++++
.../apm/collector/ui/graphql/alarm/Alarm.java | 16 ++++
.../ui/graphql/alarm/AlarmQuery.java | 8 +-
.../collector/ui/graphql/common/Duration.java | 23 +++++
.../ui/graphql/common/Pagination.java | 24 +++++
.../ui/graphql/GraphQLCreatorTestCase.java | 34 +++++++
.../ui/jetty/UIModuleJettyProvider.java | 3 +
.../ui/jetty/handler/GraphQLHandler.java | 92 +++++++++++++++++++
9 files changed, 259 insertions(+), 7 deletions(-)
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreator.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreatorTestCase.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java
index 5113e666b..0c557b026 100644
--- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java
+++ b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java
@@ -16,7 +16,6 @@
*
*/
-
package org.apache.skywalking.apm.collector.server.jetty;
import com.google.gson.JsonElement;
@@ -61,7 +60,7 @@ public abstract class JettyHandler extends HttpServlet implements ServerHandler
}
}
- protected abstract JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException;
+ protected abstract JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException, IOException;
@Override
protected final void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
@@ -150,7 +149,7 @@ public abstract class JettyHandler extends HttpServlet implements ServerHandler
}
private void reply(HttpServletResponse response, JsonElement resJson) throws IOException {
- response.setContentType("text/json");
+ response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
response.setStatus(HttpServletResponse.SC_OK);
@@ -163,7 +162,7 @@ public abstract class JettyHandler extends HttpServlet implements ServerHandler
}
private void replyError(HttpServletResponse response, String errorMessage, int status) throws IOException {
- response.setContentType("text/plain");
+ response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
response.setStatus(status);
response.setHeader("error-message", errorMessage);
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreator.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreator.java
new file mode 100644
index 000000000..f6df67125
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreator.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql;
+
+import com.coxautodev.graphql.tools.SchemaParser;
+import graphql.GraphQL;
+import graphql.schema.GraphQLSchema;
+import org.apache.skywalking.apm.collector.ui.graphql.alarm.AlarmQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.application.ApplicationQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.application.ConjecturalNode;
+import org.apache.skywalking.apm.collector.ui.graphql.common.VisualUserNode;
+import org.apache.skywalking.apm.collector.ui.graphql.config.ConfigMutation;
+import org.apache.skywalking.apm.collector.ui.graphql.config.ConfigQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.overview.OverViewLayerQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.server.ServerQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.service.ServiceQuery;
+import org.apache.skywalking.apm.collector.ui.graphql.trace.TraceQuery;
+
+/**
+ * @author peng-yongsheng
+ */
+public class GraphQLCreator {
+
+ public GraphQL create() {
+ GraphQLSchema schema = SchemaParser.newParser()
+ .file("ui-graphql/alarm.graphqls")
+ .file("ui-graphql/application-layer.graphqls")
+ .file("ui-graphql/common.graphqls")
+ .file("ui-graphql/config.graphqls")
+ .file("ui-graphql/overview-layer.graphqls")
+ .file("ui-graphql/server-layer.graphqls")
+ .file("ui-graphql/service-layer.graphqls")
+ .file("ui-graphql/trace.graphqls")
+ .resolvers(new VersionQuery(), new VersionMutation(), new AlarmQuery(), new ApplicationQuery())
+ .resolvers(new OverViewLayerQuery(), new ServerQuery(), new ServiceQuery(), new TraceQuery())
+ .resolvers(new ConfigQuery(), new ConfigMutation())
+ .dictionary(ConjecturalNode.class, VisualUserNode.class)
+ .build()
+ .makeExecutableSchema();
+
+ return GraphQL.newGraphQL(schema).build();
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java
index 2f021b431..40002b7de 100644
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java
@@ -26,4 +26,20 @@ import java.util.List;
public class Alarm {
private List items;
private Integer count;
+
+ public List getItems() {
+ return items;
+ }
+
+ public void setItems(List items) {
+ this.items = items;
+ }
+
+ public Integer getCount() {
+ return count;
+ }
+
+ public void setCount(Integer count) {
+ this.count = count;
+ }
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java
index 0dd131eb1..8c213a658 100644
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java
@@ -26,8 +26,10 @@ import org.apache.skywalking.apm.collector.ui.graphql.common.Pagination;
* @author peng-yongsheng
*/
public class AlarmQuery implements Query {
- public Alarm loadAlertList(String keyword, AlarmType alarmType, Duration duration,
- Pagination pagination) {
- return null;
+
+ public Alarm loadAlertList(String keyword, AlarmType alarmType, Duration duration, Pagination pagination) {
+ Alarm alarm = new Alarm();
+ alarm.setCount(0);
+ return alarm;
}
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java
index 9bdeda4e7..ad051f150 100644
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java
@@ -27,4 +27,27 @@ public class Duration {
private String end;
private Step step;
+ public String getStart() {
+ return start;
+ }
+
+ public void setStart(String start) {
+ this.start = start;
+ }
+
+ public String getEnd() {
+ return end;
+ }
+
+ public void setEnd(String end) {
+ this.end = end;
+ }
+
+ public Step getStep() {
+ return step;
+ }
+
+ public void setStep(Step step) {
+ this.step = step;
+ }
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java
index 6a690678d..b0cabe5e5 100644
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java
@@ -25,4 +25,28 @@ public class Pagination {
private Integer pageNum;
private Integer pageSize;
private Boolean needTotal;
+
+ public Integer getPageNum() {
+ return pageNum;
+ }
+
+ public void setPageNum(Integer pageNum) {
+ this.pageNum = pageNum;
+ }
+
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public void setPageSize(Integer pageSize) {
+ this.pageSize = pageSize;
+ }
+
+ public Boolean getNeedTotal() {
+ return needTotal;
+ }
+
+ public void setNeedTotal(Boolean needTotal) {
+ this.needTotal = needTotal;
+ }
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreatorTestCase.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreatorTestCase.java
new file mode 100644
index 000000000..a232eb75e
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreatorTestCase.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql;
+
+import graphql.GraphQL;
+import org.junit.Test;
+
+/**
+ * @author peng-yongsheng
+ */
+public class GraphQLCreatorTestCase {
+
+ @Test
+ public void test() {
+ GraphQLCreator creator = new GraphQLCreator();
+ GraphQL graphQL = creator.create();
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java
index 90bc5af2b..c3876eeb8 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java
@@ -33,6 +33,7 @@ import org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterS
import org.apache.skywalking.apm.collector.server.Server;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.ui.UIModule;
+import org.apache.skywalking.apm.collector.ui.jetty.handler.GraphQLHandler;
import org.apache.skywalking.apm.collector.ui.jetty.handler.SegmentTopGetHandler;
import org.apache.skywalking.apm.collector.ui.jetty.handler.SpanGetHandler;
import org.apache.skywalking.apm.collector.ui.jetty.handler.TraceDagGetHandler;
@@ -110,5 +111,7 @@ public class UIModuleJettyProvider extends ModuleProvider {
jettyServer.addHandler(new SpanGetHandler(getManager()));
jettyServer.addHandler(new TraceDagGetHandler(getManager()));
jettyServer.addHandler(new TraceStackGetHandler(getManager()));
+
+ jettyServer.addHandler(new GraphQLHandler());
}
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
new file mode 100644
index 000000000..8e51a36fe
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.jetty.handler;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import graphql.ExecutionInput;
+import graphql.ExecutionResult;
+import graphql.GraphQL;
+import graphql.GraphQLError;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.skywalking.apm.collector.core.util.CollectionUtils;
+import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
+import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
+import org.apache.skywalking.apm.collector.ui.graphql.GraphQLCreator;
+
+/**
+ * @author peng-yongsheng
+ */
+public class GraphQLHandler extends JettyHandler {
+
+ private final Gson gson = new Gson();
+ private final GraphQL graphQL;
+ private static final String QUERY = "query";
+ private static final String DATA = "data";
+ private static final String ERRORS = "errors";
+
+ public GraphQLHandler() {
+ GraphQLCreator creator = new GraphQLCreator();
+ this.graphQL = creator.create();
+ }
+
+ @Override public String pathSpec() {
+ return "/graphql";
+ }
+
+ @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
+ return execute(req.getParameter(QUERY));
+ }
+
+ @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException, IOException {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(req.getInputStream()));
+ String line;
+ String request = "";
+ while ((line = reader.readLine()) != null) {
+ request += line;
+ }
+
+ return execute(request);
+ }
+
+ private JsonObject execute(String request) {
+ ExecutionInput executionInput = ExecutionInput.newExecutionInput().query(request).build();
+ ExecutionResult executionResult = graphQL.execute(executionInput);
+
+ Object data = executionResult.getData();
+ List errors = executionResult.getErrors();
+
+ JsonObject jsonObject = new JsonObject();
+ jsonObject.addProperty(DATA, data.toString());
+
+ if (CollectionUtils.isNotEmpty(errors)) {
+ String errorJsonStr = gson.toJson(errors, JsonArray.class);
+ JsonArray errorArray = gson.fromJson(errorJsonStr, JsonArray.class);
+ jsonObject.add(ERRORS, errorArray);
+ }
+
+ return jsonObject;
+ }
+}
From 843e709faee6ef2ba9271f54e3f87a407d735567 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Sun, 21 Jan 2018 11:52:24 +0800
Subject: [PATCH 05/36] Provide GraphQL jetty servlet do post method.
---
.../ui/graphql/UIGraphQLProtocolTestCase.java | 57 -------------------
.../ui/jetty/handler/GraphQLHandler.java | 3 +-
2 files changed, 2 insertions(+), 58 deletions(-)
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/UIGraphQLProtocolTestCase.java
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/UIGraphQLProtocolTestCase.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/UIGraphQLProtocolTestCase.java
deleted file mode 100644
index fc0853694..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/UIGraphQLProtocolTestCase.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql;
-
-import com.coxautodev.graphql.tools.SchemaParser;
-import org.apache.skywalking.apm.collector.ui.graphql.alarm.AlarmQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.application.ApplicationQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.application.ConjecturalNode;
-import org.apache.skywalking.apm.collector.ui.graphql.common.VisualUserNode;
-import org.apache.skywalking.apm.collector.ui.graphql.config.ConfigMutation;
-import org.apache.skywalking.apm.collector.ui.graphql.config.ConfigQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.overview.OverViewLayerQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.server.ServerQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.service.ServiceQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.trace.TraceQuery;
-import org.junit.Test;
-
-/**
- * @author peng-yongsheng
- */
-public class UIGraphQLProtocolTestCase {
-
- @Test
- public void test() {
- SchemaParser.newParser()
- .file("ui-graphql/alarm.graphqls")
- .file("ui-graphql/application-layer.graphqls")
- .file("ui-graphql/common.graphqls")
- .file("ui-graphql/config.graphqls")
- .file("ui-graphql/overview-layer.graphqls")
- .file("ui-graphql/server-layer.graphqls")
- .file("ui-graphql/service-layer.graphqls")
- .file("ui-graphql/trace.graphqls")
- .resolvers(new VersionQuery(), new VersionMutation(), new AlarmQuery(), new ApplicationQuery())
- .resolvers(new OverViewLayerQuery(), new ServerQuery(), new ServiceQuery(), new TraceQuery())
- .resolvers(new ConfigQuery(), new ConfigMutation())
- .dictionary(ConjecturalNode.class, VisualUserNode.class)
- .build()
- .makeExecutableSchema();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
index 8e51a36fe..d5e38df4f 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
@@ -68,7 +68,8 @@ public class GraphQLHandler extends JettyHandler {
request += line;
}
- return execute(request);
+ JsonObject requestJson = gson.fromJson(request, JsonObject.class);
+ return execute(requestJson.get(QUERY).getAsString());
}
private JsonObject execute(String request) {
From a25e353e2d5a4a2fd973c75f590567f75b014fd3 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Wed, 24 Jan 2018 00:12:27 +0800
Subject: [PATCH 06/36] Implement the method named getAllApplication in
application layer graphql protocol.
---
.../InstanceDiscoveryServiceHandler.java | 4 +-
.../test/resources/json/dubbox-consumer.json | 52 +++----
.../test/resources/json/dubbox-provider.json | 40 ++---
.../collector/core/util/TimeBucketUtils.java | 63 +-------
.../core/util/TimeBucketUtilsTest.java | 25 ----
.../collector/storage/dao/IInstanceUIDAO.java | 22 +--
.../apm/collector/storage/ui/alarm/Alarm.java | 45 ++++++
.../collector/storage/ui/alarm/AlarmItem.java | 30 ++++
.../collector/storage/ui/alarm/AlarmType.java | 28 ++++
.../collector/storage/ui/alarm/CauseType.java | 27 ++++
.../storage/ui/application/Application.java | 52 +++++++
.../ui/application/ApplicationNode.java | 109 ++++++++++++++
.../ui/application/ConjecturalNode.java | 27 ++++
.../apm/collector/storage/ui/common/Call.java | 31 ++++
.../collector/storage/ui/common/Duration.java | 53 +++++++
.../apm/collector/storage/ui/common/Node.java | 52 +++++++
.../storage/ui/common/Pagination.java | 52 +++++++
.../storage/ui/common/ResponseTimeTrend.java | 28 ++++
.../collector/storage/ui/common/SLATrend.java | 28 ++++
.../apm/collector/storage/ui/common/Step.java | 30 ++++
.../storage/ui/common/ThroughputTrend.java | 28 ++++
.../collector/storage/ui/common/Topology.java | 29 ++++
.../storage/ui/common/VisualUserNode.java} | 5 +-
.../storage/ui/config/AlarmThreshold.java | 31 ++++
.../ui/config/ExistedAlarmThresholdItem.java | 29 ++++
.../ui/config/ExistedAlarmThresholds.java | 28 ++++
.../storage/ui/config/ExistedTTLConfigs.java | 28 ++++
.../apm/collector/storage/ui/config/TTL.java | 29 ++++
.../storage/ui/config/TTLConfigItem.java | 29 ++++
.../storage/ui/overview/AlarmTrend.java | 28 ++++
.../storage/ui/overview/ClusterBrief.java | 30 ++++
.../storage/ui/overview/ConjecturalApp.java | 27 ++++
.../ui/overview/ConjecturalAppBrief.java | 28 ++++
.../storage/ui/server/AppServerInfo.java | 33 ++++
.../collector/storage/ui/server/CPUTrend.java | 28 ++++
.../collector/storage/ui/server/GCTrend.java | 29 ++++
.../storage/ui/server/MemoryTrend.java | 31 ++++
.../storage/ui/service/ServiceInfo.java | 29 ++++
.../storage/ui/service/ServiceNode.java} | 12 +-
.../storage/ui/trace/BasicTrace.java | 30 ++++
.../collector/storage/ui/trace/KeyValue.java | 27 ++++
.../collector/storage/ui/trace/LogEntity.java | 29 ++++
.../apm/collector/storage/ui/trace/Ref.java | 29 ++++
.../collector/storage/ui/trace/RefType.java | 27 ++++
.../collector/storage/ui/trace/Segment.java | 31 ++++
.../apm/collector/storage/ui/trace/Span.java | 43 ++++++
.../apm/collector/storage/ui/trace/Trace.java | 28 ++++
.../storage/ui/trace/TraceBrief.java | 29 ++++
.../storage/ui/trace/TraceQueryCondition.java | 36 +++++
.../storage/es/dao/CpuMetricEsUIDAO.java | 3 +-
.../storage/es/dao/GCMetricEsUIDAO.java | 5 +-
.../storage/es/dao/InstanceEsUIDAO.java | 13 +-
.../storage/es/dao/InstanceMetricEsUIDAO.java | 7 +-
.../storage/es/dao/MemoryMetricEsUIDAO.java | 3 +-
.../es/dao/MemoryPoolMetricEsUIDAO.java | 3 +-
.../dao/register/InstanceRegisterEsDAO.java | 7 +-
.../storage/h2/dao/CpuMetricH2UIDAO.java | 10 +-
.../storage/h2/dao/GCMetricH2UIDAO.java | 12 +-
.../storage/h2/dao/InstanceH2UIDAO.java | 13 +-
.../storage/h2/dao/InstanceMetricH2UIDAO.java | 12 +-
.../storage/h2/dao/MemoryMetricH2UIDAO.java | 6 +-
.../h2/dao/MemoryPoolMetricH2UIDAO.java | 8 +-
.../dao/register/InstanceRegisterH2DAO.java | 7 +-
.../collector/ui/graphql/GraphQLCreator.java | 59 --------
.../ui/graphql/utils/DurationUtils.java | 54 +++++++
.../DurationUtilsTestCase.java} | 11 +-
.../ui/jetty/UIModuleJettyProvider.java | 27 +---
.../ui/jetty/handler/GraphQLHandler.java | 87 +++++++++--
.../jetty/handler/SegmentTopGetHandler.java | 141 ------------------
.../ui/jetty/handler/SpanGetHandler.java | 66 --------
.../ui/jetty/handler/TraceDagGetHandler.java | 77 ----------
.../jetty/handler/TraceStackGetHandler.java | 58 -------
.../application/ApplicationsGetHandler.java | 77 ----------
.../InstanceHealthGetHandler.java | 85 -----------
...InstanceMetricGetOneTimeBucketHandler.java | 86 -----------
...stanceMetricGetRangeTimeBucketHandler.java | 94 ------------
.../InstanceOsInfoGetHandler.java | 65 --------
.../ServiceTreeGetByIdHandler.java | 85 -----------
.../time/AllInstanceLastTimeGetHandler.java | 71 ---------
.../time/OneInstanceLastTimeGetHandler.java | 70 ---------
.../collector/ui/mutation/ConfigMutation.java | 38 +++++
.../apm/collector/ui/query/AlarmQuery.java | 37 +++++
.../collector/ui/query/ApplicationQuery.java | 94 ++++++++++++
.../apm/collector/ui/query/ConfigQuery.java | 38 +++++
.../ui/query/OverViewLayerQuery.java | 63 ++++++++
.../apm/collector/ui/query/ServerQuery.java | 62 ++++++++
.../apm/collector/ui/query/ServiceQuery.java | 53 +++++++
.../apm/collector/ui/query/TraceQuery.java | 37 +++++
.../ui/service/ApplicationService.java | 17 +--
.../ui/service/InstanceHealthService.java | 102 ++++++-------
.../ui/query/ApplicationQueryTestCase.java | 139 +++++++++++++++++
.../ui-graphql/application-layer.graphqls | 8 +-
92 files changed, 2242 insertions(+), 1386 deletions(-)
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/Alarm.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmItem.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmType.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/CauseType.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/Application.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ConjecturalNode.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Duration.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Pagination.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ResponseTimeTrend.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/SLATrend.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Step.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ThroughputTrend.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java
rename apm-collector/{apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Mutation.java => apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/VisualUserNode.java} (87%)
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/AlarmThreshold.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholdItem.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholds.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedTTLConfigs.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTL.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTLConfigItem.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/AlarmTrend.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ClusterBrief.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalApp.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalAppBrief.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/CPUTrend.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/GCTrend.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/MemoryTrend.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceInfo.java
rename apm-collector/{apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationNode.java => apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceNode.java} (71%)
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/BasicTrace.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/KeyValue.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/LogEntity.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Ref.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/RefType.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Segment.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Span.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Trace.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceBrief.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreator.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtils.java
rename apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/{GraphQLCreatorTestCase.java => utils/DurationUtilsTestCase.java} (78%)
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/SegmentTopGetHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/SpanGetHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/TraceDagGetHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/TraceStackGetHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/application/ApplicationsGetHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancehealth/InstanceHealthGetHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceMetricGetOneTimeBucketHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceMetricGetRangeTimeBucketHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceOsInfoGetHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/servicetree/ServiceTreeGetByIdHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/time/AllInstanceLastTimeGetHandler.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/time/OneInstanceLastTimeGetHandler.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/mutation/ConfigMutation.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/AlarmQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ConfigQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServiceQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java
diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java
index 682b6c410..cde3e4c69 100644
--- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java
+++ b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java
@@ -26,7 +26,6 @@ import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInsta
import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler;
import org.apache.skywalking.apm.network.proto.ApplicationInstance;
import org.apache.skywalking.apm.network.proto.ApplicationInstanceHeartbeat;
@@ -55,8 +54,7 @@ public class InstanceDiscoveryServiceHandler extends InstanceDiscoveryServiceGrp
@Override
public void registerInstance(ApplicationInstance request,
StreamObserver responseObserver) {
- long timeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(request.getRegisterTime());
- int instanceId = instanceIDService.getOrCreateByAgentUUID(request.getApplicationId(), request.getAgentUUID(), timeBucket, buildOsInfo(request.getOsinfo()));
+ int instanceId = instanceIDService.getOrCreateByAgentUUID(request.getApplicationId(), request.getAgentUUID(), request.getRegisterTime(), buildOsInfo(request.getOsinfo()));
ApplicationInstanceMapping.Builder builder = ApplicationInstanceMapping.newBuilder();
builder.setApplicationId(request.getApplicationId());
builder.setApplicationInstanceId(instanceId);
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-consumer.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-consumer.json
index 4c80222bd..02f3ef8b0 100644
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-consumer.json
+++ b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-consumer.json
@@ -1,43 +1,33 @@
[
{
- "gt": [
- [
- 230150,
- 185809,
- 24040000
- ]
- ],
+ "gt": [[230150, 185809, 24040000]], //trace_id 链路编码
"sg": {
- "ts": [
- 230150,
- 185809,
- 24040000
- ],
- "ai": -1,
- "ii": 2,
- "rs": [],
- "ss": [
+ "ts": [230150, 185809, 24040000], //segment_id 一个应用中的一个实例在链路中产生的编号
+ "ai": -1, //应用ID,应用启动注册时产生
+ "ii": 2, //实例ID,应用启动注册时产生
+ "rs": [], //链路的上下文信息,头节点,所以为空
+ "ss": [ //一个埋点(手动埋点或者自动埋点)
{
- "si": 1,
- "tv": 1,
- "lv": 1,
- "ps": 0,
- "st": 1501858094526,
- "et": 1501858097004,
- "ci": 3,
- "cn": "",
- "oi": 0,
- "on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()",
- "pi": 0,
- "pn": "172.25.0.4:20880",
- "ie": false,
- "to": [
+ "si": 1, //埋点编号
+ "tv": 1, //埋点类型(手动、入口、出口)
+ "lv": 1, //层(RPCFramework,Database,Http)
+ "ps": 0, //上级埋点编号
+ "st": 1501858094526, //开始时间
+ "et": 1501858097004, //结束时间
+ "ci": 3, //组件编号(Tomcat、Mysql、Dubbo...)
+ "cn": "", //组件名称
+ "oi": 0, //埋点的服务ID
+ "on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()", //埋点的服务名
+ "pi": 0, //地址注册的ID,调用抓取后注册
+ "pn": "172.25.0.4:20880", //地址
+ "ie": false, //是否发生错误,是否有Exception
+ "to": [ //与链路分析关系较小的TAG,SQL也在其中
{
"k": "url",
"v": "rest://172.25.0.4:20880/org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"
}
],
- "lo": []
+ "lo": [] //日志,与链路分析完全无关,只作为展示使用,手动埋点时可以任意追加,kv的形式,例如收集一些业务相关的信息
},
{
"si": 0,
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json
index e446706f2..5add6e2f1 100644
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json
+++ b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json
@@ -1,18 +1,8 @@
[
{
- "gt": [
- [
- 230150,
- 185809,
- 24040000
- ]
- ],
+ "gt": [[230150, 185809, 24040000]], //trace_id 链路编码,与调用方相同
"sg": {
- "ts": [
- 137150,
- 185809,
- 48780000
- ],
+ "ts": [137150, 185809, 48780000], //segment_id,新产生
"ai": 2,
"ii": 3,
"ss": [
@@ -32,21 +22,17 @@
"ie": false,
"rs": [
{
- "pts": [
- 230150,
- 185809,
- 24040000
- ],
- "pii": 2,
- "psp": 0,
- "psi": 0,
- "psn": "/dubbox-case/case/dubbox-rest",
- "ni": 0,
- "nn": "172.25.0.4:20880",
- "eii": 2,
- "esi": 0,
- "esn": "/dubbox-case/case/dubbox-rest",
- "rn": 0
+ "pts": [230150, 185809, 24040000], //上级的segment_id 一个应用中的一个实例在链路中产生的编号
+ "pii": 2, //上级的实例编号
+ "psp": 0, //上级的埋点编号span_id
+ "psi": 0, //上级的服务编号(org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()注册后的ID)
+ "psn": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()", //上级的服务名
+ "ni": 0, //上级调用时使用的地址注册后的ID
+ "nn": "172.25.0.4:20880", //上级的地址
+ "eii": 2, //入口的实例编号
+ "esi": 0, //入口的服务编号
+ "esn": "/dubbox-case/case/dubbox-rest", //入口的服务名词
+ "rn": 0 //调用方式(CrossProcess,CrossThread)
}
],
"to": [
diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java
index e7f8501cf..a3cf5b2ef 100644
--- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java
+++ b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java
@@ -20,8 +20,6 @@ package org.apache.skywalking.apm.collector.core.util;
import java.text.SimpleDateFormat;
import java.util.Calendar;
-import java.util.TimeZone;
-import org.apache.skywalking.apm.collector.core.UnexpectedException;
/**
* @author peng-yongsheng
@@ -29,6 +27,7 @@ import org.apache.skywalking.apm.collector.core.UnexpectedException;
public enum TimeBucketUtils {
INSTANCE;
+ private final SimpleDateFormat monthDateFormat = new SimpleDateFormat("yyyyMM");
private final SimpleDateFormat dayDateFormat = new SimpleDateFormat("yyyyMMdd");
private final SimpleDateFormat hourDateFormat = new SimpleDateFormat("yyyyMMddHH");
private final SimpleDateFormat minuteDateFormat = new SimpleDateFormat("yyyyMMddHHmm");
@@ -90,65 +89,7 @@ public enum TimeBucketUtils {
return secondBucket / 100 / 100 / 100 / 100;
}
- public long changeTimeBucket2TimeStamp(String timeBucketType, long timeBucket) {
- if (TimeBucketType.SECOND.name().toLowerCase().equals(timeBucketType.toLowerCase())) {
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.YEAR, Integer.valueOf(String.valueOf(timeBucket).substring(0, 4)));
- calendar.set(Calendar.MONTH, Integer.valueOf(String.valueOf(timeBucket).substring(4, 6)) - 1);
- calendar.set(Calendar.DAY_OF_MONTH, Integer.valueOf(String.valueOf(timeBucket).substring(6, 8)));
- calendar.set(Calendar.HOUR_OF_DAY, Integer.valueOf(String.valueOf(timeBucket).substring(8, 10)));
- calendar.set(Calendar.MINUTE, Integer.valueOf(String.valueOf(timeBucket).substring(10, 12)));
- calendar.set(Calendar.SECOND, Integer.valueOf(String.valueOf(timeBucket).substring(12, 14)));
- return calendar.getTimeInMillis();
- } else if (TimeBucketType.MINUTE.name().toLowerCase().equals(timeBucketType.toLowerCase())) {
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.YEAR, Integer.valueOf(String.valueOf(timeBucket).substring(0, 4)));
- calendar.set(Calendar.MONTH, Integer.valueOf(String.valueOf(timeBucket).substring(4, 6)) - 1);
- calendar.set(Calendar.DAY_OF_MONTH, Integer.valueOf(String.valueOf(timeBucket).substring(6, 8)));
- calendar.set(Calendar.HOUR_OF_DAY, Integer.valueOf(String.valueOf(timeBucket).substring(8, 10)));
- calendar.set(Calendar.MINUTE, Integer.valueOf(String.valueOf(timeBucket).substring(10, 12)));
- return calendar.getTimeInMillis();
- } else {
- throw new UnexpectedException("time bucket type must be second or minute");
- }
- }
-
- public long[] getFiveSecondTimeBuckets(long secondTimeBucket) {
- long timeStamp = changeTimeBucket2TimeStamp(TimeBucketType.SECOND.name(), secondTimeBucket);
- Calendar calendar = Calendar.getInstance();
- calendar.setTimeInMillis(timeStamp);
-
- long[] timeBuckets = new long[5];
- timeBuckets[0] = secondTimeBucket;
- for (int i = 0; i < 4; i++) {
- calendar.add(Calendar.SECOND, -1);
- timeBuckets[i + 1] = getSecondTimeBucket(calendar.getTimeInMillis());
- }
- return timeBuckets;
- }
-
- public long changeToUTCTimeBucket(long timeBucket) {
- String timeBucketStr = String.valueOf(timeBucket);
-
- if (TimeZone.getDefault().getID().equals("GMT+08:00") || timeBucketStr.endsWith("0000")) {
- return timeBucket;
- } else {
- return timeBucket - 800;
- }
- }
-
- public long addSecondForSecondTimeBucket(String timeBucketType, long timeBucket, int second) {
- if (!TimeBucketType.SECOND.name().equals(timeBucketType)) {
- throw new UnexpectedException("time bucket type must be second ");
- }
- Calendar calendar = Calendar.getInstance();
- calendar.setTimeInMillis(changeTimeBucket2TimeStamp(timeBucketType, timeBucket));
- calendar.add(Calendar.SECOND, second);
-
- return getSecondTimeBucket(calendar.getTimeInMillis());
- }
-
public enum TimeBucketType {
- SECOND, MINUTE, HOUR, DAY
+ SECOND, MINUTE, HOUR, DAY, MONTH
}
}
diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtilsTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtilsTest.java
index 35f8d2276..dcc659980 100644
--- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtilsTest.java
+++ b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtilsTest.java
@@ -16,14 +16,10 @@
*
*/
-
package org.apache.skywalking.apm.collector.core.util;
import java.util.TimeZone;
-import org.junit.After;
-import org.junit.Assert;
import org.junit.Before;
-import org.junit.Test;
/**
* @author wu-sheng
@@ -33,25 +29,4 @@ public class TimeBucketUtilsTest {
public void setup() {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
}
-
- @After
- public void teardown() {
-
- }
-
- @Test
- public void testGetInfoFromATimestamp() {
- long timeMillis = 1509521745220L;
- Assert.assertArrayEquals(new long[] {
- 20171101153545L,
- 20171101153544L,
- 20171101153543L,
- 20171101153542L,
- 20171101153541L
- }, TimeBucketUtils.INSTANCE.getFiveSecondTimeBuckets(TimeBucketUtils.INSTANCE.getSecondTimeBucket(timeMillis)));
- Assert.assertEquals(20171101153545L, TimeBucketUtils.INSTANCE.getSecondTimeBucket(timeMillis));
- Assert.assertEquals(201711011535L, TimeBucketUtils.INSTANCE.getMinuteTimeBucket(timeMillis));
- Assert.assertEquals(201711011500L, TimeBucketUtils.INSTANCE.getHourTimeBucket(timeMillis));
- Assert.assertEquals(201711010000L, TimeBucketUtils.INSTANCE.getDayTimeBucket(timeMillis));
- }
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
index be7fe7e14..a2173bd53 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
@@ -18,10 +18,10 @@
package org.apache.skywalking.apm.collector.storage.dao;
-import com.google.gson.JsonArray;
import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.table.register.Instance;
+import org.apache.skywalking.apm.collector.storage.ui.application.Application;
/**
* @author peng-yongsheng
@@ -31,27 +31,9 @@ public interface IInstanceUIDAO extends DAO {
Long instanceLastHeartBeatTime(long applicationInstanceId);
- JsonArray getApplications(long startTime, long endTime);
+ List getApplications(long startTime, long endTime);
Instance getInstance(int instanceId);
List getInstances(int applicationId, long timeBucket);
-
- class Application {
- private final int applicationId;
- private final long count;
-
- public Application(int applicationId, long count) {
- this.applicationId = applicationId;
- this.count = count;
- }
-
- public int getApplicationId() {
- return applicationId;
- }
-
- public long getCount() {
- return count;
- }
- }
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/Alarm.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/Alarm.java
new file mode 100644
index 000000000..62c3dc102
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/Alarm.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.alarm;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Alarm {
+ private List items;
+ private Integer count;
+
+ public List getItems() {
+ return items;
+ }
+
+ public void setItems(List items) {
+ this.items = items;
+ }
+
+ public Integer getCount() {
+ return count;
+ }
+
+ public void setCount(Integer count) {
+ this.count = count;
+ }
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmItem.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmItem.java
new file mode 100644
index 000000000..1523ec931
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmItem.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.alarm;
+
+/**
+ * @author peng-yongsheng
+ */
+public class AlarmItem {
+ private String title;
+ private String content;
+ private String startTime;
+ private AlarmType alertType;
+ private CauseType causeType;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmType.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmType.java
new file mode 100644
index 000000000..75986a5da
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmType.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.alarm;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum AlarmType {
+ APPLICATION,
+ SERVER,
+ SERVICE
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/CauseType.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/CauseType.java
new file mode 100644
index 000000000..908ff6482
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/CauseType.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.alarm;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum CauseType {
+ LOW_SUCCESS_RATE,
+ SLOW_RESPONSE
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/Application.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/Application.java
new file mode 100644
index 000000000..354efb2cf
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/Application.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.application;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Application {
+ private int id;
+ private String name;
+ private int numOfServer;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getNumOfServer() {
+ return numOfServer;
+ }
+
+ public void setNumOfServer(int numOfServer) {
+ this.numOfServer = numOfServer;
+ }
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java
new file mode 100644
index 000000000..0affa2480
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.application;
+
+import org.apache.skywalking.apm.collector.storage.ui.common.Node;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ApplicationNode extends Node {
+
+ private Float sla;
+ private Long callsPerSec;
+ private Integer responseTimePerSec;
+ private Long calls;
+ private Float apdex;
+ private Boolean isAlarm;
+ private Integer numOfServer;
+ private Integer numOfServerAlarm;
+ private Integer numOfServiceAlarm;
+
+ public Float getSla() {
+ return sla;
+ }
+
+ public void setSla(Float sla) {
+ this.sla = sla;
+ }
+
+ public Long getCallsPerSec() {
+ return callsPerSec;
+ }
+
+ public void setCallsPerSec(Long callsPerSec) {
+ this.callsPerSec = callsPerSec;
+ }
+
+ public Integer getResponseTimePerSec() {
+ return responseTimePerSec;
+ }
+
+ public void setResponseTimePerSec(Integer responseTimePerSec) {
+ this.responseTimePerSec = responseTimePerSec;
+ }
+
+ public Long getCalls() {
+ return calls;
+ }
+
+ public void setCalls(Long calls) {
+ this.calls = calls;
+ }
+
+ public Float getApdex() {
+ return apdex;
+ }
+
+ public void setApdex(Float apdex) {
+ this.apdex = apdex;
+ }
+
+ public Boolean getAlarm() {
+ return isAlarm;
+ }
+
+ public void setAlarm(Boolean alarm) {
+ isAlarm = alarm;
+ }
+
+ public Integer getNumOfServer() {
+ return numOfServer;
+ }
+
+ public void setNumOfServer(Integer numOfServer) {
+ this.numOfServer = numOfServer;
+ }
+
+ public Integer getNumOfServerAlarm() {
+ return numOfServerAlarm;
+ }
+
+ public void setNumOfServerAlarm(Integer numOfServerAlarm) {
+ this.numOfServerAlarm = numOfServerAlarm;
+ }
+
+ public Integer getNumOfServiceAlarm() {
+ return numOfServiceAlarm;
+ }
+
+ public void setNumOfServiceAlarm(Integer numOfServiceAlarm) {
+ this.numOfServiceAlarm = numOfServiceAlarm;
+ }
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ConjecturalNode.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ConjecturalNode.java
new file mode 100644
index 000000000..c77c36955
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ConjecturalNode.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.application;
+
+import org.apache.skywalking.apm.collector.storage.ui.common.Node;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ConjecturalNode extends Node {
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java
new file mode 100644
index 000000000..7a388e3ce
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Call {
+ private String source;
+ private String target;
+ private Boolean isAlert;
+ private String callType;
+ private Integer callsPerSec;
+ private Integer responseTimePerSec;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Duration.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Duration.java
new file mode 100644
index 000000000..88ef2fa7f
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Duration.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Duration {
+
+ private String start;
+ private String end;
+ private Step step;
+
+ public String getStart() {
+ return start;
+ }
+
+ public void setStart(String start) {
+ this.start = start;
+ }
+
+ public String getEnd() {
+ return end;
+ }
+
+ public void setEnd(String end) {
+ this.end = end;
+ }
+
+ public Step getStep() {
+ return step;
+ }
+
+ public void setStep(Step step) {
+ this.step = step;
+ }
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java
new file mode 100644
index 000000000..e4d43c379
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class Node {
+ private String id;
+ private String name;
+ private String type;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Pagination.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Pagination.java
new file mode 100644
index 000000000..dc4904807
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Pagination.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Pagination {
+ private Integer pageNum;
+ private Integer pageSize;
+ private Boolean needTotal;
+
+ public Integer getPageNum() {
+ return pageNum;
+ }
+
+ public void setPageNum(Integer pageNum) {
+ this.pageNum = pageNum;
+ }
+
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public void setPageSize(Integer pageSize) {
+ this.pageSize = pageSize;
+ }
+
+ public Boolean getNeedTotal() {
+ return needTotal;
+ }
+
+ public void setNeedTotal(Boolean needTotal) {
+ this.needTotal = needTotal;
+ }
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ResponseTimeTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ResponseTimeTrend.java
new file mode 100644
index 000000000..018892d64
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ResponseTimeTrend.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.common;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ResponseTimeTrend {
+ private List trendList;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/SLATrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/SLATrend.java
new file mode 100644
index 000000000..a6204646b
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/SLATrend.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.common;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class SLATrend {
+ private List trendList;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Step.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Step.java
new file mode 100644
index 000000000..6a4d83a0b
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Step.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.common;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum Step {
+ MONTH,
+ DAY,
+ HOUR,
+ MINUTE,
+ SECOND
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ThroughputTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ThroughputTrend.java
new file mode 100644
index 000000000..e6cf37b99
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ThroughputTrend.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.common;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ThroughputTrend {
+ private List trendList;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java
new file mode 100644
index 000000000..7e3ac2c57
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.common;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Topology {
+ private List nodes;
+ private List calls;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Mutation.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/VisualUserNode.java
similarity index 87%
rename from apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Mutation.java
rename to apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/VisualUserNode.java
index 82f21b500..8207acda2 100644
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Mutation.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/VisualUserNode.java
@@ -16,11 +16,10 @@
*
*/
-package org.apache.skywalking.apm.collector.ui.graphql.common;
+package org.apache.skywalking.apm.collector.storage.ui.common;
/**
* @author peng-yongsheng
*/
-public class Mutation {
- private String version;
+public class VisualUserNode extends Node {
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/AlarmThreshold.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/AlarmThreshold.java
new file mode 100644
index 000000000..e96d329ec
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/AlarmThreshold.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.config;
+
+import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType;
+import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType;
+
+/**
+ * @author peng-yongsheng
+ */
+public class AlarmThreshold {
+ private AlarmType type;
+ private Integer threshold;
+ private CauseType causeType;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholdItem.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholdItem.java
new file mode 100644
index 000000000..e42e70d96
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholdItem.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.config;
+
+import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ExistedAlarmThresholdItem {
+ private Integer threshold;
+ private CauseType causeType;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholds.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholds.java
new file mode 100644
index 000000000..f4d094547
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholds.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.config;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ExistedAlarmThresholds {
+ private List items;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedTTLConfigs.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedTTLConfigs.java
new file mode 100644
index 000000000..32b29cbe2
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedTTLConfigs.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.config;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ExistedTTLConfigs {
+ private List ttl;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTL.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTL.java
new file mode 100644
index 000000000..3da100ed4
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTL.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.config;
+
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TTL {
+ private Step unit;
+ private Integer value;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTLConfigItem.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTLConfigItem.java
new file mode 100644
index 000000000..8984f1616
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTLConfigItem.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.config;
+
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TTLConfigItem {
+ private Step unit;
+ private Integer value;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/AlarmTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/AlarmTrend.java
new file mode 100644
index 000000000..025d27df8
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/AlarmTrend.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.overview;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class AlarmTrend {
+ public List numOfAlarmRate;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ClusterBrief.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ClusterBrief.java
new file mode 100644
index 000000000..41f3b8d5c
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ClusterBrief.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.overview;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ClusterBrief {
+ private int numOfApplication;
+ private int numOfService;
+ private int numOfDatabase;
+ private int numOfCache;
+ private int numOfMQ;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalApp.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalApp.java
new file mode 100644
index 000000000..a1acc0fe7
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalApp.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.overview;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ConjecturalApp {
+ private String name;
+ private int num;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalAppBrief.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalAppBrief.java
new file mode 100644
index 000000000..d220623fa
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalAppBrief.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.overview;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ConjecturalAppBrief {
+ private List apps;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java
new file mode 100644
index 000000000..4d4c7cc93
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.server;
+
+/**
+ * @author peng-yongsheng
+ */
+public class AppServerInfo {
+ private int id;
+ private String name;
+ private int tps;
+ private String os;
+ private String host;
+ private int pid;
+ private String ipv4;
+ private String ipv6;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/CPUTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/CPUTrend.java
new file mode 100644
index 000000000..062cfe213
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/CPUTrend.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.server;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class CPUTrend {
+ private List cost;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/GCTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/GCTrend.java
new file mode 100644
index 000000000..4880a8f44
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/GCTrend.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.server;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class GCTrend {
+ private List youngGC;
+ private List oldGC;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/MemoryTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/MemoryTrend.java
new file mode 100644
index 000000000..bff93d542
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/MemoryTrend.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.server;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class MemoryTrend {
+ private List heap;
+ private List maxHeap;
+ private List noheap;
+ private List maxNoheap;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceInfo.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceInfo.java
new file mode 100644
index 000000000..f33fbd469
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceInfo.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.service;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ServiceInfo {
+ private int id;
+ private String name;
+ private int avgResponseTime;
+ private int tps;
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationNode.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceNode.java
similarity index 71%
rename from apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationNode.java
rename to apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceNode.java
index 45bc62c4a..5d2b0cc95 100644
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationNode.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceNode.java
@@ -16,21 +16,15 @@
*
*/
-package org.apache.skywalking.apm.collector.ui.graphql.application;
+package org.apache.skywalking.apm.collector.storage.ui.service;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Node;
+import org.apache.skywalking.apm.collector.storage.ui.common.Node;
/**
* @author peng-yongsheng
*/
-public class ApplicationNode extends Node {
+public class ServiceNode extends Node {
private Float sla;
- private Long callsPerSec;
- private Integer responseTimePerSec;
private Long calls;
- private Float apdex;
- private Boolean isAlarm;
- private Integer numOfServer;
- private Integer numOfServerAlarm;
private Integer numOfServiceAlarm;
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/BasicTrace.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/BasicTrace.java
new file mode 100644
index 000000000..f8829f128
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/BasicTrace.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.trace;
+
+/**
+ * @author peng-yongsheng
+ */
+public class BasicTrace {
+ private String operationName;
+ private int duration;
+ private String start;
+ private Boolean isError;
+ private String traceId;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/KeyValue.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/KeyValue.java
new file mode 100644
index 000000000..03e1d6857
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/KeyValue.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.trace;
+
+/**
+ * @author peng-yongsheng
+ */
+public class KeyValue {
+ private String key;
+ private String value;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/LogEntity.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/LogEntity.java
new file mode 100644
index 000000000..61855c8ea
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/LogEntity.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.trace;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class LogEntity {
+ private String time;
+ private List data;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Ref.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Ref.java
new file mode 100644
index 000000000..a013e0c1a
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Ref.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.trace;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Ref {
+ private String traceId;
+ private Integer parentSegmentId;
+ private Integer parentSpanId;
+ private RefType type;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/RefType.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/RefType.java
new file mode 100644
index 000000000..00eca2080
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/RefType.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.trace;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum RefType {
+ CROSS_PROCESS,
+ CROSS_THREAD
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Segment.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Segment.java
new file mode 100644
index 000000000..62fc6ab3d
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Segment.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.trace;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Segment {
+ private int segmentId;
+ private String appName;
+ private Boolean isSizeLimited;
+ private List spans;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Span.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Span.java
new file mode 100644
index 000000000..1df21844c
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Span.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.trace;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Span {
+ private String traceId;
+ private String segmentId;
+ private Integer spanId;
+ private Integer parentSpanId;
+ private List][ refs;
+ private String applicationCode;
+ private Long startTime;
+ private Long endTime;
+ private String operationName;
+ private String type;
+ private String peer;
+ private String component;
+ private Boolean isError;
+ private String layer;
+ private List tags;
+ private List logs;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Trace.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Trace.java
new file mode 100644
index 000000000..a9f03964f
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Trace.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.trace;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Trace {
+ private List spans;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceBrief.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceBrief.java
new file mode 100644
index 000000000..1ec1987e3
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceBrief.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.trace;
+
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TraceBrief {
+ private List traces;
+ private Integer total;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java
new file mode 100644
index 000000000..62757804d
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.ui.trace;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.storage.ui.common.Duration;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TraceQueryCondition {
+ private List applicationCodes;
+ private String traceId;
+ private String operationName;
+ private Duration queryDuration;
+ private int minTraceDuration;
+ private int maxTraceDuration;
+ private Boolean topN;
+ private int needTotal;
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/CpuMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/CpuMetricEsUIDAO.java
index 9ca846133..788bc5fc1 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/CpuMetricEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/CpuMetricEsUIDAO.java
@@ -21,7 +21,6 @@ package org.apache.skywalking.apm.collector.storage.es.dao;
import com.google.gson.JsonArray;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.dao.ICpuMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable;
@@ -54,7 +53,7 @@ public class CpuMetricEsUIDAO extends EsDAO implements ICpuMetricUIDAO {
long timeBucket = startTimeBucket;
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
String id = timeBucket + Const.ID_SPLIT + instanceId;
prepareMultiGet.add(CpuMetricTable.TABLE, CpuMetricTable.TABLE_TYPE, id);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/GCMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/GCMetricEsUIDAO.java
index 068955095..75f2e7cc8 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/GCMetricEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/GCMetricEsUIDAO.java
@@ -22,7 +22,6 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.dao.IGCMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable;
@@ -112,7 +111,7 @@ public class GCMetricEsUIDAO extends EsDAO implements IGCMetricUIDAO {
MultiGetRequestBuilder youngPrepareMultiGet = getClient().prepareMultiGet();
long timeBucket = startTimeBucket;
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
String youngId = timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + GCPhrase.NEW_VALUE;
youngPrepareMultiGet.add(GCMetricTable.TABLE, GCMetricTable.TABLE_TYPE, youngId);
}
@@ -132,7 +131,7 @@ public class GCMetricEsUIDAO extends EsDAO implements IGCMetricUIDAO {
MultiGetRequestBuilder oldPrepareMultiGet = getClient().prepareMultiGet();
timeBucket = startTimeBucket;
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
String oldId = timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + GCPhrase.OLD_VALUE;
oldPrepareMultiGet.add(GCMetricTable.TABLE, GCMetricTable.TABLE_TYPE, oldId);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
index 358650a76..7148c1704 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
@@ -18,8 +18,6 @@
package org.apache.skywalking.apm.collector.storage.es.dao;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
import java.util.LinkedList;
import java.util.List;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
@@ -28,6 +26,7 @@ import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
import org.apache.skywalking.apm.collector.storage.table.register.Instance;
import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable;
+import org.apache.skywalking.apm.collector.storage.ui.application.Application;
import org.elasticsearch.action.get.GetRequestBuilder;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.search.SearchRequestBuilder;
@@ -95,7 +94,7 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO {
return heartBeatTime;
}
- @Override public JsonArray getApplications(long startTime, long endTime) {
+ @Override public List getApplications(long startTime, long endTime) {
logger.debug("application list get, start time: {}, end time: {}", startTime, endTime);
SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceTable.TABLE);
searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE);
@@ -108,16 +107,16 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO {
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
Terms genders = searchResponse.getAggregations().get(InstanceTable.COLUMN_APPLICATION_ID);
- JsonArray applications = new JsonArray();
+ List applications = new LinkedList<>();
for (Terms.Bucket applicationsBucket : genders.getBuckets()) {
Integer applicationId = applicationsBucket.getKeyAsNumber().intValue();
logger.debug("applicationId: {}", applicationId);
ValueCount instanceCount = applicationsBucket.getAggregations().get(InstanceTable.COLUMN_INSTANCE_ID);
- JsonObject application = new JsonObject();
- application.addProperty("applicationId", applicationId);
- application.addProperty("instanceCount", instanceCount.getValue());
+ Application application = new Application();
+ application.setId(applicationId);
+ application.setNumOfServer((int)instanceCount.getValue());
applications.add(application);
}
return applications;
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceMetricEsUIDAO.java
index de6657339..591e8e32d 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceMetricEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceMetricEsUIDAO.java
@@ -21,7 +21,6 @@ package org.apache.skywalking.apm.collector.storage.es.dao;
import com.google.gson.JsonArray;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable;
@@ -86,7 +85,7 @@ public class InstanceMetricEsUIDAO extends EsDAO implements IInstanceMetricUIDAO
do {
String id = timeBucket + Const.ID_SPLIT + instanceId;
prepareMultiGet.add(InstanceMetricTable.TABLE, InstanceMetricTable.TABLE_TYPE, id);
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
}
while (timeBucket <= endTimeBucket);
@@ -118,9 +117,9 @@ public class InstanceMetricEsUIDAO extends EsDAO implements IInstanceMetricUIDAO
MultiGetRequestBuilder prepareMultiGet = getClient().prepareMultiGet();
int i = 0;
- long timeBucket;
+ long timeBucket = 0;
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), startTimeBucket, i);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, startTimeBucket, i);
String id = timeBucket + Const.ID_SPLIT + instanceId;
prepareMultiGet.add(InstanceMetricTable.TABLE, InstanceMetricTable.TABLE_TYPE, id);
i++;
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/MemoryMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/MemoryMetricEsUIDAO.java
index 8caa326e7..5bcfc5c69 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/MemoryMetricEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/MemoryMetricEsUIDAO.java
@@ -22,7 +22,6 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable;
@@ -63,7 +62,7 @@ public class MemoryMetricEsUIDAO extends EsDAO implements IMemoryMetricUIDAO {
int i = 0;
long timeBucket = startTimeBucket;
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
String id = timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + isHeap;
prepareMultiGet.add(MemoryMetricTable.TABLE, MemoryMetricTable.TABLE_TYPE, id);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/MemoryPoolMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/MemoryPoolMetricEsUIDAO.java
index dc5b4b333..54a40c738 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/MemoryPoolMetricEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/MemoryPoolMetricEsUIDAO.java
@@ -22,7 +22,6 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
@@ -62,7 +61,7 @@ public class MemoryPoolMetricEsUIDAO extends EsDAO implements IMemoryPoolMetricU
long timeBucket = startTimeBucket;
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
String id = timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + poolType;
prepareMultiGet.add(MemoryPoolMetricTable.TABLE, MemoryPoolMetricTable.TABLE_TYPE, id);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/InstanceRegisterEsDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/InstanceRegisterEsDAO.java
index c9b54be66..460b3e3fe 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/InstanceRegisterEsDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/InstanceRegisterEsDAO.java
@@ -21,6 +21,7 @@ package org.apache.skywalking.apm.collector.storage.es.dao.register;
import java.util.HashMap;
import java.util.Map;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
+import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.dao.register.IInstanceRegisterDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
import org.apache.skywalking.apm.collector.storage.table.register.Instance;
@@ -57,8 +58,8 @@ public class InstanceRegisterEsDAO extends EsDAO implements IInstanceRegisterDAO
source.put(InstanceTable.COLUMN_INSTANCE_ID, instance.getInstanceId());
source.put(InstanceTable.COLUMN_APPLICATION_ID, instance.getApplicationId());
source.put(InstanceTable.COLUMN_AGENT_UUID, instance.getAgentUUID());
- source.put(InstanceTable.COLUMN_REGISTER_TIME, instance.getRegisterTime());
- source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, instance.getHeartBeatTime());
+ source.put(InstanceTable.COLUMN_REGISTER_TIME, TimeBucketUtils.INSTANCE.getSecondTimeBucket(instance.getRegisterTime()));
+ source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, TimeBucketUtils.INSTANCE.getSecondTimeBucket(instance.getHeartBeatTime()));
source.put(InstanceTable.COLUMN_OS_INFO, instance.getOsInfo());
source.put(InstanceTable.COLUMN_ADDRESS_ID, instance.getAddressId());
source.put(InstanceTable.COLUMN_IS_ADDRESS, instance.getIsAddress());
@@ -76,7 +77,7 @@ public class InstanceRegisterEsDAO extends EsDAO implements IInstanceRegisterDAO
updateRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
Map source = new HashMap<>();
- source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, heartbeatTime);
+ source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, TimeBucketUtils.INSTANCE.getSecondTimeBucket(heartbeatTime));
updateRequest.doc(source);
client.update(updateRequest);
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/CpuMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/CpuMetricH2UIDAO.java
index 5f840cb6d..e3ec3d908 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/CpuMetricH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/CpuMetricH2UIDAO.java
@@ -16,7 +16,6 @@
*
*/
-
package org.apache.skywalking.apm.collector.storage.h2.dao;
import com.google.gson.JsonArray;
@@ -24,14 +23,13 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
-import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
+import org.apache.skywalking.apm.collector.core.util.Const;
+import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import org.apache.skywalking.apm.collector.storage.dao.ICpuMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
+import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -68,7 +66,7 @@ public class CpuMetricH2UIDAO extends H2DAO implements ICpuMetricUIDAO {
long timeBucket = startTimeBucket;
List idList = new ArrayList<>();
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
String id = timeBucket + Const.ID_SPLIT + instanceId;
idList.add(id);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/GCMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/GCMetricH2UIDAO.java
index 8cf181341..4c33c3536 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/GCMetricH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/GCMetricH2UIDAO.java
@@ -16,7 +16,6 @@
*
*/
-
package org.apache.skywalking.apm.collector.storage.h2.dao;
import com.google.gson.JsonArray;
@@ -25,14 +24,13 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
+import org.apache.skywalking.apm.collector.client.h2.H2Client;
+import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import org.apache.skywalking.apm.collector.storage.dao.IGCMetricUIDAO;
-import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable;
-import org.apache.skywalking.apm.collector.client.h2.H2Client;
-import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
+import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable;
import org.apache.skywalking.apm.network.proto.GCPhrase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -119,7 +117,7 @@ public class GCMetricH2UIDAO extends H2DAO implements IGCMetricUIDAO {
long timeBucket = startTimeBucket;
List youngIdsList = new ArrayList<>();
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
String youngId = timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + GCPhrase.NEW_VALUE;
youngIdsList.add(youngId);
}
@@ -132,7 +130,7 @@ public class GCMetricH2UIDAO extends H2DAO implements IGCMetricUIDAO {
List oldIdsList = new ArrayList<>();
timeBucket = startTimeBucket;
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
String oldId = timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + GCPhrase.OLD_VALUE;
oldIdsList.add(oldId);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
index 674cbee05..a13ed2a2a 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
@@ -18,8 +18,6 @@
package org.apache.skywalking.apm.collector.storage.h2.dao;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.LinkedList;
@@ -32,6 +30,7 @@ import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
import org.apache.skywalking.apm.collector.storage.table.register.Instance;
import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable;
+import org.apache.skywalking.apm.collector.storage.ui.application.Application;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -88,9 +87,9 @@ public class InstanceH2UIDAO extends H2DAO implements IInstanceUIDAO {
}
@Override
- public JsonArray getApplications(long startTime, long endTime) {
+ public List getApplications(long startTime, long endTime) {
H2Client client = getClient();
- JsonArray applications = new JsonArray();
+ List applications = new LinkedList<>();
String sql = SqlBuilder.buildSql(GET_APPLICATIONS_SQL, InstanceTable.COLUMN_INSTANCE_ID,
InstanceTable.TABLE, InstanceTable.COLUMN_HEARTBEAT_TIME, InstanceTable.COLUMN_APPLICATION_ID);
Object[] params = new Object[] {startTime};
@@ -98,9 +97,9 @@ public class InstanceH2UIDAO extends H2DAO implements IInstanceUIDAO {
while (rs.next()) {
Integer applicationId = rs.getInt(InstanceTable.COLUMN_APPLICATION_ID);
logger.debug("applicationId: {}", applicationId);
- JsonObject application = new JsonObject();
- application.addProperty("applicationId", applicationId);
- application.addProperty("instanceCount", rs.getInt("cnt"));
+ Application application = new Application();
+ application.setId(applicationId);
+ application.setNumOfServer(rs.getInt("cnt"));
applications.add(application);
}
} catch (SQLException | H2ClientException e) {
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceMetricH2UIDAO.java
index 91c23d276..77b3185bb 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceMetricH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceMetricH2UIDAO.java
@@ -16,7 +16,6 @@
*
*/
-
package org.apache.skywalking.apm.collector.storage.h2.dao;
import com.google.gson.JsonArray;
@@ -25,12 +24,11 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
-import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
+import org.apache.skywalking.apm.collector.core.util.Const;
+import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceMetricUIDAO;
+import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -100,7 +98,7 @@ public class InstanceMetricH2UIDAO extends H2DAO implements IInstanceMetricUIDAO
List idList = new ArrayList<>();
do {
String id = timeBucket + Const.ID_SPLIT + instanceId;
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
idList.add(id);
}
while (timeBucket <= endTimeBucket);
@@ -145,7 +143,7 @@ public class InstanceMetricH2UIDAO extends H2DAO implements IInstanceMetricUIDAO
List idList = new ArrayList<>();
do {
String id = timeBucket + Const.ID_SPLIT + instanceId;
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
idList.add(id);
}
while (timeBucket <= endTimeBucket);
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/MemoryMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/MemoryMetricH2UIDAO.java
index 26f7f5644..01e9e5425 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/MemoryMetricH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/MemoryMetricH2UIDAO.java
@@ -16,7 +16,6 @@
*
*/
-
package org.apache.skywalking.apm.collector.storage.h2.dao;
import com.google.gson.JsonArray;
@@ -26,12 +25,11 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
+import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
-import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -76,7 +74,7 @@ public class MemoryMetricH2UIDAO extends H2DAO implements IMemoryMetricUIDAO {
List idList = new ArrayList<>();
long timeBucket = startTimeBucket;
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
String id = timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + isHeap;
idList.add(id);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/MemoryPoolMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/MemoryPoolMetricH2UIDAO.java
index d4a5b11ae..c7aa20427 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/MemoryPoolMetricH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/MemoryPoolMetricH2UIDAO.java
@@ -16,7 +16,6 @@
*
*/
-
package org.apache.skywalking.apm.collector.storage.h2.dao;
import com.google.gson.JsonArray;
@@ -25,11 +24,10 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
+import org.apache.skywalking.apm.collector.core.util.Const;
+import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import org.apache.skywalking.apm.collector.storage.dao.IMemoryPoolMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable;
@@ -76,7 +74,7 @@ public class MemoryPoolMetricH2UIDAO extends H2DAO implements IMemoryPoolMetricU
List idList = new ArrayList<>();
long timeBucket = startTimeBucket;
do {
- timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, 1);
+// timeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, 1);
String id = timeBucket + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + poolType;
idList.add(id);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/InstanceRegisterH2DAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/InstanceRegisterH2DAO.java
index 45edf55a0..e1042f5dc 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/InstanceRegisterH2DAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/InstanceRegisterH2DAO.java
@@ -22,6 +22,7 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
+import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import org.apache.skywalking.apm.collector.storage.dao.register.IInstanceRegisterDAO;
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
@@ -58,8 +59,8 @@ public class InstanceRegisterH2DAO extends H2DAO implements IInstanceRegisterDAO
source.put(InstanceTable.COLUMN_INSTANCE_ID, instance.getInstanceId());
source.put(InstanceTable.COLUMN_APPLICATION_ID, instance.getApplicationId());
source.put(InstanceTable.COLUMN_AGENT_UUID, instance.getAgentUUID());
- source.put(InstanceTable.COLUMN_REGISTER_TIME, instance.getRegisterTime());
- source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, instance.getHeartBeatTime());
+ source.put(InstanceTable.COLUMN_REGISTER_TIME, TimeBucketUtils.INSTANCE.getSecondTimeBucket(instance.getRegisterTime()));
+ source.put(InstanceTable.COLUMN_HEARTBEAT_TIME, TimeBucketUtils.INSTANCE.getSecondTimeBucket(instance.getHeartBeatTime()));
source.put(InstanceTable.COLUMN_OS_INFO, instance.getOsInfo());
source.put(InstanceTable.COLUMN_ADDRESS_ID, instance.getAddressId());
source.put(InstanceTable.COLUMN_IS_ADDRESS, instance.getIsAddress());
@@ -77,7 +78,7 @@ public class InstanceRegisterH2DAO extends H2DAO implements IInstanceRegisterDAO
H2Client client = getClient();
String sql = SqlBuilder.buildSql(UPDATE_HEARTBEAT_TIME_SQL, InstanceTable.TABLE, InstanceTable.COLUMN_HEARTBEAT_TIME,
InstanceTable.COLUMN_ID);
- Object[] params = new Object[] {heartbeatTime, instanceId};
+ Object[] params = new Object[] {TimeBucketUtils.INSTANCE.getSecondTimeBucket(heartbeatTime), instanceId};
try {
client.execute(sql, params);
} catch (H2ClientException e) {
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreator.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreator.java
deleted file mode 100644
index f6df67125..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreator.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql;
-
-import com.coxautodev.graphql.tools.SchemaParser;
-import graphql.GraphQL;
-import graphql.schema.GraphQLSchema;
-import org.apache.skywalking.apm.collector.ui.graphql.alarm.AlarmQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.application.ApplicationQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.application.ConjecturalNode;
-import org.apache.skywalking.apm.collector.ui.graphql.common.VisualUserNode;
-import org.apache.skywalking.apm.collector.ui.graphql.config.ConfigMutation;
-import org.apache.skywalking.apm.collector.ui.graphql.config.ConfigQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.overview.OverViewLayerQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.server.ServerQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.service.ServiceQuery;
-import org.apache.skywalking.apm.collector.ui.graphql.trace.TraceQuery;
-
-/**
- * @author peng-yongsheng
- */
-public class GraphQLCreator {
-
- public GraphQL create() {
- GraphQLSchema schema = SchemaParser.newParser()
- .file("ui-graphql/alarm.graphqls")
- .file("ui-graphql/application-layer.graphqls")
- .file("ui-graphql/common.graphqls")
- .file("ui-graphql/config.graphqls")
- .file("ui-graphql/overview-layer.graphqls")
- .file("ui-graphql/server-layer.graphqls")
- .file("ui-graphql/service-layer.graphqls")
- .file("ui-graphql/trace.graphqls")
- .resolvers(new VersionQuery(), new VersionMutation(), new AlarmQuery(), new ApplicationQuery())
- .resolvers(new OverViewLayerQuery(), new ServerQuery(), new ServiceQuery(), new TraceQuery())
- .resolvers(new ConfigQuery(), new ConfigMutation())
- .dictionary(ConjecturalNode.class, VisualUserNode.class)
- .build()
- .makeExecutableSchema();
-
- return GraphQL.newGraphQL(schema).build();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtils.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtils.java
new file mode 100644
index 000000000..e5f3838f3
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtils.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.graphql.utils;
+
+import java.text.ParseException;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum DurationUtils {
+ INSTANCE;
+
+ public long exchangeToTimeBucket(String dateStr) throws ParseException {
+ dateStr = dateStr.replaceAll("-", "");
+ dateStr = dateStr.replaceAll(" ", "");
+ return Long.valueOf(dateStr);
+ }
+
+ public long monthDurationToSecondTimeBucket(String dateStr) throws ParseException {
+ long month = exchangeToTimeBucket(dateStr);
+ return month * 100 * 100 * 100 * 100;
+ }
+
+ public long dayDurationToSecondTimeBucket(String dateStr) throws ParseException {
+ long month = exchangeToTimeBucket(dateStr);
+ return month * 100 * 100 * 100;
+ }
+
+ public long hourDurationToSecondTimeBucket(String dateStr) throws ParseException {
+ long month = exchangeToTimeBucket(dateStr);
+ return month * 100 * 100;
+ }
+
+ public long minuteDurationToSecondTimeBucket(String dateStr) throws ParseException {
+ long month = exchangeToTimeBucket(dateStr);
+ return month * 100;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreatorTestCase.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtilsTestCase.java
similarity index 78%
rename from apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreatorTestCase.java
rename to apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtilsTestCase.java
index a232eb75e..89d1ee3ba 100644
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/GraphQLCreatorTestCase.java
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtilsTestCase.java
@@ -16,19 +16,18 @@
*
*/
-package org.apache.skywalking.apm.collector.ui.graphql;
+package org.apache.skywalking.apm.collector.ui.graphql.utils;
-import graphql.GraphQL;
+import java.text.ParseException;
+import org.junit.Assert;
import org.junit.Test;
/**
* @author peng-yongsheng
*/
-public class GraphQLCreatorTestCase {
+public class DurationUtilsTestCase {
@Test
- public void test() {
- GraphQLCreator creator = new GraphQLCreator();
- GraphQL graphQL = creator.create();
+ public void test() throws ParseException {
}
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java
index c3876eeb8..d01cda2b1 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java
@@ -34,20 +34,8 @@ import org.apache.skywalking.apm.collector.server.Server;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.ui.UIModule;
import org.apache.skywalking.apm.collector.ui.jetty.handler.GraphQLHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.SegmentTopGetHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.SpanGetHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.TraceDagGetHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.TraceStackGetHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.application.ApplicationsGetHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.instancehealth.InstanceHealthGetHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.instancemetric.InstanceMetricGetOneTimeBucketHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.instancemetric.InstanceMetricGetRangeTimeBucketHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.instancemetric.InstanceOsInfoGetHandler;
import org.apache.skywalking.apm.collector.ui.jetty.handler.naming.UIJettyNamingHandler;
import org.apache.skywalking.apm.collector.ui.jetty.handler.naming.UIJettyNamingListener;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.servicetree.ServiceTreeGetByIdHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.time.AllInstanceLastTimeGetHandler;
-import org.apache.skywalking.apm.collector.ui.jetty.handler.time.OneInstanceLastTimeGetHandler;
/**
* @author peng-yongsheng
@@ -99,19 +87,6 @@ public class UIModuleJettyProvider extends ModuleProvider {
}
private void addHandlers(Server jettyServer) {
- jettyServer.addHandler(new ApplicationsGetHandler(getManager()));
- jettyServer.addHandler(new InstanceHealthGetHandler(getManager()));
- jettyServer.addHandler(new InstanceMetricGetOneTimeBucketHandler(getManager()));
- jettyServer.addHandler(new InstanceMetricGetRangeTimeBucketHandler(getManager()));
- jettyServer.addHandler(new InstanceOsInfoGetHandler(getManager()));
- jettyServer.addHandler(new ServiceTreeGetByIdHandler(getManager()));
- jettyServer.addHandler(new AllInstanceLastTimeGetHandler(getManager()));
- jettyServer.addHandler(new OneInstanceLastTimeGetHandler(getManager()));
- jettyServer.addHandler(new SegmentTopGetHandler(getManager()));
- jettyServer.addHandler(new SpanGetHandler(getManager()));
- jettyServer.addHandler(new TraceDagGetHandler(getManager()));
- jettyServer.addHandler(new TraceStackGetHandler(getManager()));
-
- jettyServer.addHandler(new GraphQLHandler());
+ jettyServer.addHandler(new GraphQLHandler(getManager()));
}
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
index d5e38df4f..3deeb3b1a 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
@@ -18,6 +18,7 @@
package org.apache.skywalking.apm.collector.ui.jetty.handler;
+import com.coxautodev.graphql.tools.SchemaParser;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
@@ -26,30 +27,67 @@ import graphql.ExecutionInput;
import graphql.ExecutionResult;
import graphql.GraphQL;
import graphql.GraphQLError;
+import graphql.schema.GraphQLSchema;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
+import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.core.util.CollectionUtils;
import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.graphql.GraphQLCreator;
+import org.apache.skywalking.apm.collector.storage.ui.application.ApplicationNode;
+import org.apache.skywalking.apm.collector.storage.ui.application.ConjecturalNode;
+import org.apache.skywalking.apm.collector.storage.ui.common.VisualUserNode;
+import org.apache.skywalking.apm.collector.ui.graphql.VersionMutation;
+import org.apache.skywalking.apm.collector.ui.graphql.VersionQuery;
+import org.apache.skywalking.apm.collector.ui.mutation.ConfigMutation;
+import org.apache.skywalking.apm.collector.ui.query.AlarmQuery;
+import org.apache.skywalking.apm.collector.ui.query.ApplicationQuery;
+import org.apache.skywalking.apm.collector.ui.query.ConfigQuery;
+import org.apache.skywalking.apm.collector.ui.query.OverViewLayerQuery;
+import org.apache.skywalking.apm.collector.ui.query.ServerQuery;
+import org.apache.skywalking.apm.collector.ui.query.ServiceQuery;
+import org.apache.skywalking.apm.collector.ui.query.TraceQuery;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author peng-yongsheng
*/
public class GraphQLHandler extends JettyHandler {
+ private final Logger logger = LoggerFactory.getLogger(GraphQLHandler.class);
+
+ private final ModuleManager moduleManager;
private final Gson gson = new Gson();
private final GraphQL graphQL;
private static final String QUERY = "query";
private static final String DATA = "data";
private static final String ERRORS = "errors";
+ private static final String MESSAGE = "message";
- public GraphQLHandler() {
- GraphQLCreator creator = new GraphQLCreator();
- this.graphQL = creator.create();
+ public GraphQLHandler(ModuleManager moduleManager) {
+ this.moduleManager = moduleManager;
+
+ GraphQLSchema schema = SchemaParser.newParser()
+ .file("ui-graphql/alarm.graphqls")
+ .file("ui-graphql/application-layer.graphqls")
+ .file("ui-graphql/common.graphqls")
+ .file("ui-graphql/config.graphqls")
+ .file("ui-graphql/overview-layer.graphqls")
+ .file("ui-graphql/server-layer.graphqls")
+ .file("ui-graphql/service-layer.graphqls")
+ .file("ui-graphql/trace.graphqls")
+ .resolvers(new VersionQuery(), new VersionMutation(), new AlarmQuery(), new ApplicationQuery(moduleManager))
+ .resolvers(new OverViewLayerQuery(moduleManager), new ServerQuery(), new ServiceQuery(), new TraceQuery())
+ .resolvers(new ConfigQuery(), new ConfigMutation())
+ .dictionary(ConjecturalNode.class, VisualUserNode.class, ApplicationNode.class)
+ .build()
+ .makeExecutableSchema();
+
+ this.graphQL = GraphQL.newGraphQL(schema).build();
}
@Override public String pathSpec() {
@@ -73,21 +111,40 @@ public class GraphQLHandler extends JettyHandler {
}
private JsonObject execute(String request) {
- ExecutionInput executionInput = ExecutionInput.newExecutionInput().query(request).build();
- ExecutionResult executionResult = graphQL.execute(executionInput);
+ try {
+ ExecutionInput executionInput = ExecutionInput.newExecutionInput().query(request).build();
+ ExecutionResult executionResult = graphQL.execute(executionInput);
+ Object data = executionResult.getData();
+ List errors = executionResult.getErrors();
- Object data = executionResult.getData();
- List errors = executionResult.getErrors();
+ JsonObject jsonObject = new JsonObject();
+ if (data != null) {
+ jsonObject.addProperty(DATA, data.toString());
+ }
- JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty(DATA, data.toString());
+ if (CollectionUtils.isNotEmpty(errors)) {
+ JsonArray errorArray = new JsonArray();
+ errors.forEach(error -> {
+ JsonObject errorJson = new JsonObject();
+ errorJson.addProperty(MESSAGE, error.getMessage());
+ errorArray.add(errorJson);
+ });
+
+ jsonObject.add(ERRORS, errorArray);
+ }
+
+ return jsonObject;
+ } catch (Throwable e) {
+ logger.error(e.getMessage(), e);
+ JsonObject jsonObject = new JsonObject();
+
+ JsonArray errorArray = new JsonArray();
+ JsonObject errorJson = new JsonObject();
+ errorJson.addProperty(MESSAGE, e.getMessage());
+ errorArray.add(errorJson);
- if (CollectionUtils.isNotEmpty(errors)) {
- String errorJsonStr = gson.toJson(errors, JsonArray.class);
- JsonArray errorArray = gson.fromJson(errorJsonStr, JsonArray.class);
jsonObject.add(ERRORS, errorArray);
+ return jsonObject;
}
-
- return jsonObject;
}
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/SegmentTopGetHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/SegmentTopGetHandler.java
deleted file mode 100644
index 4cdeaf384..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/SegmentTopGetHandler.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler;
-
-import com.google.gson.JsonElement;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.storage.dao.ISegmentCostUIDAO;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.StringUtils;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.service.SegmentTopService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SegmentTopGetHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(SegmentTopGetHandler.class);
-
- @Override public String pathSpec() {
- return "/segment/top";
- }
-
- private final SegmentTopService service;
-
- public SegmentTopGetHandler(ModuleManager moduleManager) {
- this.service = new SegmentTopService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- if (!req.getParameterMap().containsKey("startTime") || !req.getParameterMap().containsKey("endTime") || !req.getParameterMap().containsKey("from") || !req.getParameterMap().containsKey("limit")) {
- throw new ArgumentsParseException("the request parameter must contains startTime, endTime, from, limit");
- }
-
- if (logger.isDebugEnabled()) {
- logger.debug("startTime: {}, endTime: {}, from: {}", req.getParameter("startTime"), req.getParameter("endTime"), req.getParameter("from"));
- }
-
- long startTime;
- try {
- startTime = Long.valueOf(req.getParameter("startTime"));
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("the request parameter startTime must be a long");
- }
-
- long endTime;
- try {
- endTime = Long.valueOf(req.getParameter("endTime"));
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("the request parameter endTime must be a long");
- }
-
- int from;
- try {
- from = Integer.valueOf(req.getParameter("from"));
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("the request parameter from must be an integer");
- }
-
- int limit;
- try {
- limit = Integer.valueOf(req.getParameter("limit"));
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("the request parameter from must be an integer");
- }
-
- int minCost = -1;
- if (req.getParameterMap().containsKey("minCost")) {
- minCost = Integer.valueOf(req.getParameter("minCost"));
- }
- int maxCost = -1;
- if (req.getParameterMap().containsKey("maxCost")) {
- maxCost = Integer.valueOf(req.getParameter("maxCost"));
- }
-
- String globalTraceId = null;
- if (req.getParameterMap().containsKey("globalTraceId")) {
- globalTraceId = req.getParameter("globalTraceId");
- }
-
- String operationName = null;
- if (req.getParameterMap().containsKey("operationName")) {
- operationName = req.getParameter("operationName");
- }
-
- int applicationId;
- try {
- applicationId = Integer.valueOf(req.getParameter("applicationId"));
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("the request parameter applicationId must be a int");
- }
-
- ISegmentCostUIDAO.Error error;
- String errorStr = req.getParameter("error");
- if (StringUtils.isNotEmpty(errorStr)) {
- if ("true".equals(errorStr)) {
- error = ISegmentCostUIDAO.Error.True;
- } else if ("false".equals(errorStr)) {
- error = ISegmentCostUIDAO.Error.False;
- } else {
- error = ISegmentCostUIDAO.Error.All;
- }
- } else {
- error = ISegmentCostUIDAO.Error.All;
- }
-
- ISegmentCostUIDAO.Sort sort = ISegmentCostUIDAO.Sort.Cost;
- if (req.getParameterMap().containsKey("sort")) {
- String sortStr = req.getParameter("sort");
- if (sortStr.toLowerCase().equals(ISegmentCostUIDAO.Sort.Time.name().toLowerCase())) {
- sort = ISegmentCostUIDAO.Sort.Time;
- }
- }
-
- return service.loadTop(startTime, endTime, minCost, maxCost, operationName, globalTraceId, error, applicationId, limit, from, sort);
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/SpanGetHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/SpanGetHandler.java
deleted file mode 100644
index bb14254b5..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/SpanGetHandler.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler;
-
-import com.google.gson.JsonElement;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.service.SpanService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class SpanGetHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(SpanGetHandler.class);
-
- @Override public String pathSpec() {
- return "/span/spanId";
- }
-
- private final SpanService service;
-
- public SpanGetHandler(ModuleManager moduleManager) {
- this.service = new SpanService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- String segmentId = req.getParameter("segmentId");
- String spanIdStr = req.getParameter("spanId");
- logger.debug("segmentSpanId: {}, spanIdStr: {}", segmentId, spanIdStr);
-
- int spanId;
- try {
- spanId = Integer.parseInt(spanIdStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("span id must be integer");
- }
-
- return service.load(segmentId, spanId);
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/TraceDagGetHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/TraceDagGetHandler.java
deleted file mode 100644
index 34143ce3b..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/TraceDagGetHandler.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler;
-
-import com.google.gson.JsonElement;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.service.TraceDagService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceDagGetHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(TraceDagGetHandler.class);
-
- @Override public String pathSpec() {
- return "/traceDag";
- }
-
- private final TraceDagService service;
-
- public TraceDagGetHandler(ModuleManager moduleManager) {
- this.service = new TraceDagService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- if (!req.getParameterMap().containsKey("startTime") || !req.getParameterMap().containsKey("endTime")) {
- throw new ArgumentsParseException("the request parameter must contains startTime, endTime");
- }
-
- String startTimeStr = req.getParameter("startTime");
- String endTimeStr = req.getParameter("endTime");
- logger.debug("startTime: {}, endTimeStr: {}", startTimeStr, endTimeStr);
-
- long startTime;
- try {
- startTime = Long.valueOf(req.getParameter("startTime"));
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("the request parameter startTime must be a long");
- }
-
- long endTime;
- try {
- endTime = Long.valueOf(req.getParameter("endTime"));
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("the request parameter endTime must be a long");
- }
-
- return service.load(startTime, endTime);
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/TraceStackGetHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/TraceStackGetHandler.java
deleted file mode 100644
index 368348abd..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/TraceStackGetHandler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler;
-
-import com.google.gson.JsonElement;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.service.TraceStackService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceStackGetHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(TraceStackGetHandler.class);
-
- @Override public String pathSpec() {
- return "/traceStack/globalTraceId";
- }
-
- private final TraceStackService service;
-
- public TraceStackGetHandler(ModuleManager moduleManager) {
- this.service = new TraceStackService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- String globalTraceId = req.getParameter("globalTraceId");
- logger.debug("globalTraceId: {}", globalTraceId);
-
- return service.load(globalTraceId);
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/application/ApplicationsGetHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/application/ApplicationsGetHandler.java
deleted file mode 100644
index 51ddcc6ce..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/application/ApplicationsGetHandler.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler.application;
-
-import com.google.gson.JsonElement;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.ui.service.ApplicationService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationsGetHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(ApplicationsGetHandler.class);
-
- @Override public String pathSpec() {
- return "/applications";
- }
-
- private final ApplicationService applicationService;
-
- public ApplicationsGetHandler(ModuleManager moduleManager) {
- this.applicationService = new ApplicationService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- if (!req.getParameterMap().containsKey("startTime") || !req.getParameterMap().containsKey("endTime")) {
- throw new ArgumentsParseException("must contains startTime. endTime parameter");
- }
-
- String startTimeStr = req.getParameter("startTime");
- String endTimeStr = req.getParameter("endTime");
- logger.debug("applications getApplicationIdByCode start time: {}, end time: {}", startTimeStr, endTimeStr);
-
- long startTime;
- try {
- startTime = Long.parseLong(startTimeStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("start time must be long");
- }
-
- long endTime;
- try {
- endTime = Long.parseLong(endTimeStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("end time must be long");
- }
-
- return applicationService.getApplications(startTime, endTime);
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancehealth/InstanceHealthGetHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancehealth/InstanceHealthGetHandler.java
deleted file mode 100644
index 008f4e143..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancehealth/InstanceHealthGetHandler.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler.instancehealth;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.service.InstanceHealthService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceHealthGetHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceHealthGetHandler.class);
-
- @Override public String pathSpec() {
- return "/instance/health/applicationId";
- }
-
- private final InstanceHealthService service;
-
- public InstanceHealthGetHandler(ModuleManager moduleManager) {
- this.service = new InstanceHealthService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- String timeBucketStr = req.getParameter("timeBucket");
- String[] applicationIdsStr = req.getParameterValues("applicationIds");
- logger.debug("instance health getApplicationIdByCode timeBucket: {}, applicationIdsStr: {}", timeBucketStr, applicationIdsStr);
-
- long timeBucket;
- try {
- timeBucket = Long.parseLong(timeBucketStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("timestamp must be long");
- }
-
- int[] applicationIds = new int[applicationIdsStr.length];
- for (int i = 0; i < applicationIdsStr.length; i++) {
- try {
- applicationIds[i] = Integer.parseInt(applicationIdsStr[i]);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("application id must be integer");
- }
- }
-
- JsonObject response = new JsonObject();
- response.addProperty("timeBucket", timeBucket);
- JsonArray appInstances = new JsonArray();
- response.add("appInstances", appInstances);
-
- for (int applicationId : applicationIds) {
- appInstances.add(service.getInstances(timeBucket, applicationId));
- }
- return response;
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceMetricGetOneTimeBucketHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceMetricGetOneTimeBucketHandler.java
deleted file mode 100644
index 15e73ce93..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceMetricGetOneTimeBucketHandler.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler.instancemetric;
-
-import com.google.gson.JsonElement;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.service.InstanceJVMService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceMetricGetOneTimeBucketHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceMetricGetOneTimeBucketHandler.class);
-
- @Override public String pathSpec() {
- return "/instance/jvm/instanceId/oneBucket";
- }
-
- private final InstanceJVMService service;
-
- public InstanceMetricGetOneTimeBucketHandler(ModuleManager moduleManager) {
- this.service = new InstanceJVMService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- String timeBucketStr = req.getParameter("timeBucket");
- String instanceIdStr = req.getParameter("instanceId");
- String[] metricTypes = req.getParameterValues("metricTypes");
-
- logger.debug("instance jvm metric getApplicationIdByCode timeBucket: {}, instance id: {}, metric types: {}", timeBucketStr, instanceIdStr, metricTypes);
-
- long timeBucket;
- try {
- timeBucket = Long.parseLong(timeBucketStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("timeBucket must be long");
- }
-
- int instanceId;
- try {
- instanceId = Integer.parseInt(instanceIdStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("instance id must be integer");
- }
-
- if (metricTypes.length == 0) {
- throw new ArgumentsParseException("at least one metric type");
- }
-
- Set metricTypeSet = new LinkedHashSet<>();
- for (String metricType : metricTypes) {
- metricTypeSet.add(metricType);
- }
-
- return service.getInstanceJvmMetric(instanceId, metricTypeSet, timeBucket);
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceMetricGetRangeTimeBucketHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceMetricGetRangeTimeBucketHandler.java
deleted file mode 100644
index a78c63dca..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceMetricGetRangeTimeBucketHandler.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler.instancemetric;
-
-import com.google.gson.JsonElement;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.service.InstanceJVMService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceMetricGetRangeTimeBucketHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceMetricGetRangeTimeBucketHandler.class);
-
- @Override public String pathSpec() {
- return "/instance/jvm/instanceId/rangeBucket";
- }
-
- private final InstanceJVMService service;
-
- public InstanceMetricGetRangeTimeBucketHandler(ModuleManager moduleManager) {
- this.service = new InstanceJVMService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- String startTimeBucketStr = req.getParameter("startTimeBucket");
- String endTimeBucketStr = req.getParameter("endTimeBucket");
- String instanceIdStr = req.getParameter("instanceId");
- String[] metricTypes = req.getParameterValues("metricTypes");
-
- logger.debug("instance jvm metric getApplicationIdByCode start timeBucket: {}, end timeBucket:{} , instance id: {}, metric types: {}", startTimeBucketStr, endTimeBucketStr, instanceIdStr, metricTypes);
-
- long startTimeBucket;
- try {
- startTimeBucket = Long.parseLong(startTimeBucketStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("start timeBucket must be long");
- }
-
- long endTimeBucket;
- try {
- endTimeBucket = Long.parseLong(endTimeBucketStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("end timeBucket must be long");
- }
-
- int instanceId;
- try {
- instanceId = Integer.parseInt(instanceIdStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("instance id must be integer");
- }
-
- if (metricTypes.length == 0) {
- throw new ArgumentsParseException("at least one metric type");
- }
-
- Set metricTypeSet = new LinkedHashSet<>();
- for (String metricType : metricTypes) {
- metricTypeSet.add(metricType);
- }
-
- return service.getInstanceJvmMetrics(instanceId, metricTypeSet, startTimeBucket, endTimeBucket);
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceOsInfoGetHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceOsInfoGetHandler.java
deleted file mode 100644
index 3b035f8eb..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/instancemetric/InstanceOsInfoGetHandler.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler.instancemetric;
-
-import com.google.gson.JsonElement;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.service.InstanceJVMService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class InstanceOsInfoGetHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(InstanceOsInfoGetHandler.class);
-
- @Override public String pathSpec() {
- return "/instance/os/instanceId";
- }
-
- private final InstanceJVMService service;
-
- public InstanceOsInfoGetHandler(ModuleManager moduleManager) {
- this.service = new InstanceJVMService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- String instanceIdStr = req.getParameter("instanceId");
- logger.debug("instance os info getApplicationIdByCode, instance id: {}", instanceIdStr);
-
- int instanceId;
- try {
- instanceId = Integer.parseInt(instanceIdStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("instance id must be integer");
- }
-
- return service.getInstanceOsInfo(instanceId);
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/servicetree/ServiceTreeGetByIdHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/servicetree/ServiceTreeGetByIdHandler.java
deleted file mode 100644
index 27ea8149f..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/servicetree/ServiceTreeGetByIdHandler.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler.servicetree;
-
-import com.google.gson.JsonElement;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.ui.service.ServiceTreeService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceTreeGetByIdHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(ServiceTreeGetByIdHandler.class);
-
- @Override public String pathSpec() {
- return "/service/tree/entryServiceId";
- }
-
- private final ServiceTreeService service;
-
- public ServiceTreeGetByIdHandler(ModuleManager moduleManager) {
- this.service = new ServiceTreeService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- if (!req.getParameterMap().containsKey("entryServiceId") || !req.getParameterMap().containsKey("startTime") || !req.getParameterMap().containsKey("endTime")) {
- throw new ArgumentsParseException("must contains parameters: entryServiceId, startTime, endTime");
- }
-
- String entryServiceIdStr = req.getParameter("entryServiceId");
- String startTimeStr = req.getParameter("startTime");
- String endTimeStr = req.getParameter("endTime");
- logger.debug("service entry getApplicationIdByCode entryServiceId: {}, startTime: {}, endTime: {}", entryServiceIdStr, startTimeStr, endTimeStr);
-
- int entryServiceId;
- try {
- entryServiceId = Integer.parseInt(entryServiceIdStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("entry service id must be integer");
- }
-
- long startTime;
- try {
- startTime = Long.parseLong(startTimeStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("start time must be long");
- }
-
- long endTime;
- try {
- endTime = Long.parseLong(endTimeStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("end time must be long");
- }
-
- return service.loadServiceTree(entryServiceId, startTime, endTime);
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/time/AllInstanceLastTimeGetHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/time/AllInstanceLastTimeGetHandler.java
deleted file mode 100644
index f0ea90d7a..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/time/AllInstanceLastTimeGetHandler.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler.time;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import java.util.Calendar;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.service.TimeSynchronousService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class AllInstanceLastTimeGetHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(AllInstanceLastTimeGetHandler.class);
-
- @Override public String pathSpec() {
- return "/time/allInstance";
- }
-
- private final TimeSynchronousService service;
-
- public AllInstanceLastTimeGetHandler(ModuleManager moduleManager) {
- this.service = new TimeSynchronousService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- Long timeBucket = service.allInstanceLastTime();
- logger.debug("all instance last time: {}", timeBucket);
-
- if (timeBucket == 0) {
- timeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis());
- }
- Calendar calendar = Calendar.getInstance();
- calendar.setTimeInMillis(TimeBucketUtils.INSTANCE.changeTimeBucket2TimeStamp(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket));
- calendar.add(Calendar.SECOND, -5);
- timeBucket = calendar.getTimeInMillis();
-
- JsonObject timeJson = new JsonObject();
- timeJson.addProperty("timeBucket", TimeBucketUtils.INSTANCE.getSecondTimeBucket(timeBucket));
- return timeJson;
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/time/OneInstanceLastTimeGetHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/time/OneInstanceLastTimeGetHandler.java
deleted file mode 100644
index 89aaa7093..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/time/OneInstanceLastTimeGetHandler.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.jetty.handler.time;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
-import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
-import org.apache.skywalking.apm.collector.ui.service.TimeSynchronousService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class OneInstanceLastTimeGetHandler extends JettyHandler {
-
- private final Logger logger = LoggerFactory.getLogger(OneInstanceLastTimeGetHandler.class);
-
- @Override public String pathSpec() {
- return "/time/oneInstance";
- }
-
- private final TimeSynchronousService service;
-
- public OneInstanceLastTimeGetHandler(ModuleManager moduleManager) {
- this.service = new TimeSynchronousService(moduleManager);
- }
-
- @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
- String instanceIdStr = req.getParameter("instanceId");
- logger.debug("instanceId: {}", instanceIdStr);
-
- int instanceId;
- try {
- instanceId = Integer.parseInt(instanceIdStr);
- } catch (NumberFormatException e) {
- throw new ArgumentsParseException("application instance id must be integer");
- }
-
- Long time = service.instanceLastTime(instanceId);
- logger.debug("application instance id: {}, instance last time: {}", instanceId, time);
- JsonObject timeJson = new JsonObject();
- timeJson.addProperty("timeBucket", time);
- return timeJson;
- }
-
- @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/mutation/ConfigMutation.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/mutation/ConfigMutation.java
new file mode 100644
index 000000000..ab2d80a09
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/mutation/ConfigMutation.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.mutation;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.storage.ui.config.AlarmThreshold;
+import org.apache.skywalking.apm.collector.storage.ui.config.TTLConfigItem;
+import org.apache.skywalking.apm.collector.ui.graphql.Mutation;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ConfigMutation implements Mutation {
+
+ public Boolean setDataTTLConfigs(List ttl) {
+ return null;
+ }
+
+ public Boolean setAlarmThreshold(List thresholds) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/AlarmQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/AlarmQuery.java
new file mode 100644
index 000000000..820b41a19
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/AlarmQuery.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.query;
+
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm;
+import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType;
+import org.apache.skywalking.apm.collector.storage.ui.common.Duration;
+import org.apache.skywalking.apm.collector.storage.ui.common.Pagination;
+
+/**
+ * @author peng-yongsheng
+ */
+public class AlarmQuery implements Query {
+
+ public Alarm loadAlertList(String keyword, AlarmType alarmType, Duration duration, Pagination pagination) {
+ Alarm alarm = new Alarm();
+ alarm.setCount(0);
+ return alarm;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java
new file mode 100644
index 000000000..b8f09c622
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.query;
+
+import java.text.ParseException;
+import java.util.List;
+import org.apache.skywalking.apm.collector.core.module.ModuleManager;
+import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
+import org.apache.skywalking.apm.collector.storage.ui.application.Application;
+import org.apache.skywalking.apm.collector.storage.ui.common.Duration;
+import org.apache.skywalking.apm.collector.storage.ui.common.Topology;
+import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
+import org.apache.skywalking.apm.collector.storage.ui.service.ServiceInfo;
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.ui.graphql.utils.DurationUtils;
+import org.apache.skywalking.apm.collector.ui.service.ApplicationService;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ApplicationQuery implements Query {
+
+ private final ModuleManager moduleManager;
+ private ApplicationService applicationService;
+
+ public ApplicationQuery(ModuleManager moduleManager) {
+ this.moduleManager = moduleManager;
+ }
+
+ private ApplicationService getApplicationService() {
+ if (ObjectUtils.isEmpty(applicationService)) {
+ this.applicationService = new ApplicationService(moduleManager);
+ }
+ return applicationService;
+ }
+
+ public List getAllApplication(Duration duration) throws ParseException {
+ long start = 0;
+ long end = 0;
+
+ switch (duration.getStep()) {
+ case MONTH:
+ start = DurationUtils.INSTANCE.monthDurationToSecondTimeBucket(duration.getStart());
+ end = DurationUtils.INSTANCE.monthDurationToSecondTimeBucket(duration.getEnd());
+ break;
+ case DAY:
+ start = DurationUtils.INSTANCE.dayDurationToSecondTimeBucket(duration.getStart());
+ end = DurationUtils.INSTANCE.dayDurationToSecondTimeBucket(duration.getEnd());
+ break;
+ case HOUR:
+ start = DurationUtils.INSTANCE.hourDurationToSecondTimeBucket(duration.getStart());
+ end = DurationUtils.INSTANCE.hourDurationToSecondTimeBucket(duration.getEnd());
+ break;
+ case MINUTE:
+ start = DurationUtils.INSTANCE.minuteDurationToSecondTimeBucket(duration.getStart());
+ end = DurationUtils.INSTANCE.minuteDurationToSecondTimeBucket(duration.getEnd());
+ break;
+ case SECOND:
+ start = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart());
+ end = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd());
+ break;
+ }
+
+ return getApplicationService().getApplications(start, end);
+ }
+
+ public Topology getApplicationTopology(int applicationId, Duration duration) {
+ return null;
+ }
+
+ public List getSlowService(int applicationId, Duration duration, Integer top) {
+ return null;
+ }
+
+ public List getServerThroughput(int applicationId, Duration duration, Integer top) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ConfigQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ConfigQuery.java
new file mode 100644
index 000000000..ce1d8d31f
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ConfigQuery.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.query;
+
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType;
+import org.apache.skywalking.apm.collector.storage.ui.config.ExistedAlarmThresholds;
+import org.apache.skywalking.apm.collector.storage.ui.config.ExistedTTLConfigs;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ConfigQuery implements Query {
+
+ public ExistedTTLConfigs queryAllDataTTLConfigs() {
+ return null;
+ }
+
+ public ExistedAlarmThresholds queryAlarmThresholds(AlarmType alarmType) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java
new file mode 100644
index 000000000..539b3f1b9
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.query;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.core.module.ModuleManager;
+import org.apache.skywalking.apm.collector.storage.ui.common.Duration;
+import org.apache.skywalking.apm.collector.storage.ui.common.Topology;
+import org.apache.skywalking.apm.collector.storage.ui.overview.AlarmTrend;
+import org.apache.skywalking.apm.collector.storage.ui.overview.ClusterBrief;
+import org.apache.skywalking.apm.collector.storage.ui.overview.ConjecturalAppBrief;
+import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
+import org.apache.skywalking.apm.collector.storage.ui.service.ServiceInfo;
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+
+/**
+ * @author peng-yongsheng
+ */
+public class OverViewLayerQuery implements Query {
+
+ public OverViewLayerQuery(ModuleManager moduleManager) {
+ }
+
+ public Topology getClusterTopology(Duration duration) {
+ return null;
+ }
+
+ public ClusterBrief getClusterBrief(Duration duration) {
+ return null;
+ }
+
+ public AlarmTrend getAlarmTrend(Duration duration) {
+ return null;
+ }
+
+ public ConjecturalAppBrief getConjecturalApps(Duration duration) {
+ return null;
+ }
+
+ public List getTopNSlowService(Duration duration, int topN) {
+ return null;
+ }
+
+ public List getTopNServerThroughput(Duration duration, int topN) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java
new file mode 100644
index 000000000..7871337dc
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.query;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.storage.ui.common.Duration;
+import org.apache.skywalking.apm.collector.storage.ui.common.ResponseTimeTrend;
+import org.apache.skywalking.apm.collector.storage.ui.common.ThroughputTrend;
+import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
+import org.apache.skywalking.apm.collector.storage.ui.server.CPUTrend;
+import org.apache.skywalking.apm.collector.storage.ui.server.GCTrend;
+import org.apache.skywalking.apm.collector.storage.ui.server.MemoryTrend;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ServerQuery implements Query {
+ public List searchServer(String keyword, Duration duration) {
+ return null;
+ }
+
+ public List getAllServer(String applicationId, Duration duration) {
+ return null;
+ }
+
+ public ResponseTimeTrend getServerResponseTimeTrend(int serverId, Duration duration) {
+ return null;
+ }
+
+ public ThroughputTrend getServerTPSTrend(int serverId, Duration duration) {
+ return null;
+ }
+
+ public CPUTrend getCPUTrend(int serverId, Duration duration) {
+ return null;
+ }
+
+ public GCTrend getGCTrend(int serverId, Duration duration) {
+ return null;
+ }
+
+ public MemoryTrend getMemoryTrend(int serverId, Duration duration) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServiceQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServiceQuery.java
new file mode 100644
index 000000000..ef11c1066
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServiceQuery.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.query;
+
+import java.util.List;
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.storage.ui.common.Duration;
+import org.apache.skywalking.apm.collector.storage.ui.common.ResponseTimeTrend;
+import org.apache.skywalking.apm.collector.storage.ui.common.SLATrend;
+import org.apache.skywalking.apm.collector.storage.ui.common.ThroughputTrend;
+import org.apache.skywalking.apm.collector.storage.ui.common.Topology;
+import org.apache.skywalking.apm.collector.storage.ui.service.ServiceNode;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ServiceQuery implements Query {
+ public List searchService(String keyword, Duration duration, Integer topN) {
+ return null;
+ }
+
+ public ResponseTimeTrend getServiceResponseTimeTrend(int serviceId, Duration duration) {
+ return null;
+ }
+
+ public ThroughputTrend getServiceTPSTrend(int serviceId, Duration duration) {
+ return null;
+ }
+
+ public SLATrend getServiceSLATrend(int serviceId, Duration duration) {
+ return null;
+ }
+
+ public Topology getServiceTopology(int serviceId, Duration duration) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java
new file mode 100644
index 000000000..32eaa7291
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.query;
+
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.storage.ui.trace.Trace;
+import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief;
+import org.apache.skywalking.apm.collector.storage.ui.trace.TraceQueryCondition;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TraceQuery implements Query {
+ public TraceBrief queryBasicTraces(TraceQueryCondition condition) {
+ return null;
+ }
+
+ public Trace queryTrace(String id) {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java
index 1807fc321..d96317dd5 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java
@@ -16,16 +16,15 @@
*
*/
-
package org.apache.skywalking.apm.collector.ui.service;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
+import java.util.List;
import org.apache.skywalking.apm.collector.cache.CacheModule;
import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
+import org.apache.skywalking.apm.collector.storage.ui.application.Application;
/**
* @author peng-yongsheng
@@ -40,14 +39,12 @@ public class ApplicationService {
this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
}
- public JsonArray getApplications(long startTime, long endTime) {
- JsonArray applications = instanceDAO.getApplications(startTime, endTime);
+ public List getApplications(long startTime, long endTime) {
+ List applications = instanceDAO.getApplications(startTime, endTime);
- applications.forEach(jsonElement -> {
- JsonObject application = jsonElement.getAsJsonObject();
- int applicationId = application.get("applicationId").getAsInt();
- String applicationCode = applicationCacheService.getApplicationCodeById(applicationId);
- application.addProperty("applicationCode", applicationCode);
+ applications.forEach(application -> {
+ String applicationCode = applicationCacheService.getApplicationCodeById(application.getId());
+ application.setName(applicationCode);
});
return applications;
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/InstanceHealthService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/InstanceHealthService.java
index 65492c8b1..98ba79884 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/InstanceHealthService.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/InstanceHealthService.java
@@ -16,19 +16,15 @@
*
*/
-
package org.apache.skywalking.apm.collector.ui.service;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
-import java.util.List;
import org.apache.skywalking.apm.collector.cache.CacheModule;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.dao.IGCMetricUIDAO;
-import org.apache.skywalking.apm.collector.storage.table.register.Instance;
import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
-import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
+import org.apache.skywalking.apm.collector.core.module.ModuleManager;
import org.apache.skywalking.apm.collector.storage.StorageModule;
+import org.apache.skywalking.apm.collector.storage.dao.IGCMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
import org.slf4j.Logger;
@@ -56,58 +52,58 @@ public class InstanceHealthService {
public JsonObject getInstances(long timeBucket, int applicationId) {
JsonObject response = new JsonObject();
- long[] timeBuckets = TimeBucketUtils.INSTANCE.getFiveSecondTimeBuckets(timeBucket);
- long halfHourBeforeTimeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket, -60 * 30);
- List instanceList = instanceDAO.getInstances(applicationId, halfHourBeforeTimeBucket);
+// long[] timeBuckets = TimeBucketUtils.INSTANCE.getFiveSecondTimeBuckets(timeBucket);
+// long halfHourBeforeTimeBucket = TimeBucketUtils.INSTANCE.addSecondForSecondTimeBucket(TimeBucketUtils.TimeBucketType.SECOND, timeBucket, -60 * 30);
+// List instanceList = instanceDAO.getInstances(applicationId, halfHourBeforeTimeBucket);
JsonArray instances = new JsonArray();
response.add("instances", instances);
- instanceList.forEach(instance -> {
- response.addProperty("applicationCode", applicationCacheService.getApplicationCodeById(applicationId));
- response.addProperty("applicationId", applicationId);
+// instanceList.forEach(instance -> {
+// response.addProperty("applicationCode", applicationCacheService.getApplicationCodeById(applicationId));
+// response.addProperty("applicationId", applicationId);
+//
+// IInstanceMetricUIDAO.InstanceMetric performance = instanceMetricUIDAO.get(timeBuckets, instance.getInstanceId());
+//
+// JsonObject instanceJson = new JsonObject();
+// instanceJson.addProperty("id", instance.getInstanceId());
+// if (performance != null) {
+// instanceJson.addProperty("tps", performance.getCalls());
+// } else {
+// instanceJson.addProperty("tps", 0);
+// }
+//
+// int avg = 0;
+// if (performance != null && performance.getCalls() != 0) {
+// avg = (int)(performance.getDurationSum() / performance.getCalls());
+// }
+// instanceJson.addProperty("avg", avg);
+//
+// if (avg > 5000) {
+// instanceJson.addProperty("healthLevel", 0);
+// } else if (avg > 3000 && avg <= 5000) {
+// instanceJson.addProperty("healthLevel", 1);
+// } else if (avg > 1000 && avg <= 3000) {
+// instanceJson.addProperty("healthLevel", 2);
+// } else {
+// instanceJson.addProperty("healthLevel", 3);
+// }
- IInstanceMetricUIDAO.InstanceMetric performance = instanceMetricUIDAO.get(timeBuckets, instance.getInstanceId());
-
- JsonObject instanceJson = new JsonObject();
- instanceJson.addProperty("id", instance.getInstanceId());
- if (performance != null) {
- instanceJson.addProperty("tps", performance.getCalls());
- } else {
- instanceJson.addProperty("tps", 0);
- }
-
- int avg = 0;
- if (performance != null && performance.getCalls() != 0) {
- avg = (int)(performance.getDurationSum() / performance.getCalls());
- }
- instanceJson.addProperty("avg", avg);
-
- if (avg > 5000) {
- instanceJson.addProperty("healthLevel", 0);
- } else if (avg > 3000 && avg <= 5000) {
- instanceJson.addProperty("healthLevel", 1);
- } else if (avg > 1000 && avg <= 3000) {
- instanceJson.addProperty("healthLevel", 2);
- } else {
- instanceJson.addProperty("healthLevel", 3);
- }
-
- long heartBeatTime = TimeBucketUtils.INSTANCE.changeTimeBucket2TimeStamp(TimeBucketUtils.TimeBucketType.SECOND.name(), instance.getHeartBeatTime());
- long currentTime = TimeBucketUtils.INSTANCE.changeTimeBucket2TimeStamp(TimeBucketUtils.TimeBucketType.SECOND.name(), timeBucket);
-
- if (currentTime - heartBeatTime < 1000 * 60 * 2) {
- instanceJson.addProperty("status", 0);
- } else {
- instanceJson.addProperty("status", 1);
- }
-
- IGCMetricUIDAO.GCCount gcCount = gcMetricDAO.getGCCount(timeBuckets, instance.getInstanceId());
- instanceJson.addProperty("ygc", gcCount.getYoung());
- instanceJson.addProperty("ogc", gcCount.getOld());
-
- instances.add(instanceJson);
- });
+// long heartBeatTime = TimeBucketUtils.INSTANCE.changeTimeBucket2TimeStamp(TimeBucketUtils.TimeBucketType.SECOND, instance.getHeartBeatTime());
+// long currentTime = TimeBucketUtils.INSTANCE.changeTimeBucket2TimeStamp(TimeBucketUtils.TimeBucketType.SECOND, timeBucket);
+//
+// if (currentTime - heartBeatTime < 1000 * 60 * 2) {
+// instanceJson.addProperty("status", 0);
+// } else {
+// instanceJson.addProperty("status", 1);
+// }
+//
+// IGCMetricUIDAO.GCCount gcCount = gcMetricDAO.getGCCount(timeBuckets, instance.getInstanceId());
+// instanceJson.addProperty("ygc", gcCount.getYoung());
+// instanceJson.addProperty("ogc", gcCount.getOld());
+//
+// instances.add(instanceJson);
+// });
return response;
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java
new file mode 100644
index 000000000..c0bddff71
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.query;
+
+import java.text.ParseException;
+import org.apache.skywalking.apm.collector.storage.ui.common.Duration;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+import org.apache.skywalking.apm.collector.ui.service.ApplicationService;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.mockito.internal.util.reflection.Whitebox;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ApplicationQueryTestCase {
+
+ @Test
+ public void testGetAllApplicationByMonthDuration() throws ParseException {
+ ApplicationQuery query = new ApplicationQuery(null);
+ ApplicationService applicationService = Mockito.mock(ApplicationService.class);
+ Whitebox.setInternalState(query, "applicationService", applicationService);
+
+ Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> {
+ Object[] arguments = invocation.getArguments();
+ Assert.assertEquals(20170100000000l, arguments[0]);
+ Assert.assertEquals(20170100000000l, arguments[1]);
+ return null;
+ });
+
+ Duration duration = new Duration();
+ duration.setStart("2017-01");
+ duration.setEnd("2017-01");
+ duration.setStep(Step.MONTH);
+
+ query.getAllApplication(duration);
+ }
+
+ @Test
+ public void testGetAllApplicationByDayDuration() throws ParseException {
+ ApplicationQuery query = new ApplicationQuery(null);
+ ApplicationService applicationService = Mockito.mock(ApplicationService.class);
+ Whitebox.setInternalState(query, "applicationService", applicationService);
+
+ Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> {
+ Object[] arguments = invocation.getArguments();
+ Assert.assertEquals(20170101000000l, arguments[0]);
+ Assert.assertEquals(20170101000000l, arguments[1]);
+ return null;
+ });
+
+ Duration duration = new Duration();
+ duration.setStart("2017-01-01");
+ duration.setEnd("2017-01-01");
+ duration.setStep(Step.DAY);
+
+ query.getAllApplication(duration);
+ }
+
+ @Test
+ public void testGetAllApplicationByHourDuration() throws ParseException {
+ ApplicationQuery query = new ApplicationQuery(null);
+ ApplicationService applicationService = Mockito.mock(ApplicationService.class);
+ Whitebox.setInternalState(query, "applicationService", applicationService);
+
+ Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> {
+ Object[] arguments = invocation.getArguments();
+ Assert.assertEquals(20170101010000l, arguments[0]);
+ Assert.assertEquals(20170101010000l, arguments[1]);
+ return null;
+ });
+
+ Duration duration = new Duration();
+ duration.setStart("2017-01-01 01");
+ duration.setEnd("2017-01-01 01");
+ duration.setStep(Step.HOUR);
+
+ query.getAllApplication(duration);
+ }
+
+ @Test
+ public void testGetAllApplicationByMinuteDuration() throws ParseException {
+ ApplicationQuery query = new ApplicationQuery(null);
+ ApplicationService applicationService = Mockito.mock(ApplicationService.class);
+ Whitebox.setInternalState(query, "applicationService", applicationService);
+
+ Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> {
+ Object[] arguments = invocation.getArguments();
+ Assert.assertEquals(20170101010100l, arguments[0]);
+ Assert.assertEquals(20170101010100l, arguments[1]);
+ return null;
+ });
+
+ Duration duration = new Duration();
+ duration.setStart("2017-01-01 0101");
+ duration.setEnd("2017-01-01 0101");
+ duration.setStep(Step.MINUTE);
+
+ query.getAllApplication(duration);
+ }
+
+ @Test
+ public void testGetAllApplicationBySecondDuration() throws ParseException {
+ ApplicationQuery query = new ApplicationQuery(null);
+ ApplicationService applicationService = Mockito.mock(ApplicationService.class);
+ Whitebox.setInternalState(query, "applicationService", applicationService);
+
+ Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> {
+ Object[] arguments = invocation.getArguments();
+ Assert.assertEquals(20170101010101l, arguments[0]);
+ Assert.assertEquals(20170101010101l, arguments[1]);
+ return null;
+ });
+
+ Duration duration = new Duration();
+ duration.setStart("2017-01-01 010101");
+ duration.setEnd("2017-01-01 010101");
+ duration.setStep(Step.SECOND);
+
+ query.getAllApplication(duration);
+ }
+}
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls
index 91d0b2d79..ba6dde139 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls
@@ -33,9 +33,15 @@ type ConjecturalNode implements Node {
type: String
}
+type Application {
+ id: ID!
+ name: String!
+ # The number of servers in the application code
+ numOfServer: Int!
+}
extend type Query {
- getAllApplication(duration: Duration!): [ApplicationNode!]!
+ getAllApplication(duration: Duration!): [Application!]!
getApplicationTopology(applicationId: ID!, duration: Duration!): Topology
getSlowService(applicationId: ID!, duration: Duration!, top: Int!): [ServiceInfo!]!
getServerThroughput(applicationId: ID!, duration: Duration!, top: Int!): [AppServerInfo!]!
From e755bba328cd0bd5a9c6a91ffbd3ceaa88f9abef Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Wed, 24 Jan 2018 00:13:19 +0800
Subject: [PATCH 07/36] Move the entity into storage module.
---
.../apm/collector/ui/graphql/alarm/Alarm.java | 45 --------------
.../collector/ui/graphql/alarm/AlarmItem.java | 30 ----------
.../ui/graphql/alarm/AlarmQuery.java | 35 -----------
.../collector/ui/graphql/alarm/AlarmType.java | 28 ---------
.../collector/ui/graphql/alarm/CauseType.java | 27 ---------
.../graphql/application/ApplicationQuery.java | 48 ---------------
.../graphql/application/ConjecturalNode.java | 27 ---------
.../apm/collector/ui/graphql/common/Call.java | 31 ----------
.../collector/ui/graphql/common/Duration.java | 53 -----------------
.../apm/collector/ui/graphql/common/Node.java | 28 ---------
.../ui/graphql/common/Pagination.java | 52 -----------------
.../ui/graphql/common/ResponseTimeTrend.java | 28 ---------
.../collector/ui/graphql/common/SLATrend.java | 28 ---------
.../apm/collector/ui/graphql/common/Step.java | 30 ----------
.../ui/graphql/common/ThroughputTrend.java | 28 ---------
.../collector/ui/graphql/common/Topology.java | 29 ----------
.../ui/graphql/common/VisualUserNode.java | 25 --------
.../ui/graphql/config/AlarmThreshold.java | 31 ----------
.../ui/graphql/config/ConfigMutation.java | 36 ------------
.../ui/graphql/config/ConfigQuery.java | 36 ------------
.../config/ExistedAlarmThresholdItem.java | 29 ----------
.../config/ExistedAlarmThresholds.java | 28 ---------
.../ui/graphql/config/ExistedTTLConfigs.java | 28 ---------
.../apm/collector/ui/graphql/config/TTL.java | 29 ----------
.../ui/graphql/config/TTLConfigItem.java | 29 ----------
.../ui/graphql/overview/AlarmTrend.java | 28 ---------
.../ui/graphql/overview/ClusterBrief.java | 30 ----------
.../ui/graphql/overview/ConjecturalApp.java | 27 ---------
.../graphql/overview/ConjecturalAppBrief.java | 28 ---------
.../graphql/overview/OverViewLayerQuery.java | 56 ------------------
.../ui/graphql/server/AppServerInfo.java | 33 -----------
.../collector/ui/graphql/server/CPUTrend.java | 28 ---------
.../collector/ui/graphql/server/GCTrend.java | 29 ----------
.../ui/graphql/server/MemoryTrend.java | 31 ----------
.../ui/graphql/server/ServerQuery.java | 58 -------------------
.../ui/graphql/service/ServiceInfo.java | 29 ----------
.../ui/graphql/service/ServiceNode.java | 30 ----------
.../ui/graphql/service/ServiceQuery.java | 52 -----------------
.../ui/graphql/trace/BasicTrace.java | 30 ----------
.../collector/ui/graphql/trace/KeyValue.java | 27 ---------
.../collector/ui/graphql/trace/LogEntity.java | 29 ----------
.../apm/collector/ui/graphql/trace/Ref.java | 29 ----------
.../collector/ui/graphql/trace/RefType.java | 27 ---------
.../collector/ui/graphql/trace/Segment.java | 31 ----------
.../apm/collector/ui/graphql/trace/Span.java | 43 --------------
.../apm/collector/ui/graphql/trace/Trace.java | 28 ---------
.../ui/graphql/trace/TraceBrief.java | 29 ----------
.../ui/graphql/trace/TraceQuery.java | 34 -----------
.../ui/graphql/trace/TraceQueryCondition.java | 36 ------------
49 files changed, 1620 deletions(-)
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmItem.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmType.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/CauseType.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationQuery.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ConjecturalNode.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Call.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Node.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ResponseTimeTrend.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/SLATrend.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Step.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ThroughputTrend.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Topology.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/VisualUserNode.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/AlarmThreshold.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigMutation.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigQuery.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholdItem.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholds.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedTTLConfigs.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTL.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTLConfigItem.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/AlarmTrend.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ClusterBrief.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalApp.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalAppBrief.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/OverViewLayerQuery.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/AppServerInfo.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/CPUTrend.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/GCTrend.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/MemoryTrend.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/ServerQuery.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceInfo.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceNode.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceQuery.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/BasicTrace.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/KeyValue.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/LogEntity.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Ref.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/RefType.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Segment.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Span.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Trace.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceBrief.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQuery.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQueryCondition.java
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java
deleted file mode 100644
index 40002b7de..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/Alarm.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.alarm;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class Alarm {
- private List items;
- private Integer count;
-
- public List getItems() {
- return items;
- }
-
- public void setItems(List items) {
- this.items = items;
- }
-
- public Integer getCount() {
- return count;
- }
-
- public void setCount(Integer count) {
- this.count = count;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmItem.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmItem.java
deleted file mode 100644
index bae35fba4..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmItem.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.alarm;
-
-/**
- * @author peng-yongsheng
- */
-public class AlarmItem {
- private String title;
- private String content;
- private String startTime;
- private AlarmType alertType;
- private CauseType causeType;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java
deleted file mode 100644
index 8c213a658..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmQuery.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.alarm;
-
-import org.apache.skywalking.apm.collector.ui.graphql.Query;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Pagination;
-
-/**
- * @author peng-yongsheng
- */
-public class AlarmQuery implements Query {
-
- public Alarm loadAlertList(String keyword, AlarmType alarmType, Duration duration, Pagination pagination) {
- Alarm alarm = new Alarm();
- alarm.setCount(0);
- return alarm;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmType.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmType.java
deleted file mode 100644
index d36d547c0..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/AlarmType.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.alarm;
-
-/**
- * @author peng-yongsheng
- */
-public enum AlarmType {
- APPLICATION,
- SERVER,
- SERVICE
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/CauseType.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/CauseType.java
deleted file mode 100644
index 5d5986b06..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/alarm/CauseType.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.alarm;
-
-/**
- * @author peng-yongsheng
- */
-public enum CauseType {
- LOW_SUCCESS_RATE,
- SLOW_RESPONSE
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationQuery.java
deleted file mode 100644
index 44e735152..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ApplicationQuery.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.application;
-
-import java.util.List;
-import org.apache.skywalking.apm.collector.ui.graphql.Query;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Topology;
-import org.apache.skywalking.apm.collector.ui.graphql.server.AppServerInfo;
-import org.apache.skywalking.apm.collector.ui.graphql.service.ServiceInfo;
-
-/**
- * @author peng-yongsheng
- */
-public class ApplicationQuery implements Query {
-
- public List getAllApplication(Duration duration) {
- return null;
- }
-
- public Topology getApplicationTopology(int applicationId, Duration duration) {
- return null;
- }
-
- public List getSlowService(int applicationId, Duration duration, Integer top) {
- return null;
- }
-
- public List getServerThroughput(int applicationId, Duration duration, Integer top) {
- return null;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ConjecturalNode.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ConjecturalNode.java
deleted file mode 100644
index 8cd678afc..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/application/ConjecturalNode.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.application;
-
-import org.apache.skywalking.apm.collector.ui.graphql.common.Node;
-
-/**
- * @author peng-yongsheng
- */
-public class ConjecturalNode extends Node {
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Call.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Call.java
deleted file mode 100644
index 3c039e036..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Call.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.common;
-
-/**
- * @author peng-yongsheng
- */
-public class Call {
- private String source;
- private String target;
- private Boolean isAlert;
- private String callType;
- private Integer callsPerSec;
- private Integer responseTimePerSec;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java
deleted file mode 100644
index ad051f150..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Duration.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.common;
-
-/**
- * @author peng-yongsheng
- */
-public class Duration {
-
- private String start;
- private String end;
- private Step step;
-
- public String getStart() {
- return start;
- }
-
- public void setStart(String start) {
- this.start = start;
- }
-
- public String getEnd() {
- return end;
- }
-
- public void setEnd(String end) {
- this.end = end;
- }
-
- public Step getStep() {
- return step;
- }
-
- public void setStep(Step step) {
- this.step = step;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Node.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Node.java
deleted file mode 100644
index 388e1f308..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Node.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.common;
-
-/**
- * @author peng-yongsheng
- */
-public abstract class Node {
- private String id;
- private String name;
- private String type;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java
deleted file mode 100644
index b0cabe5e5..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Pagination.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.common;
-
-/**
- * @author peng-yongsheng
- */
-public class Pagination {
- private Integer pageNum;
- private Integer pageSize;
- private Boolean needTotal;
-
- public Integer getPageNum() {
- return pageNum;
- }
-
- public void setPageNum(Integer pageNum) {
- this.pageNum = pageNum;
- }
-
- public Integer getPageSize() {
- return pageSize;
- }
-
- public void setPageSize(Integer pageSize) {
- this.pageSize = pageSize;
- }
-
- public Boolean getNeedTotal() {
- return needTotal;
- }
-
- public void setNeedTotal(Boolean needTotal) {
- this.needTotal = needTotal;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ResponseTimeTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ResponseTimeTrend.java
deleted file mode 100644
index 21f7967a9..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ResponseTimeTrend.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.common;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class ResponseTimeTrend {
- private List trendList;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/SLATrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/SLATrend.java
deleted file mode 100644
index 4d2526584..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/SLATrend.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.common;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class SLATrend {
- private List trendList;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Step.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Step.java
deleted file mode 100644
index b4d4c4c56..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Step.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.common;
-
-/**
- * @author peng-yongsheng
- */
-public enum Step {
- MONTH,
- DAY,
- HOUR,
- MINUTE,
- SECOND
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ThroughputTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ThroughputTrend.java
deleted file mode 100644
index 504464dde..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/ThroughputTrend.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.common;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class ThroughputTrend {
- private List trendList;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Topology.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Topology.java
deleted file mode 100644
index 6f618ef7c..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/Topology.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.common;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class Topology {
- private List nodes;
- private List calls;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/VisualUserNode.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/VisualUserNode.java
deleted file mode 100644
index 0ede1446a..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/common/VisualUserNode.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.common;
-
-/**
- * @author peng-yongsheng
- */
-public class VisualUserNode extends Node {
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/AlarmThreshold.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/AlarmThreshold.java
deleted file mode 100644
index e4ae4fc08..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/AlarmThreshold.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.config;
-
-import org.apache.skywalking.apm.collector.ui.graphql.alarm.AlarmType;
-import org.apache.skywalking.apm.collector.ui.graphql.alarm.CauseType;
-
-/**
- * @author peng-yongsheng
- */
-public class AlarmThreshold {
- private AlarmType type;
- private Integer threshold;
- private CauseType causeType;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigMutation.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigMutation.java
deleted file mode 100644
index 828926c7e..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigMutation.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.config;
-
-import java.util.List;
-import org.apache.skywalking.apm.collector.ui.graphql.Mutation;
-
-/**
- * @author peng-yongsheng
- */
-public class ConfigMutation implements Mutation {
-
- public Boolean setDataTTLConfigs(List ttl) {
- return null;
- }
-
- public Boolean setAlarmThreshold(List thresholds) {
- return null;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigQuery.java
deleted file mode 100644
index 4959eec6b..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ConfigQuery.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.config;
-
-import org.apache.skywalking.apm.collector.ui.graphql.Query;
-import org.apache.skywalking.apm.collector.ui.graphql.alarm.AlarmType;
-
-/**
- * @author peng-yongsheng
- */
-public class ConfigQuery implements Query {
-
- public ExistedTTLConfigs queryAllDataTTLConfigs() {
- return null;
- }
-
- public ExistedAlarmThresholds queryAlarmThresholds(AlarmType alarmType) {
- return null;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholdItem.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholdItem.java
deleted file mode 100644
index 2efd4c897..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholdItem.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.config;
-
-import org.apache.skywalking.apm.collector.ui.graphql.alarm.CauseType;
-
-/**
- * @author peng-yongsheng
- */
-public class ExistedAlarmThresholdItem {
- private Integer threshold;
- private CauseType causeType;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholds.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholds.java
deleted file mode 100644
index e6c32e618..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedAlarmThresholds.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.config;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class ExistedAlarmThresholds {
- private List items;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedTTLConfigs.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedTTLConfigs.java
deleted file mode 100644
index ad76dbd1c..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/ExistedTTLConfigs.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.config;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class ExistedTTLConfigs {
- private List ttl;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTL.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTL.java
deleted file mode 100644
index 6d65c0384..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTL.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.config;
-
-import org.apache.skywalking.apm.collector.ui.graphql.common.Step;
-
-/**
- * @author peng-yongsheng
- */
-public class TTL {
- private Step unit;
- private Integer value;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTLConfigItem.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTLConfigItem.java
deleted file mode 100644
index bb16bbf4a..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/config/TTLConfigItem.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.config;
-
-import org.apache.skywalking.apm.collector.ui.graphql.common.Step;
-
-/**
- * @author peng-yongsheng
- */
-public class TTLConfigItem {
- private Step unit;
- private Integer value;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/AlarmTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/AlarmTrend.java
deleted file mode 100644
index 604e5da20..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/AlarmTrend.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.overview;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class AlarmTrend {
- public List numOfAlarmRate;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ClusterBrief.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ClusterBrief.java
deleted file mode 100644
index 59177bd23..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ClusterBrief.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.overview;
-
-/**
- * @author peng-yongsheng
- */
-public class ClusterBrief {
- private int numOfApplication;
- private int numOfService;
- private int numOfDatabase;
- private int numOfCache;
- private int numOfMQ;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalApp.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalApp.java
deleted file mode 100644
index 60688bd98..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalApp.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.overview;
-
-/**
- * @author peng-yongsheng
- */
-public class ConjecturalApp {
- private String name;
- private int num;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalAppBrief.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalAppBrief.java
deleted file mode 100644
index 74c9c8a7b..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/ConjecturalAppBrief.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.overview;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class ConjecturalAppBrief {
- private List apps;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/OverViewLayerQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/OverViewLayerQuery.java
deleted file mode 100644
index 11c8c610d..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/overview/OverViewLayerQuery.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.overview;
-
-import java.util.List;
-import org.apache.skywalking.apm.collector.ui.graphql.Query;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Topology;
-import org.apache.skywalking.apm.collector.ui.graphql.server.AppServerInfo;
-import org.apache.skywalking.apm.collector.ui.graphql.service.ServiceInfo;
-
-/**
- * @author peng-yongsheng
- */
-public class OverViewLayerQuery implements Query {
-
- public Topology getClusterTopology(Duration duration) {
- return null;
- }
-
- public ClusterBrief getClusterBrief(Duration duration) {
- return null;
- }
-
- public AlarmTrend getAlarmTrend(Duration duration) {
- return null;
- }
-
- public ConjecturalAppBrief getConjecturalApps(Duration duration) {
- return null;
- }
-
- public List getTopNSlowService(Duration duration, int topN) {
- return null;
- }
-
- public List getTopNServerThroughput(Duration duration, int topN) {
- return null;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/AppServerInfo.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/AppServerInfo.java
deleted file mode 100644
index 206b5221f..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/AppServerInfo.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.server;
-
-/**
- * @author peng-yongsheng
- */
-public class AppServerInfo {
- private int id;
- private String name;
- private int tps;
- private String os;
- private String host;
- private int pid;
- private String ipv4;
- private String ipv6;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/CPUTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/CPUTrend.java
deleted file mode 100644
index 2c1ae10f4..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/CPUTrend.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.server;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class CPUTrend {
- private List cost;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/GCTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/GCTrend.java
deleted file mode 100644
index 47309ad96..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/GCTrend.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.server;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class GCTrend {
- private List youngGC;
- private List oldGC;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/MemoryTrend.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/MemoryTrend.java
deleted file mode 100644
index 4dba1d842..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/MemoryTrend.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.server;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class MemoryTrend {
- private List heap;
- private List maxHeap;
- private List noheap;
- private List maxNoheap;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/ServerQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/ServerQuery.java
deleted file mode 100644
index 96aa50ebb..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/server/ServerQuery.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.server;
-
-import java.util.List;
-import org.apache.skywalking.apm.collector.ui.graphql.Query;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
-import org.apache.skywalking.apm.collector.ui.graphql.common.ResponseTimeTrend;
-import org.apache.skywalking.apm.collector.ui.graphql.common.ThroughputTrend;
-
-/**
- * @author peng-yongsheng
- */
-public class ServerQuery implements Query {
- public List searchServer(String keyword, Duration duration) {
- return null;
- }
-
- public List getAllServer(String applicationId, Duration duration) {
- return null;
- }
-
- public ResponseTimeTrend getServerResponseTimeTrend(int serverId, Duration duration) {
- return null;
- }
-
- public ThroughputTrend getServerTPSTrend(int serverId, Duration duration) {
- return null;
- }
-
- public CPUTrend getCPUTrend(int serverId, Duration duration) {
- return null;
- }
-
- public GCTrend getGCTrend(int serverId, Duration duration) {
- return null;
- }
-
- public MemoryTrend getMemoryTrend(int serverId, Duration duration) {
- return null;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceInfo.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceInfo.java
deleted file mode 100644
index 6a44722d7..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceInfo.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.service;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceInfo {
- private int id;
- private String name;
- private int avgResponseTime;
- private int tps;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceNode.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceNode.java
deleted file mode 100644
index c29c0fea1..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceNode.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.service;
-
-import org.apache.skywalking.apm.collector.ui.graphql.common.Node;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceNode extends Node {
- private Float sla;
- private Long calls;
- private Integer numOfServiceAlarm;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceQuery.java
deleted file mode 100644
index 5ed158f8e..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/service/ServiceQuery.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.service;
-
-import java.util.List;
-import org.apache.skywalking.apm.collector.ui.graphql.Query;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
-import org.apache.skywalking.apm.collector.ui.graphql.common.ResponseTimeTrend;
-import org.apache.skywalking.apm.collector.ui.graphql.common.SLATrend;
-import org.apache.skywalking.apm.collector.ui.graphql.common.ThroughputTrend;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Topology;
-
-/**
- * @author peng-yongsheng
- */
-public class ServiceQuery implements Query {
- public List searchService(String keyword, Duration duration, Integer topN) {
- return null;
- }
-
- public ResponseTimeTrend getServiceResponseTimeTrend(int serviceId, Duration duration) {
- return null;
- }
-
- public ThroughputTrend getServiceTPSTrend(int serviceId, Duration duration) {
- return null;
- }
-
- public SLATrend getServiceSLATrend(int serviceId, Duration duration) {
- return null;
- }
-
- public Topology getServiceTopology(int serviceId, Duration duration) {
- return null;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/BasicTrace.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/BasicTrace.java
deleted file mode 100644
index 2b2151906..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/BasicTrace.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-/**
- * @author peng-yongsheng
- */
-public class BasicTrace {
- private String operationName;
- private int duration;
- private String start;
- private Boolean isError;
- private String traceId;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/KeyValue.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/KeyValue.java
deleted file mode 100644
index 28710cd0d..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/KeyValue.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-/**
- * @author peng-yongsheng
- */
-public class KeyValue {
- private String key;
- private String value;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/LogEntity.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/LogEntity.java
deleted file mode 100644
index d2938d4c1..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/LogEntity.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class LogEntity {
- private String time;
- private List data;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Ref.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Ref.java
deleted file mode 100644
index ef226f4f7..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Ref.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-/**
- * @author peng-yongsheng
- */
-public class Ref {
- private String traceId;
- private Integer parentSegmentId;
- private Integer parentSpanId;
- private RefType type;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/RefType.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/RefType.java
deleted file mode 100644
index 6c3ce9fe4..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/RefType.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-/**
- * @author peng-yongsheng
- */
-public enum RefType {
- CROSS_PROCESS,
- CROSS_THREAD
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Segment.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Segment.java
deleted file mode 100644
index 50dbe6cf2..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Segment.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class Segment {
- private int segmentId;
- private String appName;
- private Boolean isSizeLimited;
- private List spans;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Span.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Span.java
deleted file mode 100644
index 516eba00e..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Span.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class Span {
- private String traceId;
- private String segmentId;
- private Integer spanId;
- private Integer parentSpanId;
- private List][ refs;
- private String applicationCode;
- private Long startTime;
- private Long endTime;
- private String operationName;
- private String type;
- private String peer;
- private String component;
- private Boolean isError;
- private String layer;
- private List tags;
- private List logs;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Trace.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Trace.java
deleted file mode 100644
index 05b1ba19d..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/Trace.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class Trace {
- private List spans;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceBrief.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceBrief.java
deleted file mode 100644
index b9353370a..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceBrief.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-import java.util.List;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceBrief {
- private List traces;
- private Integer total;
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQuery.java
deleted file mode 100644
index 76b370b1b..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQuery.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-import org.apache.skywalking.apm.collector.ui.graphql.Query;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceQuery implements Query {
- public TraceBrief queryBasicTraces(TraceQueryCondition condition) {
- return null;
- }
-
- public Trace queryTrace(String id) {
- return null;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQueryCondition.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQueryCondition.java
deleted file mode 100644
index 5dd8fdd01..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/trace/TraceQueryCondition.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.trace;
-
-import java.util.List;
-import org.apache.skywalking.apm.collector.ui.graphql.common.Duration;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceQueryCondition {
- private List applicationCodes;
- private String traceId;
- private String operationName;
- private Duration queryDuration;
- private int minTraceDuration;
- private int maxTraceDuration;
- private Boolean topN;
- private int needTotal;
-}
From 9a6520fbc2494473d6721af5fc689704fa7e4404 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Fri, 26 Jan 2018 00:23:58 +0800
Subject: [PATCH 08/36] Provide the application topology query, but only
completed es storage.
---
.../test/resources/json/dubbox-provider.json | 17 ++
.../provider/worker/AlarmAssertWorker.java | 2 +-
.../component/ApplicationComponentCopy.java | 2 +-
.../ApplicationComponentSpanListener.java | 17 +-
.../mapping/ApplicationMappingCopy.java | 2 +-
.../ApplicationMappingSpanListener.java | 16 +-
.../ServiceReferenceMetricSpanListener.java | 2 +-
.../standardization/ReferenceIdExchanger.java | 3 -
.../service/ApplicationCacheService.java | 3 +-
.../service/ApplicationCacheGuavaService.java | 21 ++-
apm-collector/apm-collector-core/pom.xml | 5 +
.../collector/core/util/TimeBucketUtils.java | 18 +--
.../dao/IApplicationComponentUIDAO.java | 27 +++-
.../storage/dao/IApplicationMappingUIDAO.java | 26 ++-
.../dao/IApplicationReferenceMetricUIDAO.java | 11 +-
.../collector/storage/dao/IInstanceUIDAO.java | 2 +-
.../dao/cache/IApplicationCacheDAO.java | 3 +-
.../collector/storage/table/MetricSource.java | 36 +++++
.../application/ApplicationComponent.java | 8 +-
.../ApplicationComponentTable.java | 3 +-
.../table/application/ApplicationMapping.java | 8 +-
.../application/ApplicationMappingTable.java | 3 +-
.../ui/application/ApplicationNode.java | 9 --
.../apm/collector/storage/ui/common/Call.java | 94 ++++++++++-
.../apm/collector/storage/ui/common/Node.java | 6 +-
.../collector/storage/ui/common/Topology.java | 17 ++
.../utils/TimePyramidTableNameBuilder.java | 50 ++++++
.../es/dao/ApplicationComponentEsUIDAO.java | 45 +++---
.../es/dao/ApplicationMappingEsUIDAO.java | 31 ++--
.../ApplicationReferenceMetricEsUIDAO.java | 126 +++++++++------
.../storage/es/dao/InstanceEsUIDAO.java | 11 +-
...tApplicationComponentEsPersistenceDAO.java | 4 +-
...actApplicationMappingEsPersistenceDAO.java | 4 +-
.../es/dao/cache/ApplicationEsCacheDAO.java | 12 +-
...ractApplicationComponentEsTableDefine.java | 2 +-
...stractApplicationMappingEsTableDefine.java | 2 +-
.../h2/dao/ApplicationComponentH2UIDAO.java | 41 +++--
.../h2/dao/ApplicationMappingH2UIDAO.java | 38 +++--
.../ApplicationReferenceMetricH2UIDAO.java | 17 +-
.../storage/h2/dao/InstanceH2UIDAO.java | 2 +-
...tApplicationComponentH2PersistenceDAO.java | 4 +-
...actApplicationMappingH2PersistenceDAO.java | 4 +-
.../h2/dao/cache/ApplicationH2CacheDAO.java | 16 +-
...ractApplicationComponentH2TableDefine.java | 2 +-
...stractApplicationMappingH2TableDefine.java | 2 +-
.../ui/utils/DurationUtilsTestCase.java | 32 ++++
.../collector/ui/query/ApplicationQuery.java | 45 ++----
.../ui/service/ApplicationService.java | 6 +-
.../service/ApplicationTopologyService.java | 129 +++++++++++++++
.../ui/service/InstanceHealthService.java | 2 +-
.../apm/collector/ui/service/SpanService.java | 2 +-
.../collector/ui/service/TopologyBuilder.java | 153 ++++++++++++++++++
.../ui/service/TraceDagDataBuilder.java | 153 ------------------
.../ui/service/TraceStackService.java | 2 +-
.../apm/collector/ui/utils/DurationUtils.java | 91 +++++++++++
.../ui/query/ApplicationQueryTestCase.java | 20 +--
56 files changed, 989 insertions(+), 420 deletions(-)
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/MetricSource.java
create mode 100644 apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/utils/TimePyramidTableNameBuilder.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtilsTestCase.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceDagDataBuilder.java
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtils.java
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json
index 5add6e2f1..01c6e76ad 100644
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json
+++ b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json
@@ -46,6 +46,23 @@
}
],
"lo": []
+ },
+ {
+ "si": 1,
+ "tv": 1,
+ "lv": 1,
+ "ps": 0,
+ "st": 1501858094726,
+ "et": 1501858095804,
+ "ci": 9,
+ "cn": "",
+ "oi": 0,
+ "on": "mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]",
+ "pi": 0,
+ "pn": "localhost:27017",
+ "ie": false,
+ "to": [],
+ "lo": []
}
]
}
diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorker.java
index c00db5644..b0d211f75 100644
--- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorker.java
+++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorker.java
@@ -18,7 +18,7 @@
package org.apache.skywalking.apm.collector.analysis.alarm.provider.worker;
-import org.apache.skywalking.apm.collector.analysis.metric.define.MetricSource;
+import org.apache.skywalking.apm.collector.storage.table.MetricSource;
import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker;
import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException;
import org.apache.skywalking.apm.collector.core.data.StreamData;
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentCopy.java
index 27cf97272..510ac814e 100644
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentCopy.java
+++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentCopy.java
@@ -31,7 +31,7 @@ public class ApplicationComponentCopy {
newApplicationComponent.setMetricId(applicationComponent.getMetricId());
newApplicationComponent.setComponentId(applicationComponent.getComponentId());
- newApplicationComponent.setPeerId(applicationComponent.getPeerId());
+ newApplicationComponent.setApplicationId(applicationComponent.getApplicationId());
newApplicationComponent.setTimeBucket(newApplicationComponent.getTimeBucket());
return newApplicationComponent;
}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java
index 80e4c7ece..aa9ddee1b 100644
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java
+++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java
@@ -27,6 +27,8 @@ import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listen
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.FirstSpanListener;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListener;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListenerFactory;
+import org.apache.skywalking.apm.collector.cache.CacheModule;
+import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
import org.apache.skywalking.apm.collector.core.graph.Graph;
import org.apache.skywalking.apm.collector.core.graph.GraphManager;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
@@ -39,17 +41,24 @@ import org.apache.skywalking.apm.collector.storage.table.application.Application
*/
public class ApplicationComponentSpanListener implements EntrySpanListener, ExitSpanListener, FirstSpanListener {
+ private final ApplicationCacheService applicationCacheService;
private List applicationComponents = new ArrayList<>();
private long timeBucket;
+ ApplicationComponentSpanListener(ModuleManager moduleManager) {
+ this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
+ }
+
@Override
public void parseExit(SpanDecorator spanDecorator, int applicationId, int instanceId, String segmentId) {
- String metricId = spanDecorator.getPeerId() + Const.ID_SPLIT + String.valueOf(spanDecorator.getComponentId());
+ int applicationIdFromPeerId = applicationCacheService.getApplicationIdByAddressId(spanDecorator.getPeerId());
+
+ String metricId = applicationIdFromPeerId + Const.ID_SPLIT + String.valueOf(spanDecorator.getComponentId());
ApplicationComponent applicationComponent = new ApplicationComponent();
applicationComponent.setMetricId(metricId);
applicationComponent.setComponentId(spanDecorator.getComponentId());
- applicationComponent.setPeerId(spanDecorator.getPeerId());
+ applicationComponent.setApplicationId(applicationIdFromPeerId);
applicationComponents.add(applicationComponent);
}
@@ -60,7 +69,7 @@ public class ApplicationComponentSpanListener implements EntrySpanListener, Exit
ApplicationComponent applicationComponent = new ApplicationComponent();
applicationComponent.setMetricId(metricId);
applicationComponent.setComponentId(spanDecorator.getComponentId());
- applicationComponent.setPeerId(applicationId);
+ applicationComponent.setApplicationId(applicationId);
applicationComponents.add(applicationComponent);
}
@@ -82,7 +91,7 @@ public class ApplicationComponentSpanListener implements EntrySpanListener, Exit
public static class Factory implements SpanListenerFactory {
@Override public SpanListener create(ModuleManager moduleManager) {
- return new ApplicationComponentSpanListener();
+ return new ApplicationComponentSpanListener(moduleManager);
}
}
}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingCopy.java
index aa5aad45f..3797f1d5f 100644
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingCopy.java
+++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingCopy.java
@@ -32,7 +32,7 @@ public class ApplicationMappingCopy {
newApplicationMapping.setTimeBucket(applicationMapping.getTimeBucket());
newApplicationMapping.setApplicationId(applicationMapping.getApplicationId());
- newApplicationMapping.setAddressId(applicationMapping.getAddressId());
+ newApplicationMapping.setMappingApplicationId(applicationMapping.getMappingApplicationId());
return newApplicationMapping;
}
}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingSpanListener.java
index 9433f2d5e..eda62f9fd 100644
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingSpanListener.java
+++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingSpanListener.java
@@ -26,6 +26,8 @@ import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listen
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.FirstSpanListener;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListener;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListenerFactory;
+import org.apache.skywalking.apm.collector.cache.CacheModule;
+import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
import org.apache.skywalking.apm.collector.core.graph.Graph;
import org.apache.skywalking.apm.collector.core.graph.GraphManager;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
@@ -42,18 +44,26 @@ public class ApplicationMappingSpanListener implements FirstSpanListener, EntryS
private final Logger logger = LoggerFactory.getLogger(ApplicationMappingSpanListener.class);
+ private final ApplicationCacheService applicationCacheService;
private List applicationMappings = new LinkedList<>();
private long timeBucket;
+ ApplicationMappingSpanListener(ModuleManager moduleManager) {
+ this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
+ }
+
@Override public void parseEntry(SpanDecorator spanDecorator, int applicationId, int instanceId, String segmentId) {
logger.debug("application mapping listener parse reference");
if (spanDecorator.getRefsCount() > 0) {
for (int i = 0; i < spanDecorator.getRefsCount(); i++) {
ApplicationMapping applicationMapping = new ApplicationMapping();
applicationMapping.setApplicationId(applicationId);
- applicationMapping.setAddressId(spanDecorator.getRefs(i).getNetworkAddressId());
- String metricId = String.valueOf(applicationId) + Const.ID_SPLIT + String.valueOf(applicationMapping.getAddressId());
+ int addressId = spanDecorator.getRefs(i).getNetworkAddressId();
+ int mappingApplicationId = applicationCacheService.getApplicationIdByAddressId(addressId);
+ applicationMapping.setMappingApplicationId(mappingApplicationId);
+
+ String metricId = String.valueOf(applicationId) + Const.ID_SPLIT + String.valueOf(applicationMapping.getMappingApplicationId());
applicationMapping.setMetricId(metricId);
applicationMappings.add(applicationMapping);
}
@@ -79,7 +89,7 @@ public class ApplicationMappingSpanListener implements FirstSpanListener, EntryS
public static class Factory implements SpanListenerFactory {
@Override public SpanListener create(ModuleManager moduleManager) {
- return new ApplicationMappingSpanListener();
+ return new ApplicationMappingSpanListener(moduleManager);
}
}
}
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java
index c2b933d72..8c7d04333 100644
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java
+++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java
@@ -20,7 +20,7 @@ package org.apache.skywalking.apm.collector.analysis.metric.provider.worker.serv
import java.util.LinkedList;
import java.util.List;
-import org.apache.skywalking.apm.collector.analysis.metric.define.MetricSource;
+import org.apache.skywalking.apm.collector.storage.table.MetricSource;
import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.ReferenceDecorator;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.SpanDecorator;
diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/ReferenceIdExchanger.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/ReferenceIdExchanger.java
index ccef9af41..d3e760153 100644
--- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/ReferenceIdExchanger.java
+++ b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/ReferenceIdExchanger.java
@@ -19,7 +19,6 @@
package org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.standardization;
import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule;
-import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService;
import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService;
import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService;
import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.ReferenceDecorator;
@@ -39,7 +38,6 @@ public class ReferenceIdExchanger implements IdExchanger {
private final Logger logger = LoggerFactory.getLogger(ReferenceIdExchanger.class);
private static ReferenceIdExchanger EXCHANGER;
- private final IApplicationIDService applicationIDService;
private final IServiceNameService serviceNameService;
private final InstanceCacheService instanceCacheService;
private final INetworkAddressIDService networkAddressIDService;
@@ -52,7 +50,6 @@ public class ReferenceIdExchanger implements IdExchanger {
}
private ReferenceIdExchanger(ModuleManager moduleManager) {
- this.applicationIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IApplicationIDService.class);
this.serviceNameService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IServiceNameService.class);
this.networkAddressIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(INetworkAddressIDService.class);
this.instanceCacheService = moduleManager.find(CacheModule.NAME).getService(InstanceCacheService.class);
diff --git a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ApplicationCacheService.java b/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ApplicationCacheService.java
index 57d0c39e3..f576b2830 100644
--- a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ApplicationCacheService.java
+++ b/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ApplicationCacheService.java
@@ -19,6 +19,7 @@
package org.apache.skywalking.apm.collector.cache.service;
import org.apache.skywalking.apm.collector.core.module.Service;
+import org.apache.skywalking.apm.collector.storage.table.register.Application;
/**
* @author peng-yongsheng
@@ -26,7 +27,7 @@ import org.apache.skywalking.apm.collector.core.module.Service;
public interface ApplicationCacheService extends Service {
int getApplicationIdByCode(String applicationCode);
- String getApplicationCodeById(int applicationId);
+ Application getApplicationById(int applicationId);
int getApplicationIdByAddressId(int addressId);
}
diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ApplicationCacheGuavaService.java b/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ApplicationCacheGuavaService.java
index 530378740..64480c765 100644
--- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ApplicationCacheGuavaService.java
+++ b/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ApplicationCacheGuavaService.java
@@ -22,11 +22,10 @@ import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
-import org.apache.skywalking.apm.collector.core.util.StringUtils;
import org.apache.skywalking.apm.collector.storage.StorageModule;
import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO;
+import org.apache.skywalking.apm.collector.storage.table.register.Application;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,23 +69,23 @@ public class ApplicationCacheGuavaService implements ApplicationCacheService {
return applicationId;
}
- private final Cache idCache = CacheBuilder.newBuilder().maximumSize(1000).build();
+ private final Cache applicationCache = CacheBuilder.newBuilder().maximumSize(1000).build();
- @Override public String getApplicationCodeById(int applicationId) {
- String applicationCode = Const.EMPTY_STRING;
+ @Override public Application getApplicationById(int applicationId) {
+ Application application = null;
try {
- applicationCode = idCache.get(applicationId, () -> getApplicationCacheDAO().getApplicationCode(applicationId));
+ application = applicationCache.get(applicationId, () -> getApplicationCacheDAO().getApplication(applicationId));
} catch (Throwable e) {
logger.error(e.getMessage(), e);
}
- if (StringUtils.isEmpty(applicationCode)) {
- applicationCode = getApplicationCacheDAO().getApplicationCode(applicationId);
- if (StringUtils.isNotEmpty(applicationCode)) {
- codeCache.put(applicationCode, applicationId);
+ if (ObjectUtils.isEmpty(application)) {
+ application = getApplicationCacheDAO().getApplication(applicationId);
+ if (ObjectUtils.isNotEmpty(application)) {
+ applicationCache.put(applicationId, application);
}
}
- return applicationCode;
+ return application;
}
private final Cache addressIdCache = CacheBuilder.newBuilder().maximumSize(1000).build();
diff --git a/apm-collector/apm-collector-core/pom.xml b/apm-collector/apm-collector-core/pom.xml
index 8873a68fe..aef472f42 100644
--- a/apm-collector/apm-collector-core/pom.xml
+++ b/apm-collector/apm-collector-core/pom.xml
@@ -36,5 +36,10 @@
gson
2.8.1
+
+ joda-time
+ joda-time
+ 2.9.9
+
diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java
index a3cf5b2ef..8bb4366db 100644
--- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java
+++ b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java
@@ -27,37 +27,37 @@ import java.util.Calendar;
public enum TimeBucketUtils {
INSTANCE;
- private final SimpleDateFormat monthDateFormat = new SimpleDateFormat("yyyyMM");
- private final SimpleDateFormat dayDateFormat = new SimpleDateFormat("yyyyMMdd");
- private final SimpleDateFormat hourDateFormat = new SimpleDateFormat("yyyyMMddHH");
- private final SimpleDateFormat minuteDateFormat = new SimpleDateFormat("yyyyMMddHHmm");
- private final SimpleDateFormat secondDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
+ public static final SimpleDateFormat MONTH_DATE_FORMAT = new SimpleDateFormat("yyyyMM");
+ public static final SimpleDateFormat DAY_DATE_FORMAT = new SimpleDateFormat("yyyyMMdd");
+ public static final SimpleDateFormat HOUR_DATE_FORMAT = new SimpleDateFormat("yyyyMMddHH");
+ public static final SimpleDateFormat MINUTE_DATE_FORMAT = new SimpleDateFormat("yyyyMMddHHmm");
+ public static final SimpleDateFormat SECOND_DATE_FORMAT = new SimpleDateFormat("yyyyMMddHHmmss");
public long getMinuteTimeBucket(long time) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time);
- String timeStr = minuteDateFormat.format(calendar.getTime());
+ String timeStr = MINUTE_DATE_FORMAT.format(calendar.getTime());
return Long.valueOf(timeStr);
}
public long getSecondTimeBucket(long time) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time);
- String timeStr = secondDateFormat.format(calendar.getTime());
+ String timeStr = SECOND_DATE_FORMAT.format(calendar.getTime());
return Long.valueOf(timeStr);
}
public long getHourTimeBucket(long time) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time);
- String timeStr = hourDateFormat.format(calendar.getTime()) + "00";
+ String timeStr = HOUR_DATE_FORMAT.format(calendar.getTime()) + "00";
return Long.valueOf(timeStr);
}
public long getDayTimeBucket(long time) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time);
- String timeStr = dayDateFormat.format(calendar.getTime()) + "0000";
+ String timeStr = DAY_DATE_FORMAT.format(calendar.getTime()) + "0000";
return Long.valueOf(timeStr);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationComponentUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationComponentUIDAO.java
index a003e5ff2..903629e80 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationComponentUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationComponentUIDAO.java
@@ -18,12 +18,35 @@
package org.apache.skywalking.apm.collector.storage.dao;
-import com.google.gson.JsonArray;
+import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
/**
* @author peng-yongsheng
*/
public interface IApplicationComponentUIDAO extends DAO {
- JsonArray load(long startTime, long endTime);
+
+ List load(Step step, long startTime, long endTime);
+
+ class ApplicationComponent {
+ private int componentId;
+ private int applicationId;
+
+ public int getComponentId() {
+ return componentId;
+ }
+
+ public void setComponentId(int componentId) {
+ this.componentId = componentId;
+ }
+
+ public int getApplicationId() {
+ return applicationId;
+ }
+
+ public void setApplicationId(int applicationId) {
+ this.applicationId = applicationId;
+ }
+ }
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationMappingUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationMappingUIDAO.java
index 5f8e454a4..75e4898f6 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationMappingUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationMappingUIDAO.java
@@ -18,12 +18,34 @@
package org.apache.skywalking.apm.collector.storage.dao;
-import com.google.gson.JsonArray;
+import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
/**
* @author peng-yongsheng
*/
public interface IApplicationMappingUIDAO extends DAO {
- JsonArray load(long startTime, long endTime);
+ List load(Step step, long startTime, long endTime);
+
+ class ApplicationMapping {
+ private int applicationId;
+ private int mappingApplicationId;
+
+ public int getApplicationId() {
+ return applicationId;
+ }
+
+ public void setApplicationId(int applicationId) {
+ this.applicationId = applicationId;
+ }
+
+ public int getMappingApplicationId() {
+ return mappingApplicationId;
+ }
+
+ public void setMappingApplicationId(int mappingApplicationId) {
+ this.mappingApplicationId = mappingApplicationId;
+ }
+ }
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationReferenceMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationReferenceMetricUIDAO.java
index 1c32a17cf..505950b12 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationReferenceMetricUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationReferenceMetricUIDAO.java
@@ -18,12 +18,19 @@
package org.apache.skywalking.apm.collector.storage.dao;
-import com.google.gson.JsonArray;
+import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
+import org.apache.skywalking.apm.collector.storage.table.MetricSource;
+import org.apache.skywalking.apm.collector.storage.ui.common.Call;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
/**
* @author peng-yongsheng
*/
public interface IApplicationReferenceMetricUIDAO extends DAO {
- JsonArray load(long startTime, long endTime);
+ List getFrontApplications(Step step, int applicationId, long startTime, long endTime,
+ MetricSource metricSource);
+
+ List getBehindApplications(Step step, int applicationId, long startTime, long endTime,
+ MetricSource metricSource);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
index a2173bd53..6a2413f1f 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
@@ -31,7 +31,7 @@ public interface IInstanceUIDAO extends DAO {
Long instanceLastHeartBeatTime(long applicationInstanceId);
- List getApplications(long startTime, long endTime);
+ List getApplications(long startTime, long endTime, int... applicationIds);
Instance getInstance(int instanceId);
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IApplicationCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IApplicationCacheDAO.java
index 3b766ef99..972f22905 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IApplicationCacheDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IApplicationCacheDAO.java
@@ -19,6 +19,7 @@
package org.apache.skywalking.apm.collector.storage.dao.cache;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
+import org.apache.skywalking.apm.collector.storage.table.register.Application;
/**
* @author peng-yongsheng
@@ -26,7 +27,7 @@ import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
public interface IApplicationCacheDAO extends DAO {
int getApplicationIdByCode(String applicationCode);
- String getApplicationCode(int applicationId);
+ Application getApplication(int applicationId);
int getApplicationIdByAddressId(int addressId);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/MetricSource.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/MetricSource.java
new file mode 100644
index 000000000..26af12fda
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/MetricSource.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.table;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum MetricSource {
+ Caller(0), Callee(1);
+
+ private final int value;
+
+ private MetricSource(int value) {
+ this.value = value;
+ }
+
+ public int getValue() {
+ return value;
+ }
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponent.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponent.java
index 4f18fbbd1..cf6e09e69 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponent.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponent.java
@@ -41,7 +41,7 @@ public class ApplicationComponent extends StreamData {
private static final Column[] INTEGER_COLUMNS = {
new Column(ApplicationComponentTable.COLUMN_COMPONENT_ID, new CoverOperation()),
- new Column(ApplicationComponentTable.COLUMN_PEER_ID, new CoverOperation()),
+ new Column(ApplicationComponentTable.COLUMN_APPLICATION_ID, new CoverOperation()),
};
private static final Column[] BYTE_COLUMNS = {};
@@ -82,11 +82,11 @@ public class ApplicationComponent extends StreamData {
setDataInteger(0, componentId);
}
- public Integer getPeerId() {
+ public Integer getApplicationId() {
return getDataInteger(1);
}
- public void setPeerId(Integer peerId) {
- setDataInteger(1, peerId);
+ public void setApplicationId(Integer applicationId) {
+ setDataInteger(1, applicationId);
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponentTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponentTable.java
index 10b39796d..921398cdf 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponentTable.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponentTable.java
@@ -16,7 +16,6 @@
*
*/
-
package org.apache.skywalking.apm.collector.storage.table.application;
import org.apache.skywalking.apm.collector.core.data.CommonTable;
@@ -27,5 +26,5 @@ import org.apache.skywalking.apm.collector.core.data.CommonTable;
public class ApplicationComponentTable extends CommonTable {
public static final String TABLE = "application_component";
public static final String COLUMN_COMPONENT_ID = "component_id";
- public static final String COLUMN_PEER_ID = "peer_id";
+ public static final String COLUMN_APPLICATION_ID = "application_id";
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMapping.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMapping.java
index 0d777426c..e1b3fff77 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMapping.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMapping.java
@@ -41,7 +41,7 @@ public class ApplicationMapping extends StreamData {
private static final Column[] INTEGER_COLUMNS = {
new Column(ApplicationMappingTable.COLUMN_APPLICATION_ID, new CoverOperation()),
- new Column(ApplicationMappingTable.COLUMN_ADDRESS_ID, new CoverOperation()),
+ new Column(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID, new CoverOperation()),
};
private static final Column[] BYTE_COLUMNS = {};
@@ -74,12 +74,12 @@ public class ApplicationMapping extends StreamData {
setDataInteger(0, applicationId);
}
- public int getAddressId() {
+ public int getMappingApplicationId() {
return getDataInteger(1);
}
- public void setAddressId(int addressId) {
- setDataInteger(1, addressId);
+ public void setMappingApplicationId(int mappingApplicationId) {
+ setDataInteger(1, mappingApplicationId);
}
public long getTimeBucket() {
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMappingTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMappingTable.java
index df9fbbb1d..fbaa49e24 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMappingTable.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMappingTable.java
@@ -16,7 +16,6 @@
*
*/
-
package org.apache.skywalking.apm.collector.storage.table.application;
import org.apache.skywalking.apm.collector.core.data.CommonTable;
@@ -27,5 +26,5 @@ import org.apache.skywalking.apm.collector.core.data.CommonTable;
public class ApplicationMappingTable extends CommonTable {
public static final String TABLE = "application_mapping";
public static final String COLUMN_APPLICATION_ID = "application_id";
- public static final String COLUMN_ADDRESS_ID = "address_id";
+ public static final String COLUMN_MAPPING_APPLICATION_ID = "mapping_application_id";
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java
index 0affa2480..88ca7f14f 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java
@@ -28,7 +28,6 @@ public class ApplicationNode extends Node {
private Float sla;
private Long callsPerSec;
private Integer responseTimePerSec;
- private Long calls;
private Float apdex;
private Boolean isAlarm;
private Integer numOfServer;
@@ -59,14 +58,6 @@ public class ApplicationNode extends Node {
this.responseTimePerSec = responseTimePerSec;
}
- public Long getCalls() {
- return calls;
- }
-
- public void setCalls(Long calls) {
- this.calls = calls;
- }
-
public Float getApdex() {
return apdex;
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java
index 7a388e3ce..74151ce0d 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java
@@ -22,10 +22,94 @@ package org.apache.skywalking.apm.collector.storage.ui.common;
* @author peng-yongsheng
*/
public class Call {
- private String source;
- private String target;
- private Boolean isAlert;
+ private int source;
+ private String sourceName;
+ private int target;
+ private String targetName;
+ private boolean isAlert;
private String callType;
- private Integer callsPerSec;
- private Integer responseTimePerSec;
+ private int calls;
+ private int callsPerSec;
+ private long responseTimes;
+ private int responseTimePerSec;
+
+ public int getSource() {
+ return source;
+ }
+
+ public void setSource(int source) {
+ this.source = source;
+ }
+
+ public String getSourceName() {
+ return sourceName;
+ }
+
+ public void setSourceName(String sourceName) {
+ this.sourceName = sourceName;
+ }
+
+ public int getTarget() {
+ return target;
+ }
+
+ public void setTarget(int target) {
+ this.target = target;
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public void setTargetName(String targetName) {
+ this.targetName = targetName;
+ }
+
+ public boolean isAlert() {
+ return isAlert;
+ }
+
+ public void setAlert(boolean alert) {
+ isAlert = alert;
+ }
+
+ public String getCallType() {
+ return callType;
+ }
+
+ public void setCallType(String callType) {
+ this.callType = callType;
+ }
+
+ public int getCalls() {
+ return calls;
+ }
+
+ public void setCalls(int calls) {
+ this.calls = calls;
+ }
+
+ public int getCallsPerSec() {
+ return callsPerSec;
+ }
+
+ public void setCallsPerSec(int callsPerSec) {
+ this.callsPerSec = callsPerSec;
+ }
+
+ public long getResponseTimes() {
+ return responseTimes;
+ }
+
+ public void setResponseTimes(long responseTimes) {
+ this.responseTimes = responseTimes;
+ }
+
+ public int getResponseTimePerSec() {
+ return responseTimePerSec;
+ }
+
+ public void setResponseTimePerSec(int responseTimePerSec) {
+ this.responseTimePerSec = responseTimePerSec;
+ }
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java
index e4d43c379..b4cf19254 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java
@@ -22,15 +22,15 @@ package org.apache.skywalking.apm.collector.storage.ui.common;
* @author peng-yongsheng
*/
public abstract class Node {
- private String id;
+ private int id;
private String name;
private String type;
- public String getId() {
+ public int getId() {
return id;
}
- public void setId(String id) {
+ public void setId(int id) {
this.id = id;
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java
index 7e3ac2c57..2f9340f91 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java
@@ -24,6 +24,23 @@ import java.util.List;
* @author peng-yongsheng
*/
public class Topology {
+
private List nodes;
private List calls;
+
+ public List getNodes() {
+ return nodes;
+ }
+
+ public void setNodes(List nodes) {
+ this.nodes = nodes;
+ }
+
+ public List getCalls() {
+ return calls;
+ }
+
+ public void setCalls(List calls) {
+ this.calls = calls;
+ }
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/utils/TimePyramidTableNameBuilder.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/utils/TimePyramidTableNameBuilder.java
new file mode 100644
index 000000000..6bfd365ee
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/utils/TimePyramidTableNameBuilder.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.storage.utils;
+
+import org.apache.skywalking.apm.collector.core.storage.TimePyramid;
+import org.apache.skywalking.apm.collector.core.util.Const;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+
+/**
+ * @author peng-yongsheng
+ */
+public class TimePyramidTableNameBuilder {
+
+ private TimePyramidTableNameBuilder() {
+ }
+
+ public static String build(Step step, String tableName) {
+ switch (step) {
+ case MONTH:
+ tableName = tableName + Const.ID_SPLIT + TimePyramid.Month.getName();
+ break;
+ case DAY:
+ tableName = tableName + Const.ID_SPLIT + TimePyramid.Day.getName();
+ break;
+ case HOUR:
+ tableName = tableName + Const.ID_SPLIT + TimePyramid.Day.getName();
+ break;
+ case MINUTE:
+ tableName = tableName + Const.ID_SPLIT + TimePyramid.Minute.getName();
+ break;
+ }
+ return tableName;
+ }
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationComponentEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationComponentEsUIDAO.java
index d77825ec2..d3d8879f4 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationComponentEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationComponentEsUIDAO.java
@@ -18,13 +18,14 @@
package org.apache.skywalking.apm.collector.storage.es.dao;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
+import java.util.LinkedList;
+import java.util.List;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentUIDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
-import org.apache.skywalking.apm.collector.storage.es.dao.acp.ApplicationComponentMinuteEsPersistenceDAO;
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
@@ -39,51 +40,47 @@ import org.slf4j.LoggerFactory;
*/
public class ApplicationComponentEsUIDAO extends EsDAO implements IApplicationComponentUIDAO {
- private final Logger logger = LoggerFactory.getLogger(ApplicationComponentMinuteEsPersistenceDAO.class);
+ private final Logger logger = LoggerFactory.getLogger(ApplicationComponentEsUIDAO.class);
public ApplicationComponentEsUIDAO(ElasticSearchClient client) {
super(client);
}
- @Override public JsonArray load(long startTime, long endTime) {
+ @Override public List load(Step step, long startTime, long endTime) {
logger.debug("application component load, start time: {}, end time: {}", startTime, endTime);
- JsonArray applicationComponentArray = new JsonArray();
- applicationComponentArray.addAll(aggregationByComponentId(startTime, endTime));
- return applicationComponentArray;
- }
-
- private JsonArray aggregationByComponentId(long startTime, long endTime) {
- SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(ApplicationComponentTable.TABLE);
+ String tableName = TimePyramidTableNameBuilder.build(step, ApplicationComponentTable.TABLE);
+ SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName);
searchRequestBuilder.setTypes(ApplicationComponentTable.TABLE_TYPE);
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
searchRequestBuilder.setQuery(QueryBuilders.rangeQuery(ApplicationComponentTable.COLUMN_TIME_BUCKET).gte(startTime).lte(endTime));
searchRequestBuilder.setSize(0);
searchRequestBuilder.addAggregation(AggregationBuilders.terms(ApplicationComponentTable.COLUMN_COMPONENT_ID).field(ApplicationComponentTable.COLUMN_COMPONENT_ID).size(100)
- .subAggregation(AggregationBuilders.terms(ApplicationComponentTable.COLUMN_PEER_ID).field(ApplicationComponentTable.COLUMN_PEER_ID).size(100)));
+ .subAggregation(AggregationBuilders.terms(ApplicationComponentTable.COLUMN_APPLICATION_ID).field(ApplicationComponentTable.COLUMN_APPLICATION_ID).size(100)));
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
Terms componentIdTerms = searchResponse.getAggregations().get(ApplicationComponentTable.COLUMN_COMPONENT_ID);
- JsonArray applicationComponentArray = new JsonArray();
+
+ List applicationComponents = new LinkedList<>();
for (Terms.Bucket componentIdBucket : componentIdTerms.getBuckets()) {
int componentId = componentIdBucket.getKeyAsNumber().intValue();
- buildComponentArray(componentIdBucket, componentId, applicationComponentArray);
+ buildApplicationComponents(componentIdBucket, componentId, applicationComponents);
}
- return applicationComponentArray;
+ return applicationComponents;
}
- private void buildComponentArray(Terms.Bucket componentBucket, int componentId,
- JsonArray applicationComponentArray) {
- Terms peerIdTerms = componentBucket.getAggregations().get(ApplicationComponentTable.COLUMN_PEER_ID);
+ private void buildApplicationComponents(Terms.Bucket componentBucket, int componentId,
+ List applicationComponents) {
+ Terms peerIdTerms = componentBucket.getAggregations().get(ApplicationComponentTable.COLUMN_APPLICATION_ID);
for (Terms.Bucket peerIdBucket : peerIdTerms.getBuckets()) {
- int peerId = peerIdBucket.getKeyAsNumber().intValue();
+ int applicationId = peerIdBucket.getKeyAsNumber().intValue();
- JsonObject applicationComponentObj = new JsonObject();
- applicationComponentObj.addProperty(ApplicationComponentTable.COLUMN_COMPONENT_ID, componentId);
- applicationComponentObj.addProperty(ApplicationComponentTable.COLUMN_PEER_ID, peerId);
- applicationComponentArray.add(applicationComponentObj);
+ ApplicationComponent applicationComponent = new ApplicationComponent();
+ applicationComponent.setComponentId(componentId);
+ applicationComponent.setApplicationId(applicationId);
+ applicationComponents.add(applicationComponent);
}
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationMappingEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationMappingEsUIDAO.java
index 4bb7ae6fa..6ffc1876d 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationMappingEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationMappingEsUIDAO.java
@@ -18,12 +18,14 @@
package org.apache.skywalking.apm.collector.storage.es.dao;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
+import java.util.LinkedList;
+import java.util.List;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingUIDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
@@ -44,8 +46,10 @@ public class ApplicationMappingEsUIDAO extends EsDAO implements IApplicationMapp
super(client);
}
- @Override public JsonArray load(long startTime, long endTime) {
- SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(ApplicationMappingTable.TABLE);
+ @Override public List load(Step step, long startTime, long endTime) {
+ String tableName = TimePyramidTableNameBuilder.build(step, ApplicationMappingTable.TABLE);
+
+ SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName);
searchRequestBuilder.setTypes(ApplicationMappingTable.TABLE_TYPE);
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
searchRequestBuilder.setQuery(QueryBuilders.rangeQuery(ApplicationMappingTable.COLUMN_TIME_BUCKET).gte(startTime).lte(endTime));
@@ -53,24 +57,25 @@ public class ApplicationMappingEsUIDAO extends EsDAO implements IApplicationMapp
searchRequestBuilder.addAggregation(
AggregationBuilders.terms(ApplicationMappingTable.COLUMN_APPLICATION_ID).field(ApplicationMappingTable.COLUMN_APPLICATION_ID).size(100)
- .subAggregation(AggregationBuilders.terms(ApplicationMappingTable.COLUMN_ADDRESS_ID).field(ApplicationMappingTable.COLUMN_ADDRESS_ID).size(100)));
+ .subAggregation(AggregationBuilders.terms(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID).field(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID).size(100)));
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
Terms applicationIdTerms = searchResponse.getAggregations().get(ApplicationMappingTable.COLUMN_APPLICATION_ID);
- JsonArray applicationMappingArray = new JsonArray();
+ List applicationMappings = new LinkedList<>();
for (Terms.Bucket applicationIdBucket : applicationIdTerms.getBuckets()) {
int applicationId = applicationIdBucket.getKeyAsNumber().intValue();
- Terms addressIdTerms = applicationIdBucket.getAggregations().get(ApplicationMappingTable.COLUMN_ADDRESS_ID);
+ Terms addressIdTerms = applicationIdBucket.getAggregations().get(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID);
for (Terms.Bucket addressIdBucket : addressIdTerms.getBuckets()) {
int addressId = addressIdBucket.getKeyAsNumber().intValue();
- JsonObject applicationMappingObj = new JsonObject();
- applicationMappingObj.addProperty(ApplicationMappingTable.COLUMN_APPLICATION_ID, applicationId);
- applicationMappingObj.addProperty(ApplicationMappingTable.COLUMN_ADDRESS_ID, addressId);
- applicationMappingArray.add(applicationMappingObj);
+
+ ApplicationMapping applicationMapping = new ApplicationMapping();
+ applicationMapping.setApplicationId(applicationId);
+ applicationMapping.setMappingApplicationId(addressId);
+ applicationMappings.add(applicationMapping);
}
}
- logger.debug("application mapping data: {}", applicationMappingArray.toString());
- return applicationMappingArray;
+ logger.debug("application mapping data: {}", applicationMappings.toString());
+ return applicationMappings;
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationReferenceMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationReferenceMetricEsUIDAO.java
index a7011b111..8a7ca9816 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationReferenceMetricEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ApplicationReferenceMetricEsUIDAO.java
@@ -18,82 +18,114 @@
package org.apache.skywalking.apm.collector.storage.es.dao;
-import com.google.gson.JsonArray;
+import java.util.LinkedList;
+import java.util.List;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.storage.dao.IApplicationReferenceMetricUIDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
+import org.apache.skywalking.apm.collector.storage.table.MetricSource;
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable;
+import org.apache.skywalking.apm.collector.storage.ui.common.Call;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
+import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.aggregations.AggregationBuilders;
+import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.elasticsearch.search.aggregations.metrics.sum.Sum;
/**
* @author peng-yongsheng
*/
public class ApplicationReferenceMetricEsUIDAO extends EsDAO implements IApplicationReferenceMetricUIDAO {
- private final Logger logger = LoggerFactory.getLogger(ApplicationReferenceMetricEsUIDAO.class);
-
public ApplicationReferenceMetricEsUIDAO(ElasticSearchClient client) {
super(client);
}
- @Override public JsonArray load(long startTime, long endTime) {
- SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(ApplicationReferenceMetricTable.TABLE);
+ @Override public List getFrontApplications(Step step, int applicationId, long startTime, long endTime,
+ MetricSource metricSource) {
+ String tableName = TimePyramidTableNameBuilder.build(step, ApplicationReferenceMetricTable.TABLE);
+
+ SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName);
searchRequestBuilder.setTypes(ApplicationReferenceMetricTable.TABLE_TYPE);
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
- searchRequestBuilder.setQuery(QueryBuilders.rangeQuery(ApplicationReferenceMetricTable.COLUMN_TIME_BUCKET).gte(startTime).lte(endTime));
+
+ BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
+ boolQuery.must().add(QueryBuilders.rangeQuery(ApplicationReferenceMetricTable.COLUMN_TIME_BUCKET).gte(startTime).lte(endTime));
+ boolQuery.must().add(QueryBuilders.termQuery(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID, applicationId));
+ boolQuery.must().add(QueryBuilders.termQuery(ApplicationReferenceMetricTable.COLUMN_SOURCE_VALUE, metricSource.getValue()));
+
+ searchRequestBuilder.setQuery(boolQuery);
searchRequestBuilder.setSize(0);
TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms(ApplicationReferenceMetricTable.COLUMN_FRONT_APPLICATION_ID).field(ApplicationReferenceMetricTable.COLUMN_FRONT_APPLICATION_ID).size(100);
-// aggregationBuilder.subAggregation(AggregationBuilders.terms(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID).field(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID).size(100)
-// .subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.COLUMN_S1_LTE).field(ApplicationReferenceMetricTable.COLUMN_S1_LTE))
-// .subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.COLUMN_S3_LTE).field(ApplicationReferenceMetricTable.COLUMN_S3_LTE))
-// .subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.COLUMN_S5_LTE).field(ApplicationReferenceMetricTable.COLUMN_S5_LTE))
-// .subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.COLUMN_S5_GT).field(ApplicationReferenceMetricTable.COLUMN_S5_GT))
-// .subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.COLUMN_SUMMARY).field(ApplicationReferenceMetricTable.COLUMN_SUMMARY))
-// .subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.COLUMN_ERROR).field(ApplicationReferenceMetricTable.COLUMN_ERROR)));
+ aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_CALLS).field(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_CALLS));
+ aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_DURATION_SUM).field(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_DURATION_SUM));
searchRequestBuilder.addAggregation(aggregationBuilder);
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
- JsonArray applicationReferenceMetricArray = new JsonArray();
-// Terms frontApplicationIdTerms = searchResponse.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_FRONT_APPLICATION_ID);
-// for (Terms.Bucket frontApplicationIdBucket : frontApplicationIdTerms.getBuckets()) {
-// int frontApplicationId = frontApplicationIdBucket.getKeyAsNumber().intValue();
-// Terms behindApplicationIdTerms = frontApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID);
-// for (Terms.Bucket behindApplicationIdBucket : behindApplicationIdTerms.getBuckets()) {
-// int behindApplicationId = behindApplicationIdBucket.getKeyAsNumber().intValue();
-//
-// if (behindApplicationId != 0) {
-// Sum s1LTE = behindApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_S1_LTE);
-// Sum s3LTE = behindApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_S3_LTE);
-// Sum s5LTE = behindApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_S5_LTE);
-// Sum s5GT = behindApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_S5_GT);
-// Sum summary = behindApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_SUMMARY);
-// Sum error = behindApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_ERROR);
-// logger.debug("frontApplicationId: {}, behindApplicationId: {}, s1LTE: {}, s3LTE: {}, s5LTE: {}, s5GT: {}, error: {}, summary: {}", frontApplicationId,
-// behindApplicationId, s1LTE.getValue(), s3LTE.getValue(), s5LTE.getValue(), s5GT.getValue(), error.getValue(), summary.getValue());
-//
-// JsonObject nodeRefResSumObj = new JsonObject();
-// nodeRefResSumObj.addProperty(ColumnNameUtils.INSTANCE.rename(ApplicationReferenceMetricTable.COLUMN_FRONT_APPLICATION_ID), frontApplicationId);
-// nodeRefResSumObj.addProperty(ColumnNameUtils.INSTANCE.rename(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID), behindApplicationId);
-// nodeRefResSumObj.addProperty(ColumnNameUtils.INSTANCE.rename(ApplicationReferenceMetricTable.COLUMN_S1_LTE), s1LTE.getValue());
-// nodeRefResSumObj.addProperty(ColumnNameUtils.INSTANCE.rename(ApplicationReferenceMetricTable.COLUMN_S3_LTE), s3LTE.getValue());
-// nodeRefResSumObj.addProperty(ColumnNameUtils.INSTANCE.rename(ApplicationReferenceMetricTable.COLUMN_S5_LTE), s5LTE.getValue());
-// nodeRefResSumObj.addProperty(ColumnNameUtils.INSTANCE.rename(ApplicationReferenceMetricTable.COLUMN_S5_GT), s5GT.getValue());
-// nodeRefResSumObj.addProperty(ColumnNameUtils.INSTANCE.rename(ApplicationReferenceMetricTable.COLUMN_ERROR), error.getValue());
-// nodeRefResSumObj.addProperty(ColumnNameUtils.INSTANCE.rename(ApplicationReferenceMetricTable.COLUMN_SUMMARY), summary.getValue());
-// nodeRefResSumArray.add(nodeRefResSumObj);
-// }
-// }
-// }
+ List nodes = new LinkedList<>();
+ Terms frontApplicationIdTerms = searchResponse.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_FRONT_APPLICATION_ID);
+ for (Terms.Bucket frontApplicationIdBucket : frontApplicationIdTerms.getBuckets()) {
+ int frontApplicationId = frontApplicationIdBucket.getKeyAsNumber().intValue();
+ Sum calls = frontApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_CALLS);
+ Sum responseTimes = frontApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_DURATION_SUM);
- return applicationReferenceMetricArray;
+ Call call = new Call();
+ call.setSource(frontApplicationId);
+ call.setTarget(applicationId);
+ call.setCalls((int)calls.getValue());
+ call.setResponseTimes((int)responseTimes.getValue());
+ nodes.add(call);
+ }
+
+ return nodes;
+ }
+
+ @Override public List getBehindApplications(Step step, int applicationId, long startTime, long endTime,
+ MetricSource metricSource) {
+ String tableName = TimePyramidTableNameBuilder.build(step, ApplicationReferenceMetricTable.TABLE);
+
+ SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName);
+ searchRequestBuilder.setTypes(ApplicationReferenceMetricTable.TABLE_TYPE);
+ searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
+
+ BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
+ boolQuery.must().add(QueryBuilders.rangeQuery(ApplicationReferenceMetricTable.COLUMN_TIME_BUCKET).gte(startTime).lte(endTime));
+ boolQuery.must().add(QueryBuilders.termQuery(ApplicationReferenceMetricTable.COLUMN_FRONT_APPLICATION_ID, applicationId));
+ boolQuery.must().add(QueryBuilders.termQuery(ApplicationReferenceMetricTable.COLUMN_SOURCE_VALUE, metricSource.getValue()));
+
+ searchRequestBuilder.setQuery(boolQuery);
+ searchRequestBuilder.setSize(0);
+
+ TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID).field(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID).size(100);
+ aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_CALLS).field(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_CALLS));
+ aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_DURATION_SUM).field(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_DURATION_SUM));
+
+ searchRequestBuilder.addAggregation(aggregationBuilder);
+ SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
+
+ List nodes = new LinkedList<>();
+ Terms behindApplicationIdTerms = searchResponse.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID);
+ for (Terms.Bucket behindApplicationIdBucket : behindApplicationIdTerms.getBuckets()) {
+ int behindApplicationId = behindApplicationIdBucket.getKeyAsNumber().intValue();
+ Sum calls = behindApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_CALLS);
+ Sum responseTimes = behindApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_DURATION_SUM);
+
+ Call call = new Call();
+ call.setTarget(behindApplicationId);
+ call.setSource(applicationId);
+ call.setCalls((int)calls.getValue());
+ call.setResponseTimes((int)responseTimes.getValue());
+ nodes.add(call);
+ }
+
+ return nodes;
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
index 7148c1704..b8b3dd1bc 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
@@ -94,12 +94,19 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO {
return heartBeatTime;
}
- @Override public List getApplications(long startTime, long endTime) {
+ @Override public List getApplications(long startTime, long endTime, int... applicationIds) {
logger.debug("application list get, start time: {}, end time: {}", startTime, endTime);
SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceTable.TABLE);
searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE);
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
- searchRequestBuilder.setQuery(QueryBuilders.rangeQuery(InstanceTable.COLUMN_HEARTBEAT_TIME).gte(startTime));
+
+ BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
+ boolQueryBuilder.must().add(QueryBuilders.rangeQuery(InstanceTable.COLUMN_HEARTBEAT_TIME).gte(startTime));
+ if (applicationIds.length > 0) {
+ boolQueryBuilder.must().add(QueryBuilders.termsQuery(InstanceTable.COLUMN_APPLICATION_ID, applicationIds));
+ }
+
+ searchRequestBuilder.setQuery(boolQueryBuilder);
searchRequestBuilder.setSize(0);
searchRequestBuilder.addAggregation(AggregationBuilders.terms(InstanceTable.COLUMN_APPLICATION_ID).field(InstanceTable.COLUMN_APPLICATION_ID).size(100)
.subAggregation(AggregationBuilders.count(InstanceTable.COLUMN_INSTANCE_ID).field(InstanceTable.COLUMN_INSTANCE_ID)));
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/AbstractApplicationComponentEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/AbstractApplicationComponentEsPersistenceDAO.java
index e729b4b78..bd405e2ff 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/AbstractApplicationComponentEsPersistenceDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/AbstractApplicationComponentEsPersistenceDAO.java
@@ -44,7 +44,7 @@ public abstract class AbstractApplicationComponentEsPersistenceDAO extends Abstr
applicationComponent.setMetricId((String)source.get(ApplicationComponentTable.COLUMN_METRIC_ID));
applicationComponent.setComponentId(((Number)source.get(ApplicationComponentTable.COLUMN_COMPONENT_ID)).intValue());
- applicationComponent.setPeerId(((Number)source.get(ApplicationComponentTable.COLUMN_PEER_ID)).intValue());
+ applicationComponent.setApplicationId(((Number)source.get(ApplicationComponentTable.COLUMN_APPLICATION_ID)).intValue());
applicationComponent.setTimeBucket(((Number)source.get(ApplicationComponentTable.COLUMN_TIME_BUCKET)).longValue());
return applicationComponent;
}
@@ -55,7 +55,7 @@ public abstract class AbstractApplicationComponentEsPersistenceDAO extends Abstr
source.put(ApplicationComponentTable.COLUMN_METRIC_ID, streamData.getMetricId());
source.put(ApplicationComponentTable.COLUMN_COMPONENT_ID, streamData.getComponentId());
- source.put(ApplicationComponentTable.COLUMN_PEER_ID, streamData.getPeerId());
+ source.put(ApplicationComponentTable.COLUMN_APPLICATION_ID, streamData.getApplicationId());
source.put(ApplicationComponentTable.COLUMN_TIME_BUCKET, streamData.getTimeBucket());
return source;
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/AbstractApplicationMappingEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/AbstractApplicationMappingEsPersistenceDAO.java
index 4bea4052e..c53681248 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/AbstractApplicationMappingEsPersistenceDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/AbstractApplicationMappingEsPersistenceDAO.java
@@ -44,7 +44,7 @@ public abstract class AbstractApplicationMappingEsPersistenceDAO extends Abstrac
applicationMapping.setMetricId((String)source.get(ApplicationMappingTable.COLUMN_METRIC_ID));
applicationMapping.setApplicationId(((Number)source.get(ApplicationMappingTable.COLUMN_APPLICATION_ID)).intValue());
- applicationMapping.setAddressId(((Number)source.get(ApplicationMappingTable.COLUMN_ADDRESS_ID)).intValue());
+ applicationMapping.setMappingApplicationId(((Number)source.get(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID)).intValue());
applicationMapping.setTimeBucket(((Number)source.get(ApplicationMappingTable.COLUMN_TIME_BUCKET)).longValue());
return applicationMapping;
}
@@ -55,7 +55,7 @@ public abstract class AbstractApplicationMappingEsPersistenceDAO extends Abstrac
source.put(ApplicationMappingTable.COLUMN_METRIC_ID, streamData.getMetricId());
source.put(ApplicationMappingTable.COLUMN_APPLICATION_ID, streamData.getApplicationId());
- source.put(ApplicationMappingTable.COLUMN_ADDRESS_ID, streamData.getAddressId());
+ source.put(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID, streamData.getMappingApplicationId());
source.put(ApplicationMappingTable.COLUMN_TIME_BUCKET, streamData.getTimeBucket());
return source;
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/ApplicationEsCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/ApplicationEsCacheDAO.java
index f886b0ff0..ded51ed6c 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/ApplicationEsCacheDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/ApplicationEsCacheDAO.java
@@ -20,9 +20,9 @@ package org.apache.skywalking.apm.collector.storage.es.dao.cache;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
-import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
+import org.apache.skywalking.apm.collector.storage.table.register.Application;
import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable;
import org.elasticsearch.action.get.GetRequestBuilder;
import org.elasticsearch.action.get.GetResponse;
@@ -68,16 +68,20 @@ public class ApplicationEsCacheDAO extends EsDAO implements IApplicationCacheDAO
return 0;
}
- @Override public String getApplicationCode(int applicationId) {
+ @Override public Application getApplication(int applicationId) {
logger.debug("get application code, applicationId: {}", applicationId);
ElasticSearchClient client = getClient();
GetRequestBuilder getRequestBuilder = client.prepareGet(ApplicationTable.TABLE, String.valueOf(applicationId));
GetResponse getResponse = getRequestBuilder.get();
if (getResponse.isExists()) {
- return (String)getResponse.getSource().get(ApplicationTable.COLUMN_APPLICATION_CODE);
+ Application application = new Application();
+ application.setApplicationId(applicationId);
+ application.setApplicationCode((String)getResponse.getSource().get(ApplicationTable.COLUMN_APPLICATION_CODE));
+ application.setIsAddress(((Number)getResponse.getSource().get(ApplicationTable.COLUMN_IS_ADDRESS)).intValue());
+ return application;
}
- return Const.EMPTY_STRING;
+ return null;
}
@Override public int getApplicationIdByAddressId(int addressId) {
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/appcomp/AbstractApplicationComponentEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/appcomp/AbstractApplicationComponentEsTableDefine.java
index 1a7bb53d2..52cb83d5e 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/appcomp/AbstractApplicationComponentEsTableDefine.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/appcomp/AbstractApplicationComponentEsTableDefine.java
@@ -34,7 +34,7 @@ public abstract class AbstractApplicationComponentEsTableDefine extends ElasticS
@Override public final void initialize() {
addColumn(new ElasticSearchColumnDefine(ApplicationComponentTable.COLUMN_METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name()));
addColumn(new ElasticSearchColumnDefine(ApplicationComponentTable.COLUMN_COMPONENT_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(ApplicationComponentTable.COLUMN_PEER_ID, ElasticSearchColumnDefine.Type.Integer.name()));
+ addColumn(new ElasticSearchColumnDefine(ApplicationComponentTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
addColumn(new ElasticSearchColumnDefine(ApplicationComponentTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/appmapping/AbstractApplicationMappingEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/appmapping/AbstractApplicationMappingEsTableDefine.java
index df044ef49..9eea4f1a7 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/appmapping/AbstractApplicationMappingEsTableDefine.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/appmapping/AbstractApplicationMappingEsTableDefine.java
@@ -34,7 +34,7 @@ public abstract class AbstractApplicationMappingEsTableDefine extends ElasticSea
@Override public final void initialize() {
addColumn(new ElasticSearchColumnDefine(ApplicationMappingTable.COLUMN_METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name()));
addColumn(new ElasticSearchColumnDefine(ApplicationMappingTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
- addColumn(new ElasticSearchColumnDefine(ApplicationMappingTable.COLUMN_ADDRESS_ID, ElasticSearchColumnDefine.Type.Integer.name()));
+ addColumn(new ElasticSearchColumnDefine(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name()));
addColumn(new ElasticSearchColumnDefine(ApplicationMappingTable.COLUMN_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name()));
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationComponentH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationComponentH2UIDAO.java
index cb165ee0f..b783959a2 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationComponentH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationComponentH2UIDAO.java
@@ -16,19 +16,20 @@
*
*/
-
package org.apache.skywalking.apm.collector.storage.h2.dao;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.util.LinkedList;
+import java.util.List;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
+import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
+import org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentUIDAO;
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
-import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
-import org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentUIDAO;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -44,31 +45,29 @@ public class ApplicationComponentH2UIDAO extends H2DAO implements IApplicationCo
super(client);
}
- @Override public JsonArray load(long startTime, long endTime) {
- JsonArray applicationComponentArray = new JsonArray();
- applicationComponentArray.addAll(aggregationComponent(startTime, endTime));
- return applicationComponentArray;
- }
-
- private JsonArray aggregationComponent(long startTime, long endTime) {
+ @Override public List load(Step step, long startTime, long endTime) {
H2Client client = getClient();
- JsonArray applicationComponentArray = new JsonArray();
- String sql = SqlBuilder.buildSql(AGGREGATE_COMPONENT_SQL, ApplicationComponentTable.COLUMN_COMPONENT_ID, ApplicationComponentTable.COLUMN_PEER_ID,
- ApplicationComponentTable.TABLE, ApplicationComponentTable.COLUMN_TIME_BUCKET);
+ String tableName = TimePyramidTableNameBuilder.build(step, ApplicationComponentTable.TABLE);
+
+ List applicationComponents = new LinkedList<>();
+ String sql = SqlBuilder.buildSql(AGGREGATE_COMPONENT_SQL, ApplicationComponentTable.COLUMN_COMPONENT_ID, ApplicationComponentTable.COLUMN_APPLICATION_ID,
+ tableName, ApplicationComponentTable.COLUMN_TIME_BUCKET);
+
Object[] params = new Object[] {startTime, endTime};
try (ResultSet rs = client.executeQuery(sql, params)) {
while (rs.next()) {
- int peerId = rs.getInt(ApplicationComponentTable.COLUMN_PEER_ID);
+ int applicationId = rs.getInt(ApplicationComponentTable.COLUMN_APPLICATION_ID);
int componentId = rs.getInt(ApplicationComponentTable.COLUMN_COMPONENT_ID);
- JsonObject applicationComponentObj = new JsonObject();
- applicationComponentObj.addProperty(ApplicationComponentTable.COLUMN_COMPONENT_ID, componentId);
- applicationComponentObj.addProperty(ApplicationComponentTable.COLUMN_PEER_ID, peerId);
- applicationComponentArray.add(applicationComponentObj);
+
+ ApplicationComponent applicationComponent = new ApplicationComponent();
+ applicationComponent.setComponentId(componentId);
+ applicationComponent.setApplicationId(applicationId);
+ applicationComponents.add(applicationComponent);
}
} catch (SQLException | H2ClientException e) {
logger.error(e.getMessage(), e);
}
- return applicationComponentArray;
+ return applicationComponents;
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationMappingH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationMappingH2UIDAO.java
index d1dd55677..b060d887c 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationMappingH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationMappingH2UIDAO.java
@@ -16,19 +16,20 @@
*
*/
-
package org.apache.skywalking.apm.collector.storage.h2.dao;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.util.LinkedList;
+import java.util.List;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
+import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
+import org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingUIDAO;
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable;
-import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
-import org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingUIDAO;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -44,26 +45,29 @@ public class ApplicationMappingH2UIDAO extends H2DAO implements IApplicationMapp
super(client);
}
- @Override public JsonArray load(long startTime, long endTime) {
- H2Client client = getClient();
- JsonArray applicationMappingArray = new JsonArray();
- String sql = SqlBuilder.buildSql(APPLICATION_MAPPING_SQL, ApplicationMappingTable.COLUMN_APPLICATION_ID,
- ApplicationMappingTable.COLUMN_ADDRESS_ID, ApplicationMappingTable.TABLE, ApplicationMappingTable.COLUMN_TIME_BUCKET);
+ @Override public List load(Step step, long startTime, long endTime) {
+ String tableName = TimePyramidTableNameBuilder.build(step, ApplicationMappingTable.TABLE);
+ H2Client client = getClient();
+ String sql = SqlBuilder.buildSql(APPLICATION_MAPPING_SQL, ApplicationMappingTable.COLUMN_APPLICATION_ID,
+ ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID, tableName, ApplicationMappingTable.COLUMN_TIME_BUCKET);
+
+ List applicationMappings = new LinkedList<>();
Object[] params = new Object[] {startTime, endTime};
try (ResultSet rs = client.executeQuery(sql, params)) {
while (rs.next()) {
int applicationId = rs.getInt(ApplicationMappingTable.COLUMN_APPLICATION_ID);
- int addressId = rs.getInt(ApplicationMappingTable.COLUMN_ADDRESS_ID);
- JsonObject applicationMappingObj = new JsonObject();
- applicationMappingObj.addProperty(ApplicationMappingTable.COLUMN_APPLICATION_ID, applicationId);
- applicationMappingObj.addProperty(ApplicationMappingTable.COLUMN_ADDRESS_ID, addressId);
- applicationMappingArray.add(applicationMappingObj);
+ int addressId = rs.getInt(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID);
+
+ ApplicationMapping applicationMapping = new ApplicationMapping();
+ applicationMapping.setApplicationId(applicationId);
+ applicationMapping.setMappingApplicationId(addressId);
+ applicationMappings.add(applicationMapping);
}
} catch (SQLException | H2ClientException e) {
logger.error(e.getMessage(), e);
}
- logger.debug("node mapping data: {}", applicationMappingArray.toString());
- return applicationMappingArray;
+ logger.debug("node mapping data: {}", applicationMappings.toString());
+ return applicationMappings;
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationReferenceMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationReferenceMetricH2UIDAO.java
index 216485de9..36d9e6e0e 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationReferenceMetricH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ApplicationReferenceMetricH2UIDAO.java
@@ -16,13 +16,16 @@
*
*/
-
package org.apache.skywalking.apm.collector.storage.h2.dao;
import com.google.gson.JsonArray;
+import java.util.List;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
-import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
import org.apache.skywalking.apm.collector.storage.dao.IApplicationReferenceMetricUIDAO;
+import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
+import org.apache.skywalking.apm.collector.storage.table.MetricSource;
+import org.apache.skywalking.apm.collector.storage.ui.common.Call;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,7 +42,8 @@ public class ApplicationReferenceMetricH2UIDAO extends H2DAO implements IApplica
super(client);
}
- @Override public JsonArray load(long startTime, long endTime) {
+ @Override public List getFrontApplications(Step step, int applicationId, long startTime, long endTime,
+ MetricSource metricSource) {
H2Client client = getClient();
JsonArray applicationReferenceMetricArray = new JsonArray();
// String sql = SqlBuilder.buildSql(APPLICATION_REFERENCE_SQL, ApplicationReferenceMetricTable.COLUMN_S1_LTE,
@@ -67,6 +71,11 @@ public class ApplicationReferenceMetricH2UIDAO extends H2DAO implements IApplica
// } catch (SQLException | H2ClientException e) {
// logger.error(e.getMessage(), e);
// }
- return applicationReferenceMetricArray;
+ return null;
+ }
+
+ @Override public List getBehindApplications(Step step, int applicationId, long startTime, long endTime,
+ MetricSource metricSource) {
+ return null;
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
index a13ed2a2a..488a08332 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
@@ -87,7 +87,7 @@ public class InstanceH2UIDAO extends H2DAO implements IInstanceUIDAO {
}
@Override
- public List getApplications(long startTime, long endTime) {
+ public List getApplications(long startTime, long endTime, int... applicationIds) {
H2Client client = getClient();
List applications = new LinkedList<>();
String sql = SqlBuilder.buildSql(GET_APPLICATIONS_SQL, InstanceTable.COLUMN_INSTANCE_ID,
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/AbstractApplicationComponentH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/AbstractApplicationComponentH2PersistenceDAO.java
index c08156682..25019b012 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/AbstractApplicationComponentH2PersistenceDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/AbstractApplicationComponentH2PersistenceDAO.java
@@ -42,7 +42,7 @@ public abstract class AbstractApplicationComponentH2PersistenceDAO extends Abstr
applicationComponent.setMetricId(resultSet.getString(ApplicationComponentTable.COLUMN_METRIC_ID));
applicationComponent.setComponentId(resultSet.getInt(ApplicationComponentTable.COLUMN_COMPONENT_ID));
- applicationComponent.setPeerId(resultSet.getInt(ApplicationComponentTable.COLUMN_PEER_ID));
+ applicationComponent.setApplicationId(resultSet.getInt(ApplicationComponentTable.COLUMN_APPLICATION_ID));
applicationComponent.setTimeBucket(resultSet.getLong(ApplicationComponentTable.COLUMN_TIME_BUCKET));
return applicationComponent;
}
@@ -52,7 +52,7 @@ public abstract class AbstractApplicationComponentH2PersistenceDAO extends Abstr
source.put(ApplicationComponentTable.COLUMN_METRIC_ID, streamData.getMetricId());
source.put(ApplicationComponentTable.COLUMN_COMPONENT_ID, streamData.getComponentId());
- source.put(ApplicationComponentTable.COLUMN_PEER_ID, streamData.getPeerId());
+ source.put(ApplicationComponentTable.COLUMN_APPLICATION_ID, streamData.getApplicationId());
source.put(ApplicationComponentTable.COLUMN_TIME_BUCKET, streamData.getTimeBucket());
return source;
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/AbstractApplicationMappingH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/AbstractApplicationMappingH2PersistenceDAO.java
index a2d00ef39..3b6eb25c7 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/AbstractApplicationMappingH2PersistenceDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/AbstractApplicationMappingH2PersistenceDAO.java
@@ -42,7 +42,7 @@ public abstract class AbstractApplicationMappingH2PersistenceDAO extends Abstrac
applicationMapping.setMetricId(resultSet.getString(ApplicationMappingTable.COLUMN_METRIC_ID));
applicationMapping.setApplicationId(resultSet.getInt(ApplicationMappingTable.COLUMN_APPLICATION_ID));
- applicationMapping.setAddressId(resultSet.getInt(ApplicationMappingTable.COLUMN_ADDRESS_ID));
+ applicationMapping.setMappingApplicationId(resultSet.getInt(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID));
applicationMapping.setTimeBucket(resultSet.getLong(ApplicationMappingTable.COLUMN_TIME_BUCKET));
return applicationMapping;
}
@@ -52,7 +52,7 @@ public abstract class AbstractApplicationMappingH2PersistenceDAO extends Abstrac
source.put(ApplicationMappingTable.COLUMN_METRIC_ID, streamData.getMetricId());
source.put(ApplicationMappingTable.COLUMN_APPLICATION_ID, streamData.getApplicationId());
- source.put(ApplicationMappingTable.COLUMN_ADDRESS_ID, streamData.getAddressId());
+ source.put(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID, streamData.getMappingApplicationId());
source.put(ApplicationMappingTable.COLUMN_TIME_BUCKET, streamData.getTimeBucket());
return source;
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/ApplicationH2CacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/ApplicationH2CacheDAO.java
index 051eb91ff..6d4f612b7 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/ApplicationH2CacheDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/ApplicationH2CacheDAO.java
@@ -22,10 +22,10 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
-import org.apache.skywalking.apm.collector.core.util.Const;
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO;
import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
+import org.apache.skywalking.apm.collector.storage.table.register.Application;
import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -38,7 +38,7 @@ public class ApplicationH2CacheDAO extends H2DAO implements IApplicationCacheDAO
private final Logger logger = LoggerFactory.getLogger(ApplicationH2CacheDAO.class);
private static final String GET_APPLICATION_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ?";
- private static final String GET_APPLICATION_CODE_SQL = "select {0} from {1} where {2} = ?";
+ private static final String GET_APPLICATION_SQL = "select {0},{1} from {2} where {3} = ?";
public ApplicationH2CacheDAO(H2Client client) {
super(client);
@@ -61,19 +61,23 @@ public class ApplicationH2CacheDAO extends H2DAO implements IApplicationCacheDAO
return 0;
}
- @Override public String getApplicationCode(int applicationId) {
+ @Override public Application getApplication(int applicationId) {
logger.debug("get application code, applicationId: {}", applicationId);
H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_APPLICATION_CODE_SQL, ApplicationTable.COLUMN_APPLICATION_CODE, ApplicationTable.TABLE, ApplicationTable.COLUMN_APPLICATION_ID);
+ String sql = SqlBuilder.buildSql(GET_APPLICATION_SQL, ApplicationTable.COLUMN_APPLICATION_CODE, ApplicationTable.COLUMN_IS_ADDRESS, ApplicationTable.TABLE, ApplicationTable.COLUMN_APPLICATION_ID);
Object[] params = new Object[] {applicationId};
try (ResultSet rs = client.executeQuery(sql, params)) {
if (rs.next()) {
- return rs.getString(1);
+ Application application = new Application();
+ application.setApplicationId(applicationId);
+ application.setApplicationCode(rs.getString(1));
+ application.setIsAddress(rs.getInt(2));
+ return application;
}
} catch (SQLException | H2ClientException e) {
logger.error(e.getMessage(), e);
}
- return Const.EMPTY_STRING;
+ return null;
}
@Override public int getApplicationIdByAddressId(int addressId) {
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/appcomp/AbstractApplicationComponentH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/appcomp/AbstractApplicationComponentH2TableDefine.java
index 570dcc7f7..2f0102c6b 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/appcomp/AbstractApplicationComponentH2TableDefine.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/appcomp/AbstractApplicationComponentH2TableDefine.java
@@ -35,7 +35,7 @@ public abstract class AbstractApplicationComponentH2TableDefine extends H2TableD
addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_METRIC_ID, H2ColumnDefine.Type.Varchar.name()));
addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_COMPONENT_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_PEER_ID, H2ColumnDefine.Type.Int.name()));
+ addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
addColumn(new H2ColumnDefine(ApplicationComponentTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/appmapping/AbstractApplicationMappingH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/appmapping/AbstractApplicationMappingH2TableDefine.java
index ee5239fb7..41ba8b8d5 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/appmapping/AbstractApplicationMappingH2TableDefine.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/appmapping/AbstractApplicationMappingH2TableDefine.java
@@ -35,7 +35,7 @@ public abstract class AbstractApplicationMappingH2TableDefine extends H2TableDef
addColumn(new H2ColumnDefine(ApplicationMappingTable.COLUMN_ID, H2ColumnDefine.Type.Varchar.name()));
addColumn(new H2ColumnDefine(ApplicationMappingTable.COLUMN_METRIC_ID, H2ColumnDefine.Type.Varchar.name()));
addColumn(new H2ColumnDefine(ApplicationMappingTable.COLUMN_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
- addColumn(new H2ColumnDefine(ApplicationMappingTable.COLUMN_ADDRESS_ID, H2ColumnDefine.Type.Int.name()));
+ addColumn(new H2ColumnDefine(ApplicationMappingTable.COLUMN_MAPPING_APPLICATION_ID, H2ColumnDefine.Type.Int.name()));
addColumn(new H2ColumnDefine(ApplicationMappingTable.COLUMN_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name()));
}
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtilsTestCase.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtilsTestCase.java
new file mode 100644
index 000000000..28a383dc3
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtilsTestCase.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.utils;
+
+import java.text.ParseException;
+import org.junit.Test;
+
+/**
+ * @author peng-yongsheng
+ */
+public class DurationUtilsTestCase {
+
+ @Test
+ public void test() throws ParseException {
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java
index b8f09c622..7a97ee968 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java
@@ -28,8 +28,9 @@ import org.apache.skywalking.apm.collector.storage.ui.common.Topology;
import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
import org.apache.skywalking.apm.collector.storage.ui.service.ServiceInfo;
import org.apache.skywalking.apm.collector.ui.graphql.Query;
-import org.apache.skywalking.apm.collector.ui.graphql.utils.DurationUtils;
import org.apache.skywalking.apm.collector.ui.service.ApplicationService;
+import org.apache.skywalking.apm.collector.ui.service.ApplicationTopologyService;
+import org.apache.skywalking.apm.collector.ui.utils.DurationUtils;
/**
* @author peng-yongsheng
@@ -38,6 +39,7 @@ public class ApplicationQuery implements Query {
private final ModuleManager moduleManager;
private ApplicationService applicationService;
+ private ApplicationTopologyService applicationTopologyService;
public ApplicationQuery(ModuleManager moduleManager) {
this.moduleManager = moduleManager;
@@ -50,38 +52,25 @@ public class ApplicationQuery implements Query {
return applicationService;
}
- public List getAllApplication(Duration duration) throws ParseException {
- long start = 0;
- long end = 0;
-
- switch (duration.getStep()) {
- case MONTH:
- start = DurationUtils.INSTANCE.monthDurationToSecondTimeBucket(duration.getStart());
- end = DurationUtils.INSTANCE.monthDurationToSecondTimeBucket(duration.getEnd());
- break;
- case DAY:
- start = DurationUtils.INSTANCE.dayDurationToSecondTimeBucket(duration.getStart());
- end = DurationUtils.INSTANCE.dayDurationToSecondTimeBucket(duration.getEnd());
- break;
- case HOUR:
- start = DurationUtils.INSTANCE.hourDurationToSecondTimeBucket(duration.getStart());
- end = DurationUtils.INSTANCE.hourDurationToSecondTimeBucket(duration.getEnd());
- break;
- case MINUTE:
- start = DurationUtils.INSTANCE.minuteDurationToSecondTimeBucket(duration.getStart());
- end = DurationUtils.INSTANCE.minuteDurationToSecondTimeBucket(duration.getEnd());
- break;
- case SECOND:
- start = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart());
- end = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd());
- break;
+ private ApplicationTopologyService getApplicationTopologyService() {
+ if (ObjectUtils.isEmpty(applicationTopologyService)) {
+ this.applicationTopologyService = new ApplicationTopologyService(moduleManager);
}
+ return applicationTopologyService;
+ }
+
+ public List getAllApplication(Duration duration) throws ParseException {
+ long start = DurationUtils.INSTANCE.durationToSecondTimeBucket(duration.getStep(), duration.getStart());
+ long end = DurationUtils.INSTANCE.durationToSecondTimeBucket(duration.getStep(), duration.getEnd());
return getApplicationService().getApplications(start, end);
}
- public Topology getApplicationTopology(int applicationId, Duration duration) {
- return null;
+ public Topology getApplicationTopology(int applicationId, Duration duration) throws ParseException {
+ long start = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart());
+ long end = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd());
+
+ return getApplicationTopologyService().getApplicationTopology(duration.getStep(), applicationId, start, end);
}
public List getSlowService(int applicationId, Duration duration, Integer top) {
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java
index d96317dd5..8008700e2 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java
@@ -39,11 +39,11 @@ public class ApplicationService {
this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
}
- public List getApplications(long startTime, long endTime) {
- List applications = instanceDAO.getApplications(startTime, endTime);
+ public List getApplications(long startTime, long endTime, int... applicationIds) {
+ List applications = instanceDAO.getApplications(startTime, endTime, applicationIds);
applications.forEach(application -> {
- String applicationCode = applicationCacheService.getApplicationCodeById(application.getId());
+ String applicationCode = applicationCacheService.getApplicationById(application.getId()).getApplicationCode();
application.setName(applicationCode);
});
return applications;
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java
new file mode 100644
index 000000000..e53c52b43
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.service;
+
+import java.text.ParseException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.skywalking.apm.collector.core.module.ModuleManager;
+import org.apache.skywalking.apm.collector.storage.StorageModule;
+import org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentUIDAO;
+import org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingUIDAO;
+import org.apache.skywalking.apm.collector.storage.dao.IApplicationReferenceMetricUIDAO;
+import org.apache.skywalking.apm.collector.storage.table.MetricSource;
+import org.apache.skywalking.apm.collector.storage.ui.common.Call;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+import org.apache.skywalking.apm.collector.storage.ui.common.Topology;
+import org.apache.skywalking.apm.collector.ui.utils.DurationUtils;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ApplicationTopologyService {
+
+ private final Logger logger = LoggerFactory.getLogger(ApplicationTopologyService.class);
+
+ private final IApplicationComponentUIDAO applicationComponentUIDAO;
+ private final IApplicationMappingUIDAO applicationMappingUIDAO;
+ private final IApplicationReferenceMetricUIDAO applicationReferenceMetricUIDAO;
+ private final ModuleManager moduleManager;
+
+ public ApplicationTopologyService(ModuleManager moduleManager) {
+ this.moduleManager = moduleManager;
+ this.applicationComponentUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationComponentUIDAO.class);
+ this.applicationMappingUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationMappingUIDAO.class);
+ this.applicationReferenceMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationReferenceMetricUIDAO.class);
+ }
+
+ public Topology getApplicationTopology(Step step, int applicationId, long startTime,
+ long endTime) throws ParseException {
+ logger.debug("startTime: {}, endTime: {}", startTime, endTime);
+ List applicationComponents = applicationComponentUIDAO.load(step, startTime, endTime);
+ List applicationMappings = applicationMappingUIDAO.load(step, startTime, endTime);
+
+ Map components = new HashMap<>();
+ applicationComponents.forEach(component -> components.put(component.getApplicationId(), ComponentsDefine.getInstance().getComponentName(component.getComponentId())));
+
+ List callerCalls = applicationReferenceMetricUIDAO.getFrontApplications(step, applicationId, startTime, endTime, MetricSource.Caller);
+ callerCalls.addAll(applicationReferenceMetricUIDAO.getBehindApplications(step, applicationId, startTime, endTime, MetricSource.Caller));
+
+ callerCalls.forEach(callerCall -> callerCall.setCallType(components.get(callerCall.getTarget())));
+
+ List calleeCalls = applicationReferenceMetricUIDAO.getFrontApplications(step, applicationId, startTime, endTime, MetricSource.Callee);
+ calleeCalls.addAll(applicationReferenceMetricUIDAO.getBehindApplications(step, applicationId, startTime, endTime, MetricSource.Callee));
+
+ calleeCalls.forEach(calleeCall -> calleeCall.setCallType(components.get(calleeCall.getTarget())));
+
+ Set mappings = new HashSet<>();
+ applicationMappings.forEach(mapping -> {
+ if (applicationId == mapping.getApplicationId()) {
+ mappings.add(mapping.getMappingApplicationId());
+ }
+ });
+
+ mappings.forEach(mappingApplicationId -> {
+ List frontCallerApplications = applicationReferenceMetricUIDAO.getFrontApplications(step, mappingApplicationId, startTime, endTime, MetricSource.Caller);
+ frontCallerApplications.forEach(call -> {
+ call.setCallType(components.get(call.getTarget()));
+ call.setTarget(applicationId);
+ callerCalls.add(call);
+ });
+
+ List behindCallerApplications = applicationReferenceMetricUIDAO.getBehindApplications(step, mappingApplicationId, startTime, endTime, MetricSource.Caller);
+ behindCallerApplications.forEach(call -> {
+ call.setCallType(components.get(call.getTarget()));
+ call.setSource(applicationId);
+ callerCalls.add(call);
+ });
+
+ List frontCalleeApplications = applicationReferenceMetricUIDAO.getFrontApplications(step, mappingApplicationId, startTime, endTime, MetricSource.Callee);
+ frontCalleeApplications.forEach(call -> {
+ call.setCallType(components.get(call.getTarget()));
+ call.setTarget(applicationId);
+ calleeCalls.add(call);
+ });
+
+ List behindCalleeApplications = applicationReferenceMetricUIDAO.getBehindApplications(step, mappingApplicationId, startTime, endTime, MetricSource.Callee);
+ behindCalleeApplications.forEach(call -> {
+ call.setCallType(components.get(call.getTarget()));
+ call.setSource(applicationId);
+ calleeCalls.add(call);
+ });
+ });
+
+ TopologyBuilder builder = new TopologyBuilder(moduleManager);
+
+ long secondsBetween = DurationUtils.INSTANCE.secondsBetween(step, startTime, endTime);
+ Topology topology = builder.build(applicationComponents, applicationMappings, callerCalls, calleeCalls, secondsBetween);
+
+ topology.getCalls().forEach(call -> {
+ int calls = call.getCalls();
+ long responseTimes = call.getResponseTimes();
+ call.setCallsPerSec((int)(calls / secondsBetween));
+ call.setResponseTimePerSec((int)(responseTimes / secondsBetween));
+ });
+ return topology;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/InstanceHealthService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/InstanceHealthService.java
index 98ba79884..718941342 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/InstanceHealthService.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/InstanceHealthService.java
@@ -60,7 +60,7 @@ public class InstanceHealthService {
response.add("instances", instances);
// instanceList.forEach(instance -> {
-// response.addProperty("applicationCode", applicationCacheService.getApplicationCodeById(applicationId));
+// response.addProperty("applicationCode", applicationCacheService.getApplicationById(applicationId));
// response.addProperty("applicationId", applicationId);
//
// IInstanceMetricUIDAO.InstanceMetric performance = instanceMetricUIDAO.get(timeBuckets, instance.getInstanceId());
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SpanService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SpanService.java
index 0e902fe34..57f118c8a 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SpanService.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SpanService.java
@@ -108,7 +108,7 @@ public class SpanService {
if (spanObject.getPeerId() == 0) {
peerJson.addProperty("value", spanObject.getPeer());
} else {
- peerJson.addProperty("value", applicationCacheService.getApplicationCodeById(spanObject.getPeerId()));
+ peerJson.addProperty("value", applicationCacheService.getApplicationById(spanObject.getPeerId()).getApplicationCode());
}
tagsArray.add(peerJson);
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
new file mode 100644
index 000000000..97ea1265a
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.service;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.skywalking.apm.collector.cache.CacheModule;
+import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
+import org.apache.skywalking.apm.collector.core.module.ModuleManager;
+import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
+import org.apache.skywalking.apm.collector.core.util.Const;
+import org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentUIDAO;
+import org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingUIDAO;
+import org.apache.skywalking.apm.collector.storage.table.register.Application;
+import org.apache.skywalking.apm.collector.storage.ui.application.ApplicationNode;
+import org.apache.skywalking.apm.collector.storage.ui.application.ConjecturalNode;
+import org.apache.skywalking.apm.collector.storage.ui.common.Call;
+import org.apache.skywalking.apm.collector.storage.ui.common.Node;
+import org.apache.skywalking.apm.collector.storage.ui.common.Topology;
+import org.apache.skywalking.apm.collector.storage.ui.common.VisualUserNode;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+
+/**
+ * @author peng-yongsheng
+ */
+class TopologyBuilder {
+
+ private final ApplicationCacheService applicationCacheService;
+
+ TopologyBuilder(ModuleManager moduleManager) {
+ this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
+ }
+
+ Topology build(List applicationComponents,
+ List applicationMappings, List callerCalls,
+ List calleeCalls, long secondsBetween) {
+ Map components = changeNodeComp2Map(applicationComponents);
+ Map mappings = changeMapping2Map(applicationMappings);
+
+ List calls = buildCalls(callerCalls, calleeCalls);
+
+ Set nodeIds = new HashSet<>();
+ calls.forEach(call -> {
+ String sourceName = applicationCacheService.getApplicationById(call.getSource()).getApplicationCode();
+ String targetName = applicationCacheService.getApplicationById(call.getTarget()).getApplicationCode();
+
+ call.setSourceName(sourceName);
+ call.setTargetName(targetName);
+
+ nodeIds.add(call.getSource());
+ nodeIds.add(call.getTarget());
+ });
+
+ List nodes = new LinkedList<>();
+ nodeIds.forEach(nodeId -> {
+ Application application = applicationCacheService.getApplicationById(nodeId);
+ if (BooleanUtils.valueToBoolean(application.getAddressId())) {
+ ConjecturalNode conjecturalNode = new ConjecturalNode();
+ conjecturalNode.setId(nodeId);
+ conjecturalNode.setName(application.getApplicationCode());
+ conjecturalNode.setType(components.getOrDefault(application.getApplicationId(), Const.UNKNOWN));
+ nodes.add(conjecturalNode);
+ } else {
+ if (nodeId == Const.NONE_APPLICATION_ID) {
+ VisualUserNode node = new VisualUserNode();
+ node.setId(nodeId);
+ node.setName(Const.USER_CODE);
+ node.setType(Const.USER_CODE.toUpperCase());
+ nodes.add(node);
+ } else {
+ ApplicationNode applicationNode = new ApplicationNode();
+ applicationNode.setId(nodeId);
+ applicationNode.setName(application.getApplicationCode());
+ applicationNode.setType(components.getOrDefault(application.getApplicationId(), Const.UNKNOWN));
+
+ calleeCalls.forEach(call -> {
+ if (call.getTarget() == nodeId) {
+ call.setCallsPerSec((int)(call.getCalls() / secondsBetween));
+ call.setResponseTimePerSec((int)(call.getResponseTimes() / secondsBetween));
+ }
+ });
+ nodes.add(applicationNode);
+ }
+ }
+ });
+
+ Topology topology = new Topology();
+ topology.setCalls(calls);
+ topology.setNodes(nodes);
+ return topology;
+ }
+
+ private Map changeMapping2Map(
+ List applicationMappings) {
+ Map mappings = new HashMap<>();
+ applicationMappings.forEach(applicationMapping -> {
+ String applicationCode = applicationCacheService.getApplicationById(applicationMapping.getApplicationId()).getApplicationCode();
+ String address = applicationCacheService.getApplicationById(applicationMapping.getMappingApplicationId()).getApplicationCode();
+ mappings.put(address, applicationCode);
+ });
+ return mappings;
+ }
+
+ private Map changeNodeComp2Map(
+ List applicationComponents) {
+ Map components = new HashMap<>();
+ applicationComponents.forEach(applicationComponent -> {
+ String componentName = ComponentsDefine.getInstance().getComponentName(applicationComponent.getComponentId());
+ components.put(applicationComponent.getApplicationId(), componentName);
+ });
+ return components;
+ }
+
+ private List buildCalls(List callerCalls, List calleeCalls) {
+ List calls = new LinkedList<>();
+
+ Set distinctCalls = new HashSet<>();
+ callerCalls.forEach(callerCall -> {
+ distinctCalls.add(callerCall.getSource() + Const.ID_SPLIT + callerCall.getTarget());
+ calls.add(callerCall);
+ });
+
+ calleeCalls.forEach(calleeCall -> {
+ String call = calleeCall.getSource() + Const.ID_SPLIT + calleeCall.getTarget();
+ if (!distinctCalls.contains(call)) {
+ distinctCalls.add(call);
+ calls.add(calleeCall);
+ }
+ });
+
+ return calls;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceDagDataBuilder.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceDagDataBuilder.java
deleted file mode 100644
index 297c43573..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceDagDataBuilder.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.service;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import org.apache.skywalking.apm.collector.cache.CacheModule;
-import org.apache.skywalking.apm.collector.core.util.Const;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable;
-import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable;
-import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.core.util.ColumnNameUtils;
-import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceDagDataBuilder {
- private final Logger logger = LoggerFactory.getLogger(TraceDagDataBuilder.class);
-
- private Integer nodeId = -1;
- private Map mappingMap = new HashMap<>();
- private Map nodeCompMap = new HashMap<>();
- private Map nodeIdMap = new HashMap<>();
- private JsonArray pointArray = new JsonArray();
- private JsonArray lineArray = new JsonArray();
- private final ApplicationCacheService applicationCacheService;
-
- public TraceDagDataBuilder(ModuleManager moduleManager) {
- this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class);
- }
-
- public JsonObject build(JsonArray nodeCompArray, JsonArray nodesMappingArray, JsonArray resSumArray) {
- changeNodeComp2Map(nodeCompArray);
- changeMapping2Map(nodesMappingArray);
-
- Map mergedResSumMap = getApplicationCode(resSumArray);
-
- mergedResSumMap.values().forEach(nodeRefJsonObj -> {
- String front = nodeRefJsonObj.get("front").getAsString();
- String behind = nodeRefJsonObj.get("behind").getAsString();
-
- if (hasMapping(behind)) {
- return;
- }
-
- JsonObject lineJsonObj = new JsonObject();
- lineJsonObj.addProperty("from", findOrCreateNode(front));
- lineJsonObj.addProperty("to", findOrCreateNode(behind));
- lineJsonObj.addProperty("resSum", nodeRefJsonObj.get(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_CALLS).getAsInt());
-
- lineArray.add(lineJsonObj);
- logger.debug("line: {}", lineJsonObj);
- });
-
- JsonObject dagJsonObj = new JsonObject();
- dagJsonObj.add("nodes", pointArray);
- dagJsonObj.add("nodeRefs", lineArray);
- return dagJsonObj;
- }
-
- private Integer findOrCreateNode(String peers) {
- if (nodeIdMap.containsKey(peers) && !peers.equals(Const.USER_CODE)) {
- return nodeIdMap.get(peers);
- } else {
- nodeId++;
- JsonObject nodeJsonObj = new JsonObject();
- nodeJsonObj.addProperty("id", nodeId);
- nodeJsonObj.addProperty("peer", peers);
- if (peers.equals(Const.USER_CODE)) {
- nodeJsonObj.addProperty("component", Const.USER_CODE);
- } else {
- nodeJsonObj.addProperty("component", nodeCompMap.get(peers));
- }
- pointArray.add(nodeJsonObj);
-
- nodeIdMap.put(peers, nodeId);
- logger.debug("node: {}", nodeJsonObj);
- }
- return nodeId;
- }
-
- private void changeMapping2Map(JsonArray nodesMappingArray) {
- for (int i = 0; i < nodesMappingArray.size(); i++) {
- JsonObject nodesMappingJsonObj = nodesMappingArray.get(i).getAsJsonObject();
- int applicationId = nodesMappingJsonObj.get(ApplicationMappingTable.COLUMN_APPLICATION_ID).getAsInt();
- String applicationCode = applicationCacheService.getApplicationCodeById(applicationId);
- int addressId = nodesMappingJsonObj.get(ApplicationMappingTable.COLUMN_ADDRESS_ID).getAsInt();
- String address = applicationCacheService.getApplicationCodeById(addressId);
- mappingMap.put(address, applicationCode);
- }
- }
-
- private void changeNodeComp2Map(JsonArray nodeCompArray) {
- for (int i = 0; i < nodeCompArray.size(); i++) {
- JsonObject nodesJsonObj = nodeCompArray.get(i).getAsJsonObject();
- logger.debug(nodesJsonObj.toString());
- int componentId = nodesJsonObj.get(ApplicationComponentTable.COLUMN_COMPONENT_ID).getAsInt();
- String componentName = ComponentsDefine.getInstance().getComponentName(componentId);
- int peerId = nodesJsonObj.get(ApplicationComponentTable.COLUMN_PEER_ID).getAsInt();
- String peer = applicationCacheService.getApplicationCodeById(peerId);
- nodeCompMap.put(peer, componentName);
- }
- }
-
- private boolean hasMapping(String peers) {
- return mappingMap.containsKey(peers);
- }
-
- private Map getApplicationCode(JsonArray nodeReference) {
- Map mergedRef = new LinkedHashMap<>();
- for (int i = 0; i < nodeReference.size(); i++) {
- JsonObject nodeRefJsonObj = nodeReference.get(i).getAsJsonObject();
-
- int frontApplicationId = nodeRefJsonObj.get(ColumnNameUtils.INSTANCE.rename(ApplicationReferenceMetricTable.COLUMN_FRONT_APPLICATION_ID)).getAsInt();
- int behindApplicationId = nodeRefJsonObj.get(ColumnNameUtils.INSTANCE.rename(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID)).getAsInt();
-
- String front = applicationCacheService.getApplicationCodeById(frontApplicationId);
- String behind = applicationCacheService.getApplicationCodeById(behindApplicationId);
-
- String id = front + Const.ID_SPLIT + behind;
- nodeRefJsonObj.addProperty("front", front);
- nodeRefJsonObj.addProperty("behind", behind);
- mergedRef.put(id, nodeRefJsonObj);
- }
-
- return mergedRef;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java
index 16da98b37..0c420e79a 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java
@@ -134,7 +134,7 @@ public class TraceStackService {
operationName = Const.EMPTY_STRING;
}
}
- String applicationCode = applicationCacheService.getApplicationCodeById(segment.getApplicationId());
+ String applicationCode = applicationCacheService.getApplicationById(segment.getApplicationId()).getApplicationCode();
long cost = spanObject.getEndTime() - spanObject.getStartTime();
if (cost == 0) {
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtils.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtils.java
new file mode 100644
index 000000000..0bb562220
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtils.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.utils;
+
+import java.text.ParseException;
+import java.util.Date;
+import org.apache.skywalking.apm.collector.core.util.Const;
+import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
+import org.apache.skywalking.apm.collector.storage.ui.common.Step;
+import org.joda.time.DateTime;
+import org.joda.time.Seconds;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum DurationUtils {
+ INSTANCE;
+
+ public long exchangeToTimeBucket(String dateStr) throws ParseException {
+ dateStr = dateStr.replaceAll("-", Const.EMPTY_STRING);
+ dateStr = dateStr.replaceAll(" ", Const.EMPTY_STRING);
+ return Long.valueOf(dateStr);
+ }
+
+ public long durationToSecondTimeBucket(Step step, String dateStr) throws ParseException {
+ long secondTimeBucket = 0;
+ switch (step) {
+ case MONTH:
+ secondTimeBucket = exchangeToTimeBucket(dateStr) * 100 * 100 * 100 * 100;
+ break;
+ case DAY:
+ secondTimeBucket = exchangeToTimeBucket(dateStr) * 100 * 100 * 100;
+ break;
+ case HOUR:
+ secondTimeBucket = exchangeToTimeBucket(dateStr) * 100 * 100;
+ break;
+ case MINUTE:
+ secondTimeBucket = exchangeToTimeBucket(dateStr) * 100;
+ break;
+ case SECOND:
+ secondTimeBucket = exchangeToTimeBucket(dateStr);
+ break;
+ }
+ return secondTimeBucket;
+ }
+
+ public long secondsBetween(Step step, long start, long end) throws ParseException {
+ Date startDate = null;
+ Date endDate = null;
+ switch (step) {
+ case MONTH:
+ startDate = TimeBucketUtils.MONTH_DATE_FORMAT.parse(String.valueOf(start));
+ endDate = TimeBucketUtils.MONTH_DATE_FORMAT.parse(String.valueOf(end));
+ break;
+ case DAY:
+ startDate = TimeBucketUtils.DAY_DATE_FORMAT.parse(String.valueOf(start));
+ endDate = TimeBucketUtils.DAY_DATE_FORMAT.parse(String.valueOf(end));
+ break;
+ case HOUR:
+ startDate = TimeBucketUtils.HOUR_DATE_FORMAT.parse(String.valueOf(start));
+ endDate = TimeBucketUtils.HOUR_DATE_FORMAT.parse(String.valueOf(end));
+ break;
+ case MINUTE:
+ startDate = TimeBucketUtils.MINUTE_DATE_FORMAT.parse(String.valueOf(start));
+ endDate = TimeBucketUtils.MINUTE_DATE_FORMAT.parse(String.valueOf(end));
+ break;
+ case SECOND:
+ startDate = TimeBucketUtils.SECOND_DATE_FORMAT.parse(String.valueOf(start));
+ endDate = TimeBucketUtils.SECOND_DATE_FORMAT.parse(String.valueOf(end));
+ break;
+ }
+
+ return Seconds.secondsBetween(new DateTime(startDate), new DateTime(endDate)).getSeconds();
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java
index c0bddff71..234a9c85d 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java
@@ -40,8 +40,8 @@ public class ApplicationQueryTestCase {
Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> {
Object[] arguments = invocation.getArguments();
- Assert.assertEquals(20170100000000l, arguments[0]);
- Assert.assertEquals(20170100000000l, arguments[1]);
+ Assert.assertEquals(20170100000000L, arguments[0]);
+ Assert.assertEquals(20170100000000L, arguments[1]);
return null;
});
@@ -61,8 +61,8 @@ public class ApplicationQueryTestCase {
Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> {
Object[] arguments = invocation.getArguments();
- Assert.assertEquals(20170101000000l, arguments[0]);
- Assert.assertEquals(20170101000000l, arguments[1]);
+ Assert.assertEquals(20170101000000L, arguments[0]);
+ Assert.assertEquals(20170101000000L, arguments[1]);
return null;
});
@@ -82,8 +82,8 @@ public class ApplicationQueryTestCase {
Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> {
Object[] arguments = invocation.getArguments();
- Assert.assertEquals(20170101010000l, arguments[0]);
- Assert.assertEquals(20170101010000l, arguments[1]);
+ Assert.assertEquals(20170101010000L, arguments[0]);
+ Assert.assertEquals(20170101010000L, arguments[1]);
return null;
});
@@ -103,8 +103,8 @@ public class ApplicationQueryTestCase {
Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> {
Object[] arguments = invocation.getArguments();
- Assert.assertEquals(20170101010100l, arguments[0]);
- Assert.assertEquals(20170101010100l, arguments[1]);
+ Assert.assertEquals(20170101010100L, arguments[0]);
+ Assert.assertEquals(20170101010100L, arguments[1]);
return null;
});
@@ -124,8 +124,8 @@ public class ApplicationQueryTestCase {
Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> {
Object[] arguments = invocation.getArguments();
- Assert.assertEquals(20170101010101l, arguments[0]);
- Assert.assertEquals(20170101010101l, arguments[1]);
+ Assert.assertEquals(20170101010101L, arguments[0]);
+ Assert.assertEquals(20170101010101L, arguments[1]);
return null;
});
From 953cfbb7253e6c63c05b0c41995c2b33070d32b8 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Fri, 26 Jan 2018 00:24:27 +0800
Subject: [PATCH 09/36] no message
---
.../analysis/metric/define/MetricSource.java | 36 -----------
.../ui/graphql/utils/DurationUtils.java | 54 ----------------
.../graphql/utils/DurationUtilsTestCase.java | 33 ----------
.../collector/ui/service/TraceDagService.java | 64 -------------------
4 files changed, 187 deletions(-)
delete mode 100644 apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/MetricSource.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtils.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtilsTestCase.java
delete mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceDagService.java
diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/MetricSource.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/MetricSource.java
deleted file mode 100644
index 7757e13ec..000000000
--- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/MetricSource.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.analysis.metric.define;
-
-/**
- * @author peng-yongsheng
- */
-public enum MetricSource {
- Caller(0), Callee(1);
-
- private final int value;
-
- private MetricSource(int value) {
- this.value = value;
- }
-
- public int getValue() {
- return value;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtils.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtils.java
deleted file mode 100644
index e5f3838f3..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtils.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.utils;
-
-import java.text.ParseException;
-
-/**
- * @author peng-yongsheng
- */
-public enum DurationUtils {
- INSTANCE;
-
- public long exchangeToTimeBucket(String dateStr) throws ParseException {
- dateStr = dateStr.replaceAll("-", "");
- dateStr = dateStr.replaceAll(" ", "");
- return Long.valueOf(dateStr);
- }
-
- public long monthDurationToSecondTimeBucket(String dateStr) throws ParseException {
- long month = exchangeToTimeBucket(dateStr);
- return month * 100 * 100 * 100 * 100;
- }
-
- public long dayDurationToSecondTimeBucket(String dateStr) throws ParseException {
- long month = exchangeToTimeBucket(dateStr);
- return month * 100 * 100 * 100;
- }
-
- public long hourDurationToSecondTimeBucket(String dateStr) throws ParseException {
- long month = exchangeToTimeBucket(dateStr);
- return month * 100 * 100;
- }
-
- public long minuteDurationToSecondTimeBucket(String dateStr) throws ParseException {
- long month = exchangeToTimeBucket(dateStr);
- return month * 100;
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtilsTestCase.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtilsTestCase.java
deleted file mode 100644
index 89d1ee3ba..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/test/java/org/apache/skywalking/apm/collector/ui/graphql/utils/DurationUtilsTestCase.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.apm.collector.ui.graphql.utils;
-
-import java.text.ParseException;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * @author peng-yongsheng
- */
-public class DurationUtilsTestCase {
-
- @Test
- public void test() throws ParseException {
- }
-}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceDagService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceDagService.java
deleted file mode 100644
index 501ca0e4e..000000000
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceDagService.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-package org.apache.skywalking.apm.collector.ui.service;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import org.apache.skywalking.apm.collector.core.module.ModuleManager;
-import org.apache.skywalking.apm.collector.storage.StorageModule;
-import org.apache.skywalking.apm.collector.storage.dao.IApplicationComponentUIDAO;
-import org.apache.skywalking.apm.collector.storage.dao.IApplicationMappingUIDAO;
-import org.apache.skywalking.apm.collector.storage.dao.IApplicationReferenceMetricUIDAO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author peng-yongsheng
- */
-public class TraceDagService {
-
- private final Logger logger = LoggerFactory.getLogger(TraceDagService.class);
-
- private final IApplicationComponentUIDAO applicationComponentUIDAO;
- private final IApplicationMappingUIDAO applicationMappingUIDAO;
- private final IApplicationReferenceMetricUIDAO applicationReferenceMetricUIDAO;
- private final ModuleManager moduleManager;
-
- public TraceDagService(ModuleManager moduleManager) {
- this.moduleManager = moduleManager;
- this.applicationComponentUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationComponentUIDAO.class);
- this.applicationMappingUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationMappingUIDAO.class);
- this.applicationReferenceMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationReferenceMetricUIDAO.class);
- }
-
- public JsonObject load(long startTime, long endTime) {
- logger.debug("startTime: {}, endTime: {}", startTime, endTime);
- JsonArray applicationComponentArray = applicationComponentUIDAO.load(startTime, endTime);
-
- JsonArray applicationMappingArray = applicationMappingUIDAO.load(startTime, endTime);
-
- JsonArray applicationReferenceMetricArray = applicationReferenceMetricUIDAO.load(startTime, endTime);
-
- TraceDagDataBuilder builder = new TraceDagDataBuilder(moduleManager);
- JsonObject traceDag = builder.build(applicationComponentArray, applicationMappingArray, applicationReferenceMetricArray);
-
- return traceDag;
- }
-}
From 34380713747db25d3dcd820d6dfe44166b8b2c37 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Fri, 26 Jan 2018 00:49:37 +0800
Subject: [PATCH 10/36] Catch the exception in doPost and doGet method, make
this two method do not throw exception.
---
.../collector/server/jetty/JettyHandler.java | 24 ++++++++++++++-----
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java
index 0c557b026..15520fc42 100644
--- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java
+++ b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java
@@ -32,31 +32,43 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
import org.apache.skywalking.apm.collector.server.ServerHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author peng-yongsheng
*/
public abstract class JettyHandler extends HttpServlet implements ServerHandler {
+ private final Logger logger = LoggerFactory.getLogger(JettyHandler.class);
+
public abstract String pathSpec();
@Override
- protected final void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ protected final void doGet(HttpServletRequest req, HttpServletResponse resp) {
try {
reply(resp, doGet(req));
- } catch (ArgumentsParseException e) {
- replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
+ } catch (ArgumentsParseException | IOException e) {
+ try {
+ replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
+ } catch (IOException replyException) {
+ logger.error(replyException.getMessage(), e);
+ }
}
}
protected abstract JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException;
@Override
- protected final void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ protected final void doPost(HttpServletRequest req, HttpServletResponse resp) {
try {
reply(resp, doPost(req));
- } catch (ArgumentsParseException e) {
- replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
+ } catch (ArgumentsParseException | IOException e) {
+ try {
+ replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
+ } catch (IOException replyException) {
+ logger.error(replyException.getMessage(), e);
+ }
}
}
From 1510f7059d686f5943dd75126f0d9aad2bc0cc15 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Fri, 26 Jan 2018 08:55:55 +0800
Subject: [PATCH 11/36] Change the data type from int to long which attributes
named responseTimePerSec and callsPerSec.
---
.../src/main/resources/ui-graphql/application-layer.graphqls | 2 +-
.../src/main/resources/ui-graphql/common.graphqls | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls
index ba6dde139..bb99a4910 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls
@@ -10,7 +10,7 @@ type ApplicationNode implements Node {
# The number of incoming calls
callsPerSec: Long!
# Unit: millisecond
- responseTimePerSec: Int!
+ responseTimePerSec: Long!
# ref: http://www.apdex.org/
# Max value is 1
# 2 Digits after floating point.
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls
index 04f21eeb3..21d9becd1 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/common.graphqls
@@ -104,7 +104,7 @@ type Call {
isAlert: Boolean
# The protocol and tech stack used in this distributed call
callType: String!
- callsPerSec: Int!
+ callsPerSec: Long!
# Unit: millisecond
- responseTimePerSec: Int!
+ responseTimePerSec: Long!
}
From f177ebd909d1dbe5efd84adb10d0dbf6da83b4d7 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Sat, 27 Jan 2018 09:13:48 +0800
Subject: [PATCH 12/36] Provide the search server query, but only completed es
storage and non tps.
---
.../json/instance-register-consumer.json | 9 ++-
.../json/instance-register-provider.json | 9 ++-
.../collector/storage/dao/IInstanceUIDAO.java | 3 +-
.../ui/application/ApplicationNode.java | 6 +-
.../apm/collector/storage/ui/common/Call.java | 18 ++---
.../storage/ui/server/AppServerInfo.java | 63 ++++++++++++++-
.../storage/es/dao/InstanceEsUIDAO.java | 28 ++++---
.../storage/h2/dao/InstanceH2UIDAO.java | 27 +++----
.../ui/jetty/handler/GraphQLHandler.java | 5 +-
.../apm/collector/ui/query/ServerQuery.java | 28 ++++++-
.../service/ApplicationTopologyService.java | 6 +-
.../collector/ui/service/ServerService.java | 80 +++++++++++++++++++
.../collector/ui/service/TopologyBuilder.java | 6 +-
.../ui-graphql/server-layer.graphqls | 4 +-
14 files changed, 231 insertions(+), 61 deletions(-)
create mode 100644 apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-consumer.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-consumer.json
index 139dc5743..e2cb6e068 100644
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-consumer.json
+++ b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-consumer.json
@@ -3,7 +3,12 @@
"au": "dubbox-consumer",
"rt": 1501858094526,
"oi": {
- "any_name": "any_value",
- "any_name1": "any_value1"
+ "osName": "MacOS XX",
+ "hostName": "pengys",
+ "processId": "1001",
+ "ipv4s": [
+ "10.0.0.3",
+ "10.0.0.4"
+ ]
}
}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-provider.json
index 976928f9c..304de7c4f 100644
--- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-provider.json
+++ b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-provider.json
@@ -3,7 +3,12 @@
"au": "dubbox-provider",
"rt": 1501858094526,
"oi": {
- "any_name": "any_value",
- "any_name1": "any_value1"
+ "osName": "MacOS X",
+ "hostName": "peng-yongsheng",
+ "processId": "1000",
+ "ipv4s": [
+ "10.0.0.1",
+ "10.0.0.2"
+ ]
}
}
\ No newline at end of file
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
index 6a2413f1f..9db7121f3 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
import org.apache.skywalking.apm.collector.storage.table.register.Instance;
import org.apache.skywalking.apm.collector.storage.ui.application.Application;
+import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
/**
* @author peng-yongsheng
@@ -35,5 +36,5 @@ public interface IInstanceUIDAO extends DAO {
Instance getInstance(int instanceId);
- List getInstances(int applicationId, long timeBucket);
+ List getInstances(String keyword, long start, long end);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java
index 88ca7f14f..66f3a8d82 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java
@@ -27,7 +27,7 @@ public class ApplicationNode extends Node {
private Float sla;
private Long callsPerSec;
- private Integer responseTimePerSec;
+ private Long responseTimePerSec;
private Float apdex;
private Boolean isAlarm;
private Integer numOfServer;
@@ -50,11 +50,11 @@ public class ApplicationNode extends Node {
this.callsPerSec = callsPerSec;
}
- public Integer getResponseTimePerSec() {
+ public Long getResponseTimePerSec() {
return responseTimePerSec;
}
- public void setResponseTimePerSec(Integer responseTimePerSec) {
+ public void setResponseTimePerSec(Long responseTimePerSec) {
this.responseTimePerSec = responseTimePerSec;
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java
index 74151ce0d..70956ef73 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java
@@ -28,10 +28,10 @@ public class Call {
private String targetName;
private boolean isAlert;
private String callType;
- private int calls;
- private int callsPerSec;
+ private long calls;
+ private long callsPerSec;
private long responseTimes;
- private int responseTimePerSec;
+ private long responseTimePerSec;
public int getSource() {
return source;
@@ -81,19 +81,19 @@ public class Call {
this.callType = callType;
}
- public int getCalls() {
+ public long getCalls() {
return calls;
}
- public void setCalls(int calls) {
+ public void setCalls(long calls) {
this.calls = calls;
}
- public int getCallsPerSec() {
+ public long getCallsPerSec() {
return callsPerSec;
}
- public void setCallsPerSec(int callsPerSec) {
+ public void setCallsPerSec(long callsPerSec) {
this.callsPerSec = callsPerSec;
}
@@ -105,11 +105,11 @@ public class Call {
this.responseTimes = responseTimes;
}
- public int getResponseTimePerSec() {
+ public long getResponseTimePerSec() {
return responseTimePerSec;
}
- public void setResponseTimePerSec(int responseTimePerSec) {
+ public void setResponseTimePerSec(long responseTimePerSec) {
this.responseTimePerSec = responseTimePerSec;
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java
index 4d4c7cc93..9989ecbbc 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java
@@ -18,16 +18,73 @@
package org.apache.skywalking.apm.collector.storage.ui.server;
+import java.util.List;
+
/**
* @author peng-yongsheng
*/
public class AppServerInfo {
private int id;
+ private String osInfo;
private String name;
private int tps;
- private String os;
private String host;
private int pid;
- private String ipv4;
- private String ipv6;
+ private List ipv4;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getOsInfo() {
+ return osInfo;
+ }
+
+ public void setOsInfo(String osInfo) {
+ this.osInfo = osInfo;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getTps() {
+ return tps;
+ }
+
+ public void setTps(int tps) {
+ this.tps = tps;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ public int getPid() {
+ return pid;
+ }
+
+ public void setPid(int pid) {
+ this.pid = pid;
+ }
+
+ public List getIpv4() {
+ return ipv4;
+ }
+
+ public void setIpv4(List ipv4) {
+ this.ipv4 = ipv4;
+ }
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
index b8b3dd1bc..50d88250c 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
@@ -21,12 +21,15 @@ package org.apache.skywalking.apm.collector.storage.es.dao;
import java.util.LinkedList;
import java.util.List;
import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient;
+import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
+import org.apache.skywalking.apm.collector.core.util.StringUtils;
import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO;
import org.apache.skywalking.apm.collector.storage.table.register.Instance;
import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable;
import org.apache.skywalking.apm.collector.storage.ui.application.Application;
+import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
import org.elasticsearch.action.get.GetRequestBuilder;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.search.SearchRequestBuilder;
@@ -146,30 +149,31 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO {
return null;
}
- @Override public List getInstances(int applicationId, long timeBucket) {
- logger.debug("get instances info, application id: {}, timeBucket: {}", applicationId, timeBucket);
+ @Override public List getInstances(String keyword, long start, long end) {
+ logger.debug("get instances info, keyword: {}, start: {}, end: {}", keyword, start, end);
SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceTable.TABLE);
searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE);
searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
searchRequestBuilder.setSize(1000);
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
- boolQuery.must().add(QueryBuilders.rangeQuery(InstanceTable.COLUMN_HEARTBEAT_TIME).gte(timeBucket));
- boolQuery.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_APPLICATION_ID, applicationId));
+ boolQuery.must().add(QueryBuilders.rangeQuery(InstanceTable.COLUMN_HEARTBEAT_TIME).gte(start).lte(end));
+ if (StringUtils.isNotEmpty(keyword)) {
+ boolQuery.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_OS_INFO, keyword));
+ }
+ boolQuery.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_IS_ADDRESS, BooleanUtils.FALSE));
searchRequestBuilder.setQuery(boolQuery);
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
SearchHit[] searchHits = searchResponse.getHits().getHits();
- List instanceList = new LinkedList<>();
+ List appServerInfos = new LinkedList<>();
for (SearchHit searchHit : searchHits) {
- Instance instance = new Instance();
- instance.setId(searchHit.getId());
- instance.setApplicationId(((Number)searchHit.getSource().get(InstanceTable.COLUMN_APPLICATION_ID)).intValue());
- instance.setHeartBeatTime(((Number)searchHit.getSource().get(InstanceTable.COLUMN_HEARTBEAT_TIME)).longValue());
- instance.setInstanceId(((Number)searchHit.getSource().get(InstanceTable.COLUMN_INSTANCE_ID)).intValue());
- instanceList.add(instance);
+ AppServerInfo appServerInfo = new AppServerInfo();
+ appServerInfo.setId(((Number)searchHit.getSource().get(InstanceTable.COLUMN_INSTANCE_ID)).intValue());
+ appServerInfo.setOsInfo((String)searchHit.getSource().get(InstanceTable.COLUMN_OS_INFO));
+ appServerInfos.add(appServerInfo);
}
- return instanceList;
+ return appServerInfos;
}
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
index 488a08332..62a9762e7 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
@@ -24,6 +24,7 @@ import java.util.LinkedList;
import java.util.List;
import org.apache.skywalking.apm.collector.client.h2.H2Client;
import org.apache.skywalking.apm.collector.client.h2.H2ClientException;
+import org.apache.skywalking.apm.collector.core.util.BooleanUtils;
import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
@@ -31,6 +32,7 @@ import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO;
import org.apache.skywalking.apm.collector.storage.table.register.Instance;
import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable;
import org.apache.skywalking.apm.collector.storage.ui.application.Application;
+import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,7 +50,7 @@ public class InstanceH2UIDAO extends H2DAO implements IInstanceUIDAO {
private static final String GET_LAST_HEARTBEAT_TIME_SQL = "select {0} from {1} where {2} > ? limit 1";
private static final String GET_INST_LAST_HEARTBEAT_TIME_SQL = "select {0} from {1} where {2} > ? and {3} = ? limit 1";
private static final String GET_INSTANCE_SQL = "select * from {0} where {1} = ?";
- private static final String GET_INSTANCES_SQL = "select * from {0} where {1} = ? and {2} >= ?";
+ private static final String GET_INSTANCES_SQL = "select * from {0} where {1} like ? and {2} >= ? and {2} <= ? and {3} = ?";
private static final String GET_APPLICATIONS_SQL = "select {3}, count({0}) as cnt from {1} where {2} >= ? group by {3} limit 100";
@Override
@@ -130,25 +132,22 @@ public class InstanceH2UIDAO extends H2DAO implements IInstanceUIDAO {
return null;
}
- @Override
- public List getInstances(int applicationId, long timeBucket) {
- logger.debug("get instances info, application id: {}, timeBucket: {}", applicationId, timeBucket);
- List instanceList = new LinkedList<>();
+ @Override public List getInstances(String keyword, long start, long end) {
+ logger.debug("get instances info, keyword: {}, start: {}, end: {}", keyword, start, end);
+ List appServerInfos = new LinkedList<>();
H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_INSTANCES_SQL, InstanceTable.TABLE, InstanceTable.COLUMN_APPLICATION_ID, InstanceTable.COLUMN_HEARTBEAT_TIME);
- Object[] params = new Object[] {applicationId, timeBucket};
+ String sql = SqlBuilder.buildSql(GET_INSTANCES_SQL, InstanceTable.TABLE, InstanceTable.COLUMN_OS_INFO, InstanceTable.COLUMN_HEARTBEAT_TIME, InstanceTable.COLUMN_IS_ADDRESS);
+ Object[] params = new Object[] {keyword, start, end, BooleanUtils.FALSE};
try (ResultSet rs = client.executeQuery(sql, params)) {
while (rs.next()) {
- Instance instance = new Instance();
- instance.setId(rs.getString(InstanceTable.COLUMN_ID));
- instance.setApplicationId(rs.getInt(InstanceTable.COLUMN_APPLICATION_ID));
- instance.setHeartBeatTime(rs.getLong(InstanceTable.COLUMN_HEARTBEAT_TIME));
- instance.setInstanceId(rs.getInt(InstanceTable.COLUMN_INSTANCE_ID));
- instanceList.add(instance);
+ AppServerInfo appServerInfo = new AppServerInfo();
+ appServerInfo.setId(rs.getInt(InstanceTable.COLUMN_INSTANCE_ID));
+ appServerInfo.setOsInfo(rs.getString(InstanceTable.COLUMN_OS_INFO));
+ appServerInfos.add(appServerInfo);
}
} catch (SQLException | H2ClientException e) {
logger.error(e.getMessage(), e);
}
- return instanceList;
+ return appServerInfos;
}
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
index 3deeb3b1a..82f7cdf44 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java
@@ -60,7 +60,6 @@ public class GraphQLHandler extends JettyHandler {
private final Logger logger = LoggerFactory.getLogger(GraphQLHandler.class);
- private final ModuleManager moduleManager;
private final Gson gson = new Gson();
private final GraphQL graphQL;
private static final String QUERY = "query";
@@ -69,8 +68,6 @@ public class GraphQLHandler extends JettyHandler {
private static final String MESSAGE = "message";
public GraphQLHandler(ModuleManager moduleManager) {
- this.moduleManager = moduleManager;
-
GraphQLSchema schema = SchemaParser.newParser()
.file("ui-graphql/alarm.graphqls")
.file("ui-graphql/application-layer.graphqls")
@@ -81,7 +78,7 @@ public class GraphQLHandler extends JettyHandler {
.file("ui-graphql/service-layer.graphqls")
.file("ui-graphql/trace.graphqls")
.resolvers(new VersionQuery(), new VersionMutation(), new AlarmQuery(), new ApplicationQuery(moduleManager))
- .resolvers(new OverViewLayerQuery(moduleManager), new ServerQuery(), new ServiceQuery(), new TraceQuery())
+ .resolvers(new OverViewLayerQuery(moduleManager), new ServerQuery(moduleManager), new ServiceQuery(), new TraceQuery())
.resolvers(new ConfigQuery(), new ConfigMutation())
.dictionary(ConjecturalNode.class, VisualUserNode.class, ApplicationNode.class)
.build()
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java
index 7871337dc..be03305f7 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java
@@ -18,8 +18,10 @@
package org.apache.skywalking.apm.collector.ui.query;
+import java.text.ParseException;
import java.util.List;
-import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.core.module.ModuleManager;
+import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
import org.apache.skywalking.apm.collector.storage.ui.common.Duration;
import org.apache.skywalking.apm.collector.storage.ui.common.ResponseTimeTrend;
import org.apache.skywalking.apm.collector.storage.ui.common.ThroughputTrend;
@@ -27,13 +29,33 @@ import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
import org.apache.skywalking.apm.collector.storage.ui.server.CPUTrend;
import org.apache.skywalking.apm.collector.storage.ui.server.GCTrend;
import org.apache.skywalking.apm.collector.storage.ui.server.MemoryTrend;
+import org.apache.skywalking.apm.collector.ui.graphql.Query;
+import org.apache.skywalking.apm.collector.ui.service.ServerService;
+import org.apache.skywalking.apm.collector.ui.utils.DurationUtils;
/**
* @author peng-yongsheng
*/
public class ServerQuery implements Query {
- public List searchServer(String keyword, Duration duration) {
- return null;
+
+ private final ModuleManager moduleManager;
+ private ServerService serverService;
+
+ public ServerQuery(ModuleManager moduleManager) {
+ this.moduleManager = moduleManager;
+ }
+
+ private ServerService getServerService() {
+ if (ObjectUtils.isEmpty(serverService)) {
+ this.serverService = new ServerService(moduleManager);
+ }
+ return serverService;
+ }
+
+ public List searchServer(String keyword, Duration duration) throws ParseException {
+ long start = DurationUtils.INSTANCE.durationToSecondTimeBucket(duration.getStep(), duration.getStart());
+ long end = DurationUtils.INSTANCE.durationToSecondTimeBucket(duration.getStep(), duration.getEnd());
+ return getServerService().searchServer(keyword, start, end);
}
public List getAllServer(String applicationId, Duration duration) {
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java
index e53c52b43..821a435a4 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java
@@ -119,10 +119,10 @@ public class ApplicationTopologyService {
Topology topology = builder.build(applicationComponents, applicationMappings, callerCalls, calleeCalls, secondsBetween);
topology.getCalls().forEach(call -> {
- int calls = call.getCalls();
+ long calls = call.getCalls();
long responseTimes = call.getResponseTimes();
- call.setCallsPerSec((int)(calls / secondsBetween));
- call.setResponseTimePerSec((int)(responseTimes / secondsBetween));
+ call.setCallsPerSec(calls / secondsBetween);
+ call.setResponseTimePerSec(responseTimes / secondsBetween);
});
return topology;
}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
new file mode 100644
index 000000000..85b5af80d
--- /dev/null
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.ui.service;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import java.util.LinkedList;
+import java.util.List;
+import org.apache.skywalking.apm.collector.core.module.ModuleManager;
+import org.apache.skywalking.apm.collector.core.util.Const;
+import org.apache.skywalking.apm.collector.core.util.StringUtils;
+import org.apache.skywalking.apm.collector.storage.StorageModule;
+import org.apache.skywalking.apm.collector.storage.dao.IInstanceUIDAO;
+import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ServerService {
+
+ private final Gson gson = new Gson();
+ private final IInstanceUIDAO instanceDAO;
+
+ public ServerService(ModuleManager moduleManager) {
+ this.instanceDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceUIDAO.class);
+ }
+
+ public List searchServer(String keyword, long start, long end) {
+ List serverInfos = instanceDAO.getInstances(keyword, start, end);
+ serverInfos.forEach(serverInfo -> {
+ if (serverInfo.getId() == Const.NONE_INSTANCE_ID) {
+ serverInfos.remove(serverInfo);
+ }
+ });
+
+ serverInfos.forEach(serverInfo -> {
+ if (StringUtils.isNotEmpty(serverInfo.getOsInfo())) {
+ JsonObject osInfoJson = gson.fromJson(serverInfo.getOsInfo(), JsonObject.class);
+ if (osInfoJson.has("osName")) {
+ serverInfo.setName(osInfoJson.get("osName").getAsString());
+ }
+ if (osInfoJson.has("hostName")) {
+ serverInfo.setHost(osInfoJson.get("hostName").getAsString());
+ }
+ if (osInfoJson.has("processId")) {
+ serverInfo.setPid(osInfoJson.get("processId").getAsInt());
+ }
+
+ if (osInfoJson.has("ipv4s")) {
+ JsonArray ipv4Array = osInfoJson.get("ipv4s").getAsJsonArray();
+
+ List ipv4s = new LinkedList<>();
+ ipv4Array.forEach(ipv4 -> {
+ ipv4s.add(ipv4.getAsString());
+ });
+ serverInfo.setIpv4(ipv4s);
+ }
+ }
+ });
+
+ return serverInfos;
+ }
+}
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
index 97ea1265a..fabdf601e 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
@@ -95,10 +95,12 @@ class TopologyBuilder {
calleeCalls.forEach(call -> {
if (call.getTarget() == nodeId) {
- call.setCallsPerSec((int)(call.getCalls() / secondsBetween));
- call.setResponseTimePerSec((int)(call.getResponseTimes() / secondsBetween));
+ call.setCallsPerSec(call.getCalls() / secondsBetween);
+ call.setResponseTimePerSec(call.getResponseTimes() / secondsBetween);
}
});
+ applicationNode.setCallsPerSec(100L);
+ applicationNode.setResponseTimePerSec(100L);
nodes.add(applicationNode);
}
}
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls
index ddd41c680..fdf1d1bcd 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls
@@ -7,11 +7,9 @@ type AppServerInfo {
id: ID!
name: String!
tps: Int!
- os: String
host: String
pid: Int
- ipv4: String
- ipv6: String
+ ipv4: [String!]!
}
type CPUTrend {
From 0ee4b1c30d2309b54444c336060d2d355d1d2bd1 Mon Sep 17 00:00:00 2001
From: peng-yongsheng <8082209@qq.com>
Date: Sat, 27 Jan 2018 09:37:30 +0800
Subject: [PATCH 13/36] Provide the getAllServer query, but only completed es
storage and non tps.
---
.../collector/storage/dao/IInstanceUIDAO.java | 4 ++-
.../storage/es/dao/InstanceEsUIDAO.java | 25 ++++++++++++++++++-
.../storage/h2/dao/InstanceH2UIDAO.java | 23 +++++++++++++----
.../apm/collector/ui/query/ServerQuery.java | 6 +++--
.../collector/ui/service/ServerService.java | 15 ++++++++---
5 files changed, 61 insertions(+), 12 deletions(-)
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
index 9db7121f3..51177357f 100644
--- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceUIDAO.java
@@ -36,5 +36,7 @@ public interface IInstanceUIDAO extends DAO {
Instance getInstance(int instanceId);
- List getInstances(String keyword, long start, long end);
+ List searchServer(String keyword, long start, long end);
+
+ List getAllServer(int applicationId, long start, long end);
}
diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
index 50d88250c..93291e09a 100644
--- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceEsUIDAO.java
@@ -149,7 +149,7 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO {
return null;
}
- @Override public List getInstances(String keyword, long start, long end) {
+ @Override public List searchServer(String keyword, long start, long end) {
logger.debug("get instances info, keyword: {}, start: {}, end: {}", keyword, start, end);
SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceTable.TABLE);
searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE);
@@ -167,6 +167,29 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO {
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
SearchHit[] searchHits = searchResponse.getHits().getHits();
+ return buildAppServerInfo(searchHits);
+ }
+
+ @Override public List getAllServer(int applicationId, long start, long end) {
+ logger.debug("get instances info, applicationId: {}, start: {}, end: {}", applicationId, start, end);
+ SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceTable.TABLE);
+ searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE);
+ searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH);
+ searchRequestBuilder.setSize(1000);
+
+ BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
+ boolQuery.must().add(QueryBuilders.rangeQuery(InstanceTable.COLUMN_HEARTBEAT_TIME).gte(start).lte(end));
+ boolQuery.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_APPLICATION_ID, applicationId));
+ boolQuery.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_IS_ADDRESS, BooleanUtils.FALSE));
+ searchRequestBuilder.setQuery(boolQuery);
+
+ SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
+ SearchHit[] searchHits = searchResponse.getHits().getHits();
+
+ return buildAppServerInfo(searchHits);
+ }
+
+ private List buildAppServerInfo(SearchHit[] searchHits) {
List appServerInfos = new LinkedList<>();
for (SearchHit searchHit : searchHits) {
AppServerInfo appServerInfo = new AppServerInfo();
diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
index 62a9762e7..aeecc3989 100644
--- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
+++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceH2UIDAO.java
@@ -50,7 +50,6 @@ public class InstanceH2UIDAO extends H2DAO implements IInstanceUIDAO {
private static final String GET_LAST_HEARTBEAT_TIME_SQL = "select {0} from {1} where {2} > ? limit 1";
private static final String GET_INST_LAST_HEARTBEAT_TIME_SQL = "select {0} from {1} where {2} > ? and {3} = ? limit 1";
private static final String GET_INSTANCE_SQL = "select * from {0} where {1} = ?";
- private static final String GET_INSTANCES_SQL = "select * from {0} where {1} like ? and {2} >= ? and {2} <= ? and {3} = ?";
private static final String GET_APPLICATIONS_SQL = "select {3}, count({0}) as cnt from {1} where {2} >= ? group by {3} limit 100";
@Override
@@ -132,12 +131,26 @@ public class InstanceH2UIDAO extends H2DAO implements IInstanceUIDAO {
return null;
}
- @Override public List getInstances(String keyword, long start, long end) {
+ @Override public List searchServer(String keyword, long start, long end) {
logger.debug("get instances info, keyword: {}, start: {}, end: {}", keyword, start, end);
- List appServerInfos = new LinkedList<>();
- H2Client client = getClient();
- String sql = SqlBuilder.buildSql(GET_INSTANCES_SQL, InstanceTable.TABLE, InstanceTable.COLUMN_OS_INFO, InstanceTable.COLUMN_HEARTBEAT_TIME, InstanceTable.COLUMN_IS_ADDRESS);
+ String dynamicSql = "select * from {0} where {1} like ? and {2} >= ? and {2} <= ? and {3} = ?";
+ String sql = SqlBuilder.buildSql(dynamicSql, InstanceTable.TABLE, InstanceTable.COLUMN_OS_INFO, InstanceTable.COLUMN_HEARTBEAT_TIME, InstanceTable.COLUMN_IS_ADDRESS);
Object[] params = new Object[] {keyword, start, end, BooleanUtils.FALSE};
+ return buildAppServerInfo(sql, params);
+ }
+
+ @Override public List getAllServer(int applicationId, long start, long end) {
+ logger.debug("get instances info, applicationId: {}, start: {}, end: {}", applicationId, start, end);
+ String dynamicSql = "select * from {0} where {1} = ? and {2} >= ? and {2} <= ? and {3} = ?";
+ String sql = SqlBuilder.buildSql(dynamicSql, InstanceTable.TABLE, InstanceTable.COLUMN_APPLICATION_ID, InstanceTable.COLUMN_HEARTBEAT_TIME, InstanceTable.COLUMN_IS_ADDRESS);
+ Object[] params = new Object[] {applicationId, start, end, BooleanUtils.FALSE};
+ return buildAppServerInfo(sql, params);
+ }
+
+ private List buildAppServerInfo(String sql, Object[] params) {
+ H2Client client = getClient();
+
+ List appServerInfos = new LinkedList<>();
try (ResultSet rs = client.executeQuery(sql, params)) {
while (rs.next()) {
AppServerInfo appServerInfo = new AppServerInfo();
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java
index be03305f7..9a6f32135 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java
@@ -58,8 +58,10 @@ public class ServerQuery implements Query {
return getServerService().searchServer(keyword, start, end);
}
- public List getAllServer(String applicationId, Duration duration) {
- return null;
+ public List getAllServer(int applicationId, Duration duration) throws ParseException {
+ long start = DurationUtils.INSTANCE.durationToSecondTimeBucket(duration.getStep(), duration.getStart());
+ long end = DurationUtils.INSTANCE.durationToSecondTimeBucket(duration.getStep(), duration.getEnd());
+ return getServerService().getAllServer(applicationId, start, end);
}
public ResponseTimeTrend getServerResponseTimeTrend(int serverId, Duration duration) {
diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
index 85b5af80d..6df24adf4 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
@@ -43,13 +43,24 @@ public class ServerService {
}
public List searchServer(String keyword, long start, long end) {
- List]