You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by wu...@apache.org on 2018/01/10 08:40:21 UTC

[incubator-skywalking] branch fix/graphql/node-nullable updated: no message

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch fix/graphql/node-nullable
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git


The following commit(s) were added to refs/heads/fix/graphql/node-nullable by this push:
     new e7a5fd6  no message
e7a5fd6 is described below

commit e7a5fd692023fe3ac2875f3d8bacaaf60aef7a0c
Author: wu-sheng <wu...@foxmail.com>
AuthorDate: Wed Jan 10 16:39:40 2018 +0800

    no message
---
 .../src/main/resources/ui-graphql/alarm.graphqls   |  4 +++
 .../ui-graphql/application-layer.graphqls          |  2 +-
 .../src/main/resources/ui-graphql/common.graphqls  |  6 ++--
 .../src/main/resources/ui-graphql/config.graphqls  | 38 ++++++++++++++++++----
 .../resources/ui-graphql/overview-layer.graphqls   |  6 ++--
 .../src/main/resources/ui-graphql/trace.graphqls   |  2 +-
 .../apm/ui/protocol/GraphQLScriptTest.java         |  1 +
 7 files changed, 45 insertions(+), 14 deletions(-)

diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls
index 8ecd0fb..9cb54a7 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/alarm.graphqls
@@ -1,4 +1,8 @@
 type AlarmItem {
+    # Typical include: Application Code + cause type. This is a short description.
+    title: String!
+    # Include all related info to trigger this alarm.
+    # such as: threshold, trigger value, relation(greater or lower), last time
     content: String!
     startTime: String!
     alertType: AlarmType!
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 fa11d75..d05aeee 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
@@ -35,6 +35,6 @@ type ConjecturalNode implements Node {
 extend type Query {
   getAllApplication(duration: Duration!): [ApplicationNode]
   getApplicationTopology(applicationId: ID!, duration: Duration!): Topology
-  getSlowService(applicationId: ID!, duration: Duration, top: Int!!): [ServiceInfo!]
+  getSlowService(applicationId: ID!, duration: Duration, top: Int!): [ServiceInfo!]
   getServerThroughput(applicationId: ID!, duration: Duration!, top: Int!): [AppServerInfo!]
 }
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 c074e52..e4d7e10 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
@@ -44,11 +44,11 @@ enum Step {
     SECOND
 }
 
-type Pagination {
-    //pageNum starts in 1, the default is 1.
+input Pagination {
+    # pageNum starts in 1, the default is 1.
     pageNum: Int
     pageSize: Int!
-    //default false
+    # default false
     needTotal: Boolean
 }
 
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls
index e4df497..aaa102e 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls
@@ -1,12 +1,38 @@
-type TTLConfigs {
-    items: [TTLConfigItem]!
-}
-
-type TTLConfigItem {
+input TTLConfigItem {
     unit: Step!
     value: Int!
 }
 
+type ExistedTTLConfigs{
+    ttl: [TTL!]!
+}
+
+type TTL {
+     unit: Step!
+     value: Int!
+}
+
+input AlarmThreshold {
+    type: AlarmType!
+    threshold: Int!
+    causeType: CauseType!
+}
+
+type ExistedAlarmThresholds {
+    items: [ExistedAlarmThresholdItem!]!
+}
+
+type ExistedAlarmThresholdItem {
+    threshold: Int!
+    causeType: CauseType!
+}
+
 extend type Mutation {
-    setDataTTLConfigs(ttl: TTLConfigs!): TTLConfigs
+    setDataTTLConfigs(ttl: [TTLConfigItem!]!): Boolean!
+    setAlarmThreshold(thresholds: [AlarmThreshold!]!): Boolean!
+}
+
+extend type Query {
+    queryAllDataTTLConfigs: ExistedTTLConfigs!
+    queryAlarmThresholds(alarmType: AlarmType): ExistedAlarmThresholds!
 }
\ No newline at end of file
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 e7b0bc2..04b1033 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
@@ -15,7 +15,7 @@ type AlarmTrend {
 # Query all conjectural applications based on the given duration
 # All applications here are not installed agent.
 type ConjecturalAppBrief {
-    apps: [ConjecturalApp!]
+    apps: [ConjecturalApp!]!
 }
 
 # The basic info of the conjectural application,
@@ -32,6 +32,6 @@ extend type Query {
     getClusterBrief(duration: Duration!): ClusterBrief
     getAlarmTrend(duration: Duration!): AlarmTrend
     getConjecturalApps(duration: Duration!): ConjecturalAppBrief
-    getTopNSlowService(duration: Duration!, topN: Int!): [ServiceInfo!]
-    getTopNServerThroughput(duration: Duration!, topN: Int!): [AppServerInfo!]
+    getTopNSlowService(duration: Duration!, topN: Int!): [ServiceInfo!]!
+    getTopNServerThroughput(duration: Duration!, topN: Int!): [AppServerInfo!]!
 }
diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls
index efdbe96..b52ea0f 100644
--- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls
@@ -35,7 +35,7 @@ enum QueryOrder {
 # The trace represents a distributed trace, includes all segments and spans.
 type Trace {
   traceId: ID!
-  segments: [Segment!]
+  segments: [Segment!]!
 }
 
 type Segment {
diff --git a/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLScriptTest.java b/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLScriptTest.java
index f017d68..5c93a8e 100644
--- a/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLScriptTest.java
+++ b/apm-protocol/apm-ui-protocol/src/test/java/org/apache/skywalking/apm/ui/protocol/GraphQLScriptTest.java
@@ -43,6 +43,7 @@ public class GraphQLScriptTest {
         typeRegistry.merge(schemaParser.parse(loadSchema("server-layer.graphqls")));
         typeRegistry.merge(schemaParser.parse(loadSchema("service-layer.graphqls")));
         typeRegistry.merge(schemaParser.parse(loadSchema("alarm.graphqls")));
+        typeRegistry.merge(schemaParser.parse(loadSchema("config.graphqls")));
         RuntimeWiring wiring = buildRuntimeWiring();
         assertTrue(schemaGenerator.makeExecutableSchema(typeRegistry, wiring).getAllTypesAsList().size() > 0);
     }

-- 
To stop receiving notification emails like this one, please contact
['"commits@skywalking.apache.org" <co...@skywalking.apache.org>'].