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:39:14 UTC

[incubator-skywalking] branch fix/graphql/node-nullable updated: 1. Add set/get `DataTTLConfigs` and set/get `AlarmThreshold` mutation service. 2. All empty arrays are represented by `[]`, not `null`. 3. Add Mutation type, represents for all modification operations. 4. Support **Pagination** in some query. 5. Seperate alarm into to title and content

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 06b9f5f  1. Add set/get `DataTTLConfigs` and set/get `AlarmThreshold` mutation service. 2. All empty arrays are represented by `[]`, not `null`. 3. Add Mutation type, represents for all modification operations. 4. Support **Pagination** in some query. 5. Seperate alarm into to title and content
06b9f5f is described below

commit 06b9f5f692a991f69619262e34bbb1e2a0494a73
Author: wu-sheng <wu...@foxmail.com>
AuthorDate: Wed Jan 10 16:38:22 2018 +0800

    1. Add set/get `DataTTLConfigs` and set/get `AlarmThreshold` mutation service.
    2. All empty arrays are represented by `[]`, not `null`.
    3. Add Mutation type, represents for all modification operations.
    4. Support **Pagination** in some query.
    5. Seperate alarm into to title and content
---
 .../src/main/resources/ui-graphql/alarm.graphqls    |  8 +++++++-
 .../resources/ui-graphql/application-layer.graphqls |  4 ++--
 .../src/main/resources/ui-graphql/common.graphqls   | 21 +++++++++++++++++----
 .../src/main/resources/ui-graphql/config.graphqls   | 12 ++++++++++++
 .../main/resources/ui-graphql/server-layer.graphqls | 14 +++++++-------
 .../src/main/resources/ui-graphql/trace.graphqls    | 12 ++++++------
 6 files changed, 51 insertions(+), 20 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 b63946d..8ecd0fb 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
@@ -2,6 +2,7 @@ type AlarmItem {
     content: String!
     startTime: String!
     alertType: AlarmType!
+    causeType: CauseType!
 }
 
 enum AlarmType {
@@ -10,6 +11,11 @@ enum AlarmType {
     SERVICE
 }
 
+enum CauseType {
+    LOW_SUCCESS_RATE,
+    SLOW_RESPONSE
+}
+
 extend type Query {
-    loadAlertList(keyword: String, alertType: AlarmType, duration:Duration!):[AlarmItem]
+    loadAlertList(keyword: String, alertType: AlarmType, duration:Duration!, paging: Pagination!):[AlarmItem!]!
 }
\ No newline at end of file
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 f8ccf0e..fa11d75 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!): [ServiceInfo!]
-  getServerThroughput(applicationId: ID!, duration: Duration!): [AppServerInfo!]
+  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 ef552f7..c074e52 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
@@ -1,5 +1,6 @@
 schema {
     query: Query
+    mutation: Mutation
 }
 
 #Root node
@@ -7,6 +8,10 @@ type Query {
     version: String
 }
 
+type Mutation {
+    version: String
+}
+
 # The Duration defines the start and end time for each query operation.
 # Fields: `start` and `end`
 #   represents the time span. And each of them matches the step.
@@ -39,6 +44,14 @@ enum Step {
     SECOND
 }
 
+type Pagination {
+    //pageNum starts in 1, the default is 1.
+    pageNum: Int
+    pageSize: Int!
+    //default false
+    needTotal: Boolean
+}
+
 ######################################
 # Common Metrics and Trends
 ######################################
@@ -47,17 +60,17 @@ type ResponseTimeTrend {
 }
 
 type ThroughputTrend {
-    trendList: [Int!]
+    trendList: [Int!]!
 }
 
 type SLATrend {
-    trendList: [Int!]
+    trendList: [Int!]!
 }
 
 # The overview topology of the whole application cluster or services,
 type Topology {
-    nodes: [Node!]
-    calls: [Call!]
+    nodes: [Node!]!
+    calls: [Call!]!
 }
 
 # The base Node of all node types in topology
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
new file mode 100644
index 0000000..e4df497
--- /dev/null
+++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls
@@ -0,0 +1,12 @@
+type TTLConfigs {
+    items: [TTLConfigItem]!
+}
+
+type TTLConfigItem {
+    unit: Step!
+    value: Int!
+}
+
+extend type Mutation {
+    setDataTTLConfigs(ttl: TTLConfigs!): TTLConfigs
+}
\ No newline at end of file
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 eac33a7..1d01ec2 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
@@ -15,21 +15,21 @@ type AppServerInfo {
 }
 
 type CPUTrend {
-    cost: [Int!]
+    cost: [Int!]!
 }
 
 # The gc trend represents the numbers of Garbage Collector execution
 type GCTrend {
-    youngGC: [Int!]
-    oldGC: [Int!]
+    youngGC: [Int!]!
+    oldGC: [Int!]!
 }
 
 # The memory used and max limit in heap and noheap space.
 type MemoryTrend {
-    heap: [Int!]
-    maxHeap: [Int!]
-    noheap: [Int!]
-    maxNoheap: [Int!]
+    heap: [Int!]!
+    maxHeap: [Int!]!
+    noheap: [Int!]!
+    maxNoheap: [Int!]!
 }
 
 extend type Query {
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 4e2e1a0..efdbe96 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
@@ -1,6 +1,7 @@
 # The list of traces
 type TraceBrief {
-  traces: [BasicTrace!]
+  traces: [BasicTrace!]!
+  total: Int!
 }
 
 # Trace basic info
@@ -23,8 +24,7 @@ input TraceQueryCondition {
   minTraceDuration: Int
   # The max time of trace
   maxTraceDuration: Int
-  topN: Boolean
-  needTotal: Int
+  paging: Pagination!
 }
 
 enum QueryOrder {
@@ -46,7 +46,7 @@ type Segment {
 }
 
 type Span {
-  refs: [Ref!]
+  refs: [Ref!]!
   spanId: Int!
   parentSpanId: Int!
   startTime: Long!
@@ -60,8 +60,8 @@ type Span {
   isError: Boolean
   # There are 5 layers: Unknown, Database, RPCFramework, Http, MQ and Cache
   layer: String
-  tags: [KeyValue!]
-  logs: [LogEntity!]
+  tags: [KeyValue!]!
+  logs: [LogEntity!]!
 }
 
 # Ref represents the link between the segment and its parents.

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