You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by pe...@apache.org on 2018/04/23 01:31:42 UTC
[incubator-skywalking] branch master updated: GraphQL for
Thermodynamic in overview page. (#1068)
This is an automated email from the ASF dual-hosted git repository.
pengys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 1e57d48 GraphQL for Thermodynamic in overview page. (#1068)
1e57d48 is described below
commit 1e57d48d940631c1d0658f44eaec90a268da1f23
Author: 吴晟 Wu Sheng <wu...@foxmail.com>
AuthorDate: Mon Apr 23 09:31:39 2018 +0800
GraphQL for Thermodynamic in overview page. (#1068)
* Provide graphQL for Thermodynamic in overview page.
* Finish the Thermodynamic.
* `nodes` should not be null.
* Add initialized java bean for graphql protocol.
* Add license head.
* Fixed bean definition fault.
---
.../apm/collector/storage/ui/common/ValueType.java | 28 ++++++++++++
.../storage/ui/overview/Thermodynamic.java | 51 ++++++++++++++++++++++
.../apm/collector/ui/query/OverViewLayerQuery.java | 17 ++++++--
.../src/main/resources/ui-graphql/common.graphqls | 6 +++
.../resources/ui-graphql/overview-layer.graphqls | 17 ++++++++
5 files changed, 115 insertions(+), 4 deletions(-)
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ValueType.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ValueType.java
new file mode 100644
index 0000000..a07ed67
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ValueType.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;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum ValueType {
+ ALL,
+ RIGHT,
+ WRONG
+}
diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/Thermodynamic.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/Thermodynamic.java
new file mode 100644
index 0000000..55ee86a
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/Thermodynamic.java
@@ -0,0 +1,51 @@
+/*
+ * 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.LinkedList;
+import java.util.List;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Thermodynamic {
+
+ private List<List<Long>> nodes;
+ private int responseTimeStep;
+
+ public Thermodynamic() {
+ this.nodes = new LinkedList<>();
+ }
+
+ public List<List<Long>> getNodes() {
+ return nodes;
+ }
+
+ public void setNodes(List<List<Long>> nodes) {
+ this.nodes = nodes;
+ }
+
+ public int getResponseTimeStep() {
+ return responseTimeStep;
+ }
+
+ public void setResponseTimeStep(int responseTimeStep) {
+ this.responseTimeStep = responseTimeStep;
+ }
+}
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
index e87e654..72e09a1 100644
--- 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
@@ -18,21 +18,26 @@
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.storage.ui.common.Duration;
import org.apache.skywalking.apm.collector.storage.ui.common.Topology;
+import org.apache.skywalking.apm.collector.storage.ui.common.ValueType;
import org.apache.skywalking.apm.collector.storage.ui.overview.AlarmTrend;
import org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationTPS;
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.overview.Thermodynamic;
import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric;
import org.apache.skywalking.apm.collector.ui.graphql.Query;
-import org.apache.skywalking.apm.collector.ui.service.*;
+import org.apache.skywalking.apm.collector.ui.service.AlarmService;
+import org.apache.skywalking.apm.collector.ui.service.ApplicationService;
+import org.apache.skywalking.apm.collector.ui.service.ClusterTopologyService;
+import org.apache.skywalking.apm.collector.ui.service.NetworkAddressService;
+import org.apache.skywalking.apm.collector.ui.service.ServiceNameService;
import org.apache.skywalking.apm.collector.ui.utils.DurationUtils;
-import java.text.ParseException;
-import java.util.List;
-
import static java.util.Objects.isNull;
/**
@@ -143,4 +148,8 @@ public class OverViewLayerQuery implements Query {
return getApplicationService().getTopNApplicationThroughput(duration.getStep(), startTimeBucket, endTimeBucket, topN);
}
+
+ public Thermodynamic getThermodynamic(Duration duration, ValueType type) throws ParseException {
+ return new Thermodynamic();
+ }
}
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 d6b9d32..82eca5e 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
@@ -124,3 +124,9 @@ type Call {
# Unit: millisecond
avgResponseTime: Long!
}
+
+enum ValueType {
+ ALL,
+ RIGHT,
+ WRONG
+}
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls
index c467e5e..87261b9 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls
@@ -49,6 +49,22 @@ type ApplicationTPS {
callsPerSec: Int!
}
+type Thermodynamic {
+ # Each element in nodes represents a point in Thermodynamic Diagram
+ # And the element includes three values:
+ # 1) Time Bucket based on query duration
+ # 2) Response time index.
+ # Response time = [responseTimeStep * index, responseTimeStep * (index+1))
+ # The last element: [Response Time * index, MAX)
+ # 3) The number of calls in this response time duration.
+ #
+ # Example:
+ # [ [0, 0, 10], [0, 1, 43], ...]
+ # These ^^^ two represent the left bottom element, and another element above it.
+ nodes: [[Long]!]!
+ responseTimeStep: Int!
+}
+
extend type Query {
getClusterTopology(duration: Duration!): Topology
getClusterBrief(duration: Duration!): ClusterBrief
@@ -56,4 +72,5 @@ extend type Query {
getConjecturalApps(duration: Duration!): ConjecturalAppBrief
getTopNSlowService(duration: Duration!, topN: Int!): [ServiceMetric!]!
getTopNApplicationThroughput(duration: Duration!, topN: Int!): [ApplicationTPS!]!
+ getThermodynamic(duration: Duration!, type: ValueType!): Thermodynamic!
}
--
To stop receiving notification emails like this one, please contact
pengys@apache.org.