From d730e174f625b49cac3873b7d87d1c318b4503c1 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Tue, 9 Jan 2018 12:11:56 +0800 Subject: [PATCH 01/24] Make the nodes of Topology nullable. And elements in it are not null. --- .../src/main/resources/ui-graphql/common.graphqls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 853f36258..ef552f7e8 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 @@ -56,8 +56,8 @@ type SLATrend { # 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 From 06b9f5f692a991f69619262e34bbb1e2a0494a73 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Wed, 10 Jan 2018 16:38:22 +0800 Subject: [PATCH 02/24] 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 --- .../main/resources/ui-graphql/alarm.graphqls | 8 ++++++- .../ui-graphql/application-layer.graphqls | 4 ++-- .../main/resources/ui-graphql/common.graphqls | 21 +++++++++++++++---- .../main/resources/ui-graphql/config.graphqls | 12 +++++++++++ .../ui-graphql/server-layer.graphqls | 14 ++++++------- .../main/resources/ui-graphql/trace.graphqls | 12 +++++------ 6 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/config.graphqls 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 b63946d8b..8ecd0fb3c 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 f8ccf0eb9..fa11d753f 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 ef552f7e8..c074e5254 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 000000000..e4df497e4 --- /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 eac33a7dc..1d01ec211 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 4e2e1a0ec..efdbe9645 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. From e7a5fd692023fe3ac2875f3d8bacaaf60aef7a0c Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Wed, 10 Jan 2018 16:39:40 +0800 Subject: [PATCH 03/24] 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 8ecd0fb3c..9cb54a7de 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 fa11d753f..d05aeee16 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 c074e5254..e4d7e10ca 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 e4df497e4..aaa102e1c 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 e7b0bc2d6..04b1033a6 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 efdbe9645..b52ea0fe4 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 f017d6844..5c93a8e93 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); } From b2706cf24cf770564e93d00603c850ef277f3e1a Mon Sep 17 00:00:00 2001 From: wusheng Date: Thu, 11 Jan 2018 16:13:19 +0800 Subject: [PATCH 04/24] Make the user node as an extend of Node, rather then an attribute of ApplicationNode. --- .../main/resources/ui-graphql/application-layer.graphqls | 7 +++---- .../src/main/resources/ui-graphql/common.graphqls | 6 ++++++ 2 files changed, 9 insertions(+), 4 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 d05aeee16..e7f72bfef 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 @@ -8,7 +8,9 @@ type ApplicationNode implements Node { # 2 Digits after floating point. sla: Float! # The number of incoming calls - calls: Long! + callsPerSec: Long! + # Unit: millisecond + responseTimePerSec: Int! # ref: http://www.apdex.org/ # Max value is 1 # 2 Digits after floating point. @@ -19,9 +21,6 @@ type ApplicationNode implements Node { numOfServerAlarm: Int! # The number of services alerting numOfServiceAlarm: Int! - # Incoming request node, means User or outside system access the cluster from this. - # Recommend the UI generate a User node for each incoming node - isIncomingNode: Boolean } # The conjectural node generated by exit span 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 e4d7e10ca..b8bff31a5 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 @@ -87,6 +87,12 @@ interface Node { type: String } +# Incoming request node, means User or outside system access the cluster from this. +type VisualUserNode implements Node { + id: ID! + name: String +} + # The Call represents a directed distributed call, # from the `source` to the `target`. type Call { From 50e09852db7c8b5f0f700621eddd4f178a7d21e4 Mon Sep 17 00:00:00 2001 From: wusheng Date: Thu, 11 Jan 2018 16:19:48 +0800 Subject: [PATCH 05/24] add constant values --- .../src/main/resources/ui-graphql/common.graphqls | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 b8bff31a5..f698908d5 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 @@ -90,7 +90,10 @@ interface Node { # Incoming request node, means User or outside system access the cluster from this. type VisualUserNode implements Node { id: ID! - name: String + # Constant, value = "User" + name: String! + # Constant, value = "USER" + type: String! } # The Call represents a directed distributed call, From eaef6f106c45d362bf63ca3fb2712da915085d4b Mon Sep 17 00:00:00 2001 From: wusheng Date: Thu, 11 Jan 2018 18:52:45 +0800 Subject: [PATCH 06/24] Fix a compile issue --- .../src/main/resources/ui-graphql/common.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f698908d5..04f21eeb3 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 @@ -93,7 +93,7 @@ type VisualUserNode implements Node { # Constant, value = "User" name: String! # Constant, value = "USER" - type: String! + type: String } # The Call represents a directed distributed call, From 225903a92a5590014a353206d9b2cb49c9a66c4d Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 09:48:49 +0800 Subject: [PATCH 07/24] Fix missing parts. --- .../src/main/resources/ui-graphql/alarm.graphqls | 7 ++++++- .../main/resources/ui-graphql/application-layer.graphqls | 6 +++--- .../src/main/resources/ui-graphql/service-layer.graphqls | 2 +- 3 files changed, 10 insertions(+), 5 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 9cb54a7de..b60d0a126 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,3 +1,8 @@ +type Alarm { + items: [AlarmItem!]! + count: Int! +} + type AlarmItem { # Typical include: Application Code + cause type. This is a short description. title: String! @@ -21,5 +26,5 @@ enum CauseType { } extend type Query { - loadAlertList(keyword: String, alertType: AlarmType, duration:Duration!, paging: Pagination!):[AlarmItem!]! + loadAlertList(keyword: String, alertType: AlarmType, duration:Duration!, paging: Pagination!): Alarm } \ 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 e7f72bfef..5620e96e0 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 @@ -32,8 +32,8 @@ type ConjecturalNode implements Node { extend type Query { - getAllApplication(duration: Duration!): [ApplicationNode] + getAllApplication(duration: Duration!): [ApplicationNode!]! getApplicationTopology(applicationId: ID!, duration: Duration!): Topology - getSlowService(applicationId: ID!, duration: Duration, top: Int!): [ServiceInfo!] - getServerThroughput(applicationId: ID!, duration: Duration!, top: Int!): [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/service-layer.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/service-layer.graphqls index 3e33c8f9e..a5b44557a 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/service-layer.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/service-layer.graphqls @@ -27,7 +27,7 @@ type TraceItem { } extend type Query { - searchService(keyword: String!, duration: Duration!): [ServiceNode] + searchService(keyword: String!, duration: Duration!, topN: Int!): [ServiceNode!]! getServiceResponseTimeTrend(serviceId: ID!, duration: Duration!): ResponseTimeTrend getServiceTPSTrend(serviceId: ID!, duration: Duration!): ThroughputTrend getServiceSLATrend(serviceId: ID!, duration: Duration!): SLATrend From 6ce5bfd5690a812dc797aa372412d6d437cf6866 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 10:24:21 +0800 Subject: [PATCH 08/24] Make ci works with resin and ojdbc again. Try to build. --- .travis.yml | 12 ++-- apm-sniffer/apm-sdk-plugin/pom.xml | 94 ++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 540b9e8f0..c227d0a64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,14 @@ sudo: required -services: - - docker - language: java +before_install: + - cd ci-dependencies + - curl -O https://openskywalking.github.io/skywalking-ci-assist/jar/ojdbc14-10.2.0.4.0.jar + - curl -O https://openskywalking.github.io/skywalking-ci-assist/jar/resin-3.0.9.jar + - curl -O https://openskywalking.github.io/skywalking-ci-assist/jar/resin-4.0.41.jar + - cd .. + install: - jdk_switcher use oraclejdk8 - mvn clean install --quiet jacoco:report coveralls:report -after_success: - - bash ./travis/push_image.sh diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/pom.xml index 0bba88f18..82262e948 100644 --- a/apm-sniffer/apm-sdk-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/pom.xml @@ -212,6 +212,38 @@ oracle-10.x-plugin + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + install-ojdbc + false + process-resources + + exec + + + mvn + + install:install-file + -Dfile=ojdbc14-10.2.0.4.0.jar + -DgroupId=com.oracle + -DartifactId=ojdbc14 + -Dversion=10.2.0.4.0 + -Dpackaging=jar + + ${project.basedir}/ci-dependencies + + + + + + @@ -224,6 +256,37 @@ resin-3.x-plugin + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + install-ojdbc + false + process-resources + + exec + + + mvn + + install:install-file + -Dfile=resin-3.0.9.jar + -DgroupId=com.caucho + -DartifactId=resin + -Dversion=4.0.41 + -Dpackaging=jar + + ${project.basedir}/ci-dependencies + + + + + + @@ -236,6 +299,37 @@ resin-4.x-plugin + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + install-ojdbc + false + process-resources + + exec + + + mvn + + install:install-file + -Dfile=resin-4.0.41.jar + -DgroupId=com.caucho + -DartifactId=resin + -Dversion=4.0.41 + -Dpackaging=jar + + ${project.basedir}/ci-dependencies + + + + + + From 973718d94ec5f3fac9496e303aef310ce0ffd370 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 10:31:24 +0800 Subject: [PATCH 09/24] Adjust dir path. --- apm-sniffer/apm-sdk-plugin/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/pom.xml index 82262e948..660fa1514 100644 --- a/apm-sniffer/apm-sdk-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/pom.xml @@ -237,7 +237,7 @@ -Dversion=10.2.0.4.0 -Dpackaging=jar - ${project.basedir}/ci-dependencies + ${basedir}/../../ci-dependencies @@ -280,7 +280,7 @@ -Dversion=4.0.41 -Dpackaging=jar - ${project.basedir}/ci-dependencies + ${basedir}/../../ci-dependencies @@ -323,7 +323,7 @@ -Dversion=4.0.41 -Dpackaging=jar - ${project.basedir}/ci-dependencies + ${basedir}/../../ci-dependencies From 7b505549dbac15c7fc6d475a4a0c40b039a82e3a Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 10:41:23 +0800 Subject: [PATCH 10/24] Fix wrong url. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c227d0a64..ef09e4a44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ sudo: required language: java before_install: - cd ci-dependencies - - curl -O https://openskywalking.github.io/skywalking-ci-assist/jar/ojdbc14-10.2.0.4.0.jar - - curl -O https://openskywalking.github.io/skywalking-ci-assist/jar/resin-3.0.9.jar - - curl -O https://openskywalking.github.io/skywalking-ci-assist/jar/resin-4.0.41.jar + - curl -O https://openskywalking.github.io/skywalking-ci-assist/jars/ojdbc14-10.2.0.4.0.jar + - curl -O https://openskywalking.github.io/skywalking-ci-assist/jars/resin-3.0.9.jar + - curl -O https://openskywalking.github.io/skywalking-ci-assist/jars/resin-4.0.41.jar - cd .. install: From 79579ba85ad0a4556084d066f57bc7ee49530fe5 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 12:01:45 +0800 Subject: [PATCH 11/24] Use maven repository resin 3 dependencies. --- apm-sniffer/apm-sdk-plugin/pom.xml | 31 ------------------------------ 1 file changed, 31 deletions(-) diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/pom.xml index 660fa1514..1ae9e03dd 100644 --- a/apm-sniffer/apm-sdk-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/pom.xml @@ -256,37 +256,6 @@ resin-3.x-plugin - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - install-ojdbc - false - process-resources - - exec - - - mvn - - install:install-file - -Dfile=resin-3.0.9.jar - -DgroupId=com.caucho - -DartifactId=resin - -Dversion=4.0.41 - -Dpackaging=jar - - ${basedir}/../../ci-dependencies - - - - - - From 41d7b5cb54a4e97d073b9d2449c19d67926ce412 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 14:14:12 +0800 Subject: [PATCH 12/24] Add a query service --- .../src/main/resources/ui-graphql/server-layer.graphqls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 1d01ec211..de4134735 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 @@ -33,7 +33,8 @@ type MemoryTrend { } extend type Query { - searchServer(keyword: String!, duration: Duration!): [AppServerInfo] + searchServer(keyword: String!, duration: Duration!): [AppServerInfo!]! + getAllServer(applicationId: ID!, duration: Duration!): [AppServerInfo!]! getServerResponseTimeTrend(serverId: ID!, duration: Duration!): ResponseTimeTrend getServerTPSTrend(serverId: ID!, duration: Duration!): ThroughputTrend getCPUTrend(serverId: ID!, duration: Duration!): CPUTrend From 4a01c08dc45eb6066a55c14b5f6d07d7e95530c7 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 14:22:01 +0800 Subject: [PATCH 13/24] Remove an install. --- apm-sniffer/apm-sdk-plugin/pom.xml | 63 ------------------------------ pom.xml | 32 +-------------- 2 files changed, 1 insertion(+), 94 deletions(-) diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/pom.xml index 1ae9e03dd..0bba88f18 100644 --- a/apm-sniffer/apm-sdk-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/pom.xml @@ -212,38 +212,6 @@ oracle-10.x-plugin - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - install-ojdbc - false - process-resources - - exec - - - mvn - - install:install-file - -Dfile=ojdbc14-10.2.0.4.0.jar - -DgroupId=com.oracle - -DartifactId=ojdbc14 - -Dversion=10.2.0.4.0 - -Dpackaging=jar - - ${basedir}/../../ci-dependencies - - - - - - @@ -268,37 +236,6 @@ resin-4.x-plugin - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - install-ojdbc - false - process-resources - - exec - - - mvn - - install:install-file - -Dfile=resin-4.0.41.jar - -DgroupId=com.caucho - -DartifactId=resin - -Dversion=4.0.41 - -Dpackaging=jar - - ${basedir}/../../ci-dependencies - - - - - - diff --git a/pom.xml b/pom.xml index 3b60d2e26..c74621824 100644 --- a/pom.xml +++ b/pom.xml @@ -323,43 +323,13 @@ + install-resin-3 ${basedir}/ci-dependencies/resin-3.0.9.jar - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - install-resin-3 - false - process-resources - - exec - - - mvn - - install:install-file - -Dfile=resin-3.0.9.jar - -DgroupId=com.caucho - -DartifactId=resin - -Dversion=3.0.9 - -Dpackaging=jar - - ${project.basedir}/ci-dependencies - - - - - - From 3cd03a720a7319dead5725c4f6a1072dff47970d Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 14:56:34 +0800 Subject: [PATCH 14/24] Add Chinese document about building resin and ojdbc plugins. --- docs/README_ZH.md | 2 +- docs/cn/How-to-build-CN.md | 8 ++++++++ pom.xml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/README_ZH.md b/docs/README_ZH.md index 1db771371..8b612efc1 100644 --- a/docs/README_ZH.md +++ b/docs/README_ZH.md @@ -3,7 +3,7 @@ * [项目简介](/README_ZH.md) * [快速入门](cn/Quick-start-CN.md) - * [部署Collector镜像](cn/Deploy-docker-image.CN.md) + * [部署Collector镜像](cn/Deploy-docker-image-CN.md) * [中间件,框架与类库支持列表](Supported-list.md) * [如何关闭特定插件](cn/How-to-disable-plugin-CN.md) * APM相关介绍资料 diff --git a/docs/cn/How-to-build-CN.md b/docs/cn/How-to-build-CN.md index 8159b1746..07ce42936 100644 --- a/docs/cn/How-to-build-CN.md +++ b/docs/cn/How-to-build-CN.md @@ -16,3 +16,11 @@ - **apm-protocol/apm-network/target/generated-sources/protobuf**目录下的`grpc-java`和`java`目录 - **apm-collector/apm-collector-remote/apm-remote-grpc-provider/target/protobuf**目录下的`grpc-java`和`java`目录 +## 编译Resin-3, Resin-4 和 Oracle JDBC 驱动插件 +为了遵守Apache关于协议(License)的相关要求,不符合Apache相关要求的类库所对应的Plugin不会自动编译。如需编译对应的插件, +需要手动下载驱动或类库,并将文件拷贝到`ci-dependencies/`中,运行`mvn package`进行编译。 + +`ci-dependencies/`下对应的类库文件名为: +* resin-3.0.9.jar +* resin-4.0.41.jar +* ojdbc14-10.2.0.4.0.jar \ No newline at end of file diff --git a/pom.xml b/pom.xml index c74621824..4c88357c5 100644 --- a/pom.xml +++ b/pom.xml @@ -323,7 +323,7 @@ - + install-resin-3 From fdf4a6ea40165991c6d11c6f1d14aa72f6ed8e90 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 15:01:48 +0800 Subject: [PATCH 15/24] Fix typo. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4c88357c5..83985a493 100644 --- a/pom.xml +++ b/pom.xml @@ -323,7 +323,7 @@ - + install-resin-3 From 5da5d059dd0759debe2029cbd1ee2f30bc78efda Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Fri, 12 Jan 2018 16:03:19 +0800 Subject: [PATCH 16/24] Rmove a download. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ef09e4a44..031635c67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ language: java before_install: - cd ci-dependencies - curl -O https://openskywalking.github.io/skywalking-ci-assist/jars/ojdbc14-10.2.0.4.0.jar - - curl -O https://openskywalking.github.io/skywalking-ci-assist/jars/resin-3.0.9.jar - curl -O https://openskywalking.github.io/skywalking-ci-assist/jars/resin-4.0.41.jar - cd .. From 8f260f8eb1ef373791febf686c39bc8dade8c19d Mon Sep 17 00:00:00 2001 From: wusheng Date: Fri, 12 Jan 2018 23:28:21 +0800 Subject: [PATCH 17/24] Update trace type. --- .../main/resources/ui-graphql/trace.graphqls | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) 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 b52ea0fe4..d867caba6 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 @@ -34,21 +34,14 @@ enum QueryOrder { # The trace represents a distributed trace, includes all segments and spans. type Trace { - traceId: ID! - segments: [Segment!]! -} - -type Segment { - segmentId: ID! - appName: String! - isSizeLimited: Boolean! spans: [Span!]! } type Span { - refs: [Ref!]! + traceId: ID! + segmentId: ID! spanId: Int! - parentSpanId: Int! + refs: [Ref!]! startTime: Long! endTime: Long! operationName: String @@ -65,12 +58,20 @@ type Span { } # Ref represents the link between the segment and its parents. +# The parent(ref) may not exists, which means batch process. +# The UI should display a list, representing the other trace IDs. type Ref { + traceId: ID! parentSegmentId: ID! parentSpanId: Int! # Ref type represents why did the ref happen. # Include: 1) CrossProcess 2) CrossThread - type: String! + type: RefType! +} + +enum RefType { + CROSS_PROCESS, + CROSS_THREAD } type KeyValue { @@ -86,4 +87,4 @@ type LogEntity { extend type Query { queryBasicTraces(condition: TraceQueryCondition): TraceBrief queryTrace(traceId: ID!): Trace -} \ No newline at end of file +} From 691fb78bc9834bcaf41ed0c292c54cd8b072108c Mon Sep 17 00:00:00 2001 From: wusheng Date: Sat, 13 Jan 2018 22:38:25 +0800 Subject: [PATCH 18/24] Add `isAlarm` for ApplicationNode. --- .../src/main/resources/ui-graphql/application-layer.graphqls | 3 +++ 1 file changed, 3 insertions(+) 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 5620e96e0..91d0b2d79 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 @@ -15,6 +15,9 @@ type ApplicationNode implements Node { # Max value is 1 # 2 Digits after floating point. apdex: Float! + # Whether the application alerts? + # Default value is false. + isAlarm: Boolean! # The number of servers in the application code numOfServer: Int! # The number of servers alerting From 18a83ce414e17c97e2bf99751fc1b9359b5e9b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=99=9F=20Wu=20Sheng?= Date: Sun, 14 Jan 2018 10:07:06 +0800 Subject: [PATCH 19/24] Update NOTICE.txt Update year to 2018 --- NOTICE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE.txt b/NOTICE.txt index 241f32e67..36ebf1d03 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,5 +1,5 @@ Apache SkyWalking -Copyright 2015-2017 The Apache Software Foundation +Copyright 2015-2018 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). From fc431d3c9a56f2155bd7971aa1665e2055c6a76d Mon Sep 17 00:00:00 2001 From: peng-yongsheng <8082209@qq.com> Date: Sun, 14 Jan 2018 17:05:45 +0800 Subject: [PATCH 20/24] Missing change about boolean to integer. --- .../provider/worker/segment/SegmentCostSpanListener.java | 3 ++- .../apm/collector/storage/table/segment/SegmentCost.java | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentCostSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentCostSpanListener.java index 9c16671e8..d12cfca97 100644 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentCostSpanListener.java +++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentCostSpanListener.java @@ -33,6 +33,7 @@ import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService 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; +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.table.segment.SegmentCost; import org.slf4j.Logger; @@ -98,7 +99,7 @@ public class SegmentCostSpanListener implements EntrySpanListener, ExitSpanListe Graph graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SEGMENT_COST_GRAPH_ID, SegmentCost.class); logger.debug("segment cost listener build"); for (SegmentCost segmentCost : segmentCosts) { - segmentCost.setIsError(isError); + segmentCost.setIsError(BooleanUtils.booleanToValue(isError)); segmentCost.setTimeBucket(timeBucket); graph.start(segmentCost); } diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentCost.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentCost.java index cac209d8c..475019bd0 100644 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentCost.java +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentCost.java @@ -22,7 +22,6 @@ import org.apache.skywalking.apm.collector.core.data.Column; import org.apache.skywalking.apm.collector.core.data.StreamData; import org.apache.skywalking.apm.collector.core.data.operator.CoverOperation; import org.apache.skywalking.apm.collector.core.data.operator.NonOperation; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; /** * @author peng-yongsheng @@ -127,11 +126,11 @@ public class SegmentCost extends StreamData { setDataInteger(0, applicationId); } - public Boolean getIsError() { - return BooleanUtils.valueToBoolean(getDataInteger(1)); + public Integer getIsError() { + return getDataInteger(1); } - public void setIsError(Boolean isError) { - setDataInteger(0, BooleanUtils.booleanToValue(isError)); + public void setIsError(Integer isError) { + setDataInteger(1, isError); } } From b04b06aac1256740c1d102ee83da3a5c3b7e2334 Mon Sep 17 00:00:00 2001 From: peng-yongsheng <8082209@qq.com> Date: Sun, 14 Jan 2018 17:40:15 +0800 Subject: [PATCH 21/24] Fixed the id auto increment bug, when there is just one record that id = -1, the expected value is 1, but actual return -1. --- .../provider/register/IdAutoIncrement.java | 18 ++++---- .../register/IdAutoIncrementTestCase.java | 46 +++++++++++++++++++ 2 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 apm-collector/apm-collector-analysis/analysis-register/register-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrementTestCase.java diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrement.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrement.java index 896e0efeb..cf1827e88 100644 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrement.java +++ b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrement.java @@ -25,18 +25,20 @@ public enum IdAutoIncrement { INSTANCE; public int increment(int min, int max) { - int instanceId; + int id; if (min == max) { - instanceId = -1; + if (min == 0) { + id = -1; + } else { + id = 1; + } } else if (min + max == 0) { - instanceId = max + 1; + id = max + 1; } else if (min + max > 0) { - instanceId = min - 1; - } else if (max < 0) { - instanceId = 1; + id = min - 1; } else { - instanceId = max + 1; + id = max + 1; } - return instanceId; + return id; } } diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrementTestCase.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrementTestCase.java new file mode 100644 index 000000000..ad9d0e285 --- /dev/null +++ b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrementTestCase.java @@ -0,0 +1,46 @@ +/* + * 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.register.provider.register; + +import org.junit.Assert; +import org.junit.Test; + +/** + * @author peng-yongsheng + */ +public class IdAutoIncrementTestCase { + + @Test + public void testIncrement() { + int id = IdAutoIncrement.INSTANCE.increment(0, 0); + Assert.assertEquals(-1, id); + + id = IdAutoIncrement.INSTANCE.increment(-1, -1); + Assert.assertEquals(1, id); + + id = IdAutoIncrement.INSTANCE.increment(-1, 1); + Assert.assertEquals(2, id); + + id = IdAutoIncrement.INSTANCE.increment(-1, 2); + Assert.assertEquals(-2, id); + + id = IdAutoIncrement.INSTANCE.increment(-2, 2); + Assert.assertEquals(3, id); + } +} From c5bedc51dd08deabdc141a7df77988e9346cc8e0 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Mon, 15 Jan 2018 09:31:12 +0800 Subject: [PATCH 22/24] New badges about github stars and twitter followers. --- README.md | 3 ++- README_ZH.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0ac610447..1730de150 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ microservices, cloud native and container-based (Docker, K8s, Mesos) architectur Underlying technology is a distributed tracing system. [![Build Status](https://travis-ci.org/apache/incubator-skywalking.svg?branch=master)](https://travis-ci.org/apache/incubator-skywalking) -[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/AsfSkyWalking) +[![GitHub stars](https://img.shields.io/github/stars/apache/incubator-skywalking.svg?style=social&label=Stars)](https://github.com/apache/incubator-skywalking) +[![Twitter Follow](https://img.shields.io/twitter/follow/asfskywalking.svg?style=social&label=Follow)](https://twitter.com/AsfSkyWalking) [![Join the chat at https://gitter.im/sky-walking/Lobby](https://badges.gitter.im/openskywalking/Lobby.svg)](https://gitter.im/openskywalking/Lobby) [![OpenTracing-1.x Badge](https://img.shields.io/badge/OpenTracing--1.x-enabled-blue.svg)](http://opentracing.io) diff --git a/README_ZH.md b/README_ZH.md index 6a274fc04..40d8541f4 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -7,7 +7,8 @@ Apache SkyWalking | [English](README.md) 其核心是个分布式追踪系统。 [![Build Status](https://travis-ci.org/apache/incubator-skywalking.svg?branch=master)](https://travis-ci.org/apache/incubator-skywalking) -[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/AsfSkyWalking) +[![GitHub stars](https://img.shields.io/github/stars/apache/incubator-skywalking.svg?style=social&label=Stars)](https://github.com/apache/incubator-skywalking) +[![Twitter Follow](https://img.shields.io/twitter/follow/asfskywalking.svg?style=social&label=Follow)](https://twitter.com/AsfSkyWalking) [![Join the chat at https://gitter.im/openskywalking/Lobby](https://badges.gitter.im/openskywalking/Lobby.svg)](https://gitter.im/openskywalking/Lobby) [![OpenTracing-1.x Badge](https://img.shields.io/badge/OpenTracing--1.x-enabled-blue.svg)](http://opentracing.io) From 7a8afc5bc040325b98af8339f5cf5c108d9bf4ac Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Mon, 15 Jan 2018 09:33:50 +0800 Subject: [PATCH 23/24] Change layout. --- README.md | 3 ++- README_ZH.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1730de150..f3e1e98b0 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,10 @@ Apache SkyWalking | [中文](README_ZH.md) microservices, cloud native and container-based (Docker, K8s, Mesos) architectures. Underlying technology is a distributed tracing system. -[![Build Status](https://travis-ci.org/apache/incubator-skywalking.svg?branch=master)](https://travis-ci.org/apache/incubator-skywalking) [![GitHub stars](https://img.shields.io/github/stars/apache/incubator-skywalking.svg?style=social&label=Stars)](https://github.com/apache/incubator-skywalking) [![Twitter Follow](https://img.shields.io/twitter/follow/asfskywalking.svg?style=social&label=Follow)](https://twitter.com/AsfSkyWalking) + +[![Build Status](https://travis-ci.org/apache/incubator-skywalking.svg?branch=master)](https://travis-ci.org/apache/incubator-skywalking) [![Join the chat at https://gitter.im/sky-walking/Lobby](https://badges.gitter.im/openskywalking/Lobby.svg)](https://gitter.im/openskywalking/Lobby) [![OpenTracing-1.x Badge](https://img.shields.io/badge/OpenTracing--1.x-enabled-blue.svg)](http://opentracing.io) diff --git a/README_ZH.md b/README_ZH.md index 40d8541f4..371c61f9e 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -6,9 +6,10 @@ Apache SkyWalking | [English](README.md) **SkyWalking**: 针对分布式系统的APM(应用性能监控)系统,特别针对微服务、cloud native和容器化(Docker, K8s, Mesos)架构, 其核心是个分布式追踪系统。 -[![Build Status](https://travis-ci.org/apache/incubator-skywalking.svg?branch=master)](https://travis-ci.org/apache/incubator-skywalking) [![GitHub stars](https://img.shields.io/github/stars/apache/incubator-skywalking.svg?style=social&label=Stars)](https://github.com/apache/incubator-skywalking) [![Twitter Follow](https://img.shields.io/twitter/follow/asfskywalking.svg?style=social&label=Follow)](https://twitter.com/AsfSkyWalking) + +[![Build Status](https://travis-ci.org/apache/incubator-skywalking.svg?branch=master)](https://travis-ci.org/apache/incubator-skywalking) [![Join the chat at https://gitter.im/openskywalking/Lobby](https://badges.gitter.im/openskywalking/Lobby.svg)](https://gitter.im/openskywalking/Lobby) [![OpenTracing-1.x Badge](https://img.shields.io/badge/OpenTracing--1.x-enabled-blue.svg)](http://opentracing.io) From bcffa44ad421c96ddf03ab3e0e62111bdc6cc312 Mon Sep 17 00:00:00 2001 From: wu-sheng Date: Mon, 15 Jan 2018 09:59:09 +0800 Subject: [PATCH 24/24] Update badges. --- README.md | 4 ++-- README_ZH.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f3e1e98b0..5ba47c4d7 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ Apache SkyWalking | [中文](README_ZH.md) microservices, cloud native and container-based (Docker, K8s, Mesos) architectures. Underlying technology is a distributed tracing system. -[![GitHub stars](https://img.shields.io/github/stars/apache/incubator-skywalking.svg?style=social&label=Stars)](https://github.com/apache/incubator-skywalking) -[![Twitter Follow](https://img.shields.io/twitter/follow/asfskywalking.svg?style=social&label=Follow)](https://twitter.com/AsfSkyWalking) +[![GitHub stars](https://img.shields.io/github/stars/apache/incubator-skywalking.svg?style=for-the-badge&label=Stars&logo=github)](https://github.com/apache/incubator-skywalking) +[![Twitter Follow](https://img.shields.io/twitter/follow/asfskywalking.svg?style=for-the-badge&label=Follow&logo=twitter)](https://twitter.com/AsfSkyWalking) [![Build Status](https://travis-ci.org/apache/incubator-skywalking.svg?branch=master)](https://travis-ci.org/apache/incubator-skywalking) [![Join the chat at https://gitter.im/sky-walking/Lobby](https://badges.gitter.im/openskywalking/Lobby.svg)](https://gitter.im/openskywalking/Lobby) diff --git a/README_ZH.md b/README_ZH.md index 371c61f9e..06dd40de7 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -6,8 +6,8 @@ Apache SkyWalking | [English](README.md) **SkyWalking**: 针对分布式系统的APM(应用性能监控)系统,特别针对微服务、cloud native和容器化(Docker, K8s, Mesos)架构, 其核心是个分布式追踪系统。 -[![GitHub stars](https://img.shields.io/github/stars/apache/incubator-skywalking.svg?style=social&label=Stars)](https://github.com/apache/incubator-skywalking) -[![Twitter Follow](https://img.shields.io/twitter/follow/asfskywalking.svg?style=social&label=Follow)](https://twitter.com/AsfSkyWalking) +[![GitHub stars](https://img.shields.io/github/stars/apache/incubator-skywalking.svg?style=for-the-badge&label=Stars&logo=github)](https://github.com/apache/incubator-skywalking) +[![Twitter Follow](https://img.shields.io/twitter/follow/asfskywalking.svg?style=for-the-badge&label=Follow&logo=twitter)](https://twitter.com/AsfSkyWalking) [![Build Status](https://travis-ci.org/apache/incubator-skywalking.svg?branch=master)](https://travis-ci.org/apache/incubator-skywalking) [![Join the chat at https://gitter.im/openskywalking/Lobby](https://badges.gitter.im/openskywalking/Lobby.svg)](https://gitter.im/openskywalking/Lobby)