From e7a5fd692023fe3ac2875f3d8bacaaf60aef7a0c Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Wed, 10 Jan 2018 16:39:40 +0800 Subject: [PATCH] no message --- .../main/resources/ui-graphql/alarm.graphqls | 4 ++ .../ui-graphql/application-layer.graphqls | 2 +- .../main/resources/ui-graphql/common.graphqls | 6 +-- .../main/resources/ui-graphql/config.graphqls | 38 ++++++++++++++++--- .../ui-graphql/overview-layer.graphqls | 6 +-- .../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 8ecd0fb3c7..9cb54a7de6 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 fa11d753f6..d05aeee16d 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 c074e52541..e4d7e10ca8 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 e4df497e4f..aaa102e1c9 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 e7b0bc2d65..04b1033a61 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 efdbe9645d..b52ea0fe40 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 f017d68441..5c93a8e93d 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); } -- GitLab