Merge branch 'master' into feature/graphql

This commit is contained in:
吴晟 Wu Sheng 2018-01-16 09:26:04 +08:00 committed by GitHub
commit 4f2c781270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 206 additions and 95 deletions

View File

@ -1,12 +1,13 @@
sudo: required
services:
- docker
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-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

View File

@ -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/).

View File

@ -7,8 +7,10 @@ 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=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)
[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](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)

View File

@ -6,8 +6,10 @@ 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=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)
[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](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)

View File

@ -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<SegmentCost> 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);
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -1,7 +1,17 @@
type Alarm {
items: [AlarmItem!]!
count: Int!
}
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!
causeType: CauseType!
}
enum AlarmType {
@ -10,6 +20,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!): Alarm
}

View File

@ -8,20 +8,22 @@ 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.
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
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
@ -33,8 +35,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!): [ServiceInfo!]
getServerThroughput(applicationId: ID!, duration: Duration!): [AppServerInfo!]
getSlowService(applicationId: ID!, duration: Duration!, top: Int!): [ServiceInfo!]!
getServerThroughput(applicationId: ID!, duration: Duration!, top: Int!): [AppServerInfo!]!
}

View File

@ -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
}
input 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
@ -74,6 +87,15 @@ interface Node {
type: String
}
# Incoming request node, means User or outside system access the cluster from this.
type VisualUserNode implements Node {
id: ID!
# Constant, value = "User"
name: String!
# Constant, value = "USER"
type: String
}
# The Call represents a directed distributed call,
# from the `source` to the `target`.
type Call {

View File

@ -0,0 +1,38 @@
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: [TTLConfigItem!]!): Boolean!
setAlarmThreshold(thresholds: [AlarmThreshold!]!): Boolean!
}
extend type Query {
queryAllDataTTLConfigs: ExistedTTLConfigs!
queryAlarmThresholds(alarmType: AlarmType): ExistedAlarmThresholds!
}

View File

@ -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!]!
}

View File

@ -15,25 +15,26 @@ 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 {
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

View File

@ -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

View File

@ -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 {
@ -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
@ -60,17 +53,25 @@ 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.
# 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
}
}

View File

@ -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);
}

View File

@ -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相关介绍资料

View File

@ -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

32
pom.xml
View File

@ -323,43 +323,13 @@
</profile>
<profile>
<!-- resin is not Apache license compatible, so it must be manually downloaded first -->
<!-- Use resin 3.x jar file as a beacon only -->
<id>install-resin-3</id>
<activation>
<file>
<exists>${basedir}/ci-dependencies/resin-3.0.9.jar</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>install-resin-3</id>
<inherited>false</inherited>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<arguments>
<argument>install:install-file</argument>
<argument>-Dfile=resin-3.0.9.jar</argument>
<argument>-DgroupId=com.caucho</argument>
<argument>-DartifactId=resin</argument>
<argument>-Dversion=3.0.9</argument>
<argument>-Dpackaging=jar</argument>
</arguments>
<workingDirectory>${project.basedir}/ci-dependencies</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- resin is not Apache license compatible, so it must be manually downloaded first -->