Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
bcaa8be0
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 大约 1 年
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bcaa8be0
编写于
10月 30, 2019
作者:
Z
zhangwei
提交者:
wu-sheng
10月 30, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
toolkit-scenario (#3739)
上级
7ebb3107
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
967 addition
and
6 deletion
+967
-6
Jenkinsfile-Agent-Test-2
Jenkinsfile-Agent-Test-2
+7
-1
test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockTraceSegmentService.java
...n/test/mockcollector/service/MockTraceSegmentService.java
+1
-1
test/plugin/scenarios/apm-toolkit-trace-scenario/bin/startup.sh
...lugin/scenarios/apm-toolkit-trace-scenario/bin/startup.sh
+21
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/config/expectedData.yaml
...arios/apm-toolkit-trace-scenario/config/expectedData.yaml
+264
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/configuration.yml
...in/scenarios/apm-toolkit-trace-scenario/configuration.yml
+21
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/pom.xml
test/plugin/scenarios/apm-toolkit-trace-scenario/pom.xml
+118
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/assembly/assembly.xml
...apm-toolkit-trace-scenario/src/main/assembly/assembly.xml
+41
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/ActiveSpan.java
...a/org/apache/skywalking/apm/toolkit/trace/ActiveSpan.java
+48
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/CallableWrapper.java
.../apache/skywalking/apm/toolkit/trace/CallableWrapper.java
+41
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/RunnableWrapper.java
.../apache/skywalking/apm/toolkit/trace/RunnableWrapper.java
+39
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/Trace.java
...n/java/org/apache/skywalking/apm/toolkit/trace/Trace.java
+41
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/TraceContext.java
...org/apache/skywalking/apm/toolkit/trace/TraceContext.java
+40
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/TraceCrossThread.java
...apache/skywalking/apm/toolkit/trace/TraceCrossThread.java
+32
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/Application.java
...g/apache/skywalking/apm/testcase/toolkit/Application.java
+30
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/controller/TestController.java
...lking/apm/testcase/toolkit/controller/TestController.java
+97
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/controller/TestService.java
...ywalking/apm/testcase/toolkit/controller/TestService.java
+81
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/resources/application.yaml
...oolkit-trace-scenario/src/main/resources/application.yaml
+22
-0
test/plugin/scenarios/apm-toolkit-trace-scenario/support-version.list
...scenarios/apm-toolkit-trace-scenario/support-version.list
+17
-0
test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentAssert.java
...gin/test/agent/tool/validator/assertor/SegmentAssert.java
+2
-0
test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentForRead.java
...ugin/test/agent/tool/validator/entity/SegmentForRead.java
+3
-3
test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
...walking/plugin/test/agent/tool/validator/entity/Span.java
+1
-1
未找到文件。
Jenkinsfile-Agent-Test-2
浏览文件 @
bcaa8be0
...
...
@@ -66,7 +66,7 @@ pipeline {
sh './mvnw -f test/plugin/pom.xml clean package -DskipTests -Dbuild_id=wl2_${BUILD_ID} docker:build'
}
}
stage('Test Cases Report (15
5
)') {
stage('Test Cases Report (15
6
)') {
steps {
echo "reserve."
}
...
...
@@ -110,6 +110,12 @@ pipeline {
sh 'bash test/plugin/run.sh --build_id=wl2_${BUILD_ID} spring-4.1.x-scenario'
}
}
stage('apm-toolkit-trace (1)') {
steps {
sh 'bash test/plugin/run.sh --build_id=wl2_${BUILD_ID} apm-toolkit-trace-scenario'
}
}
}
}
stage('Group2') {
...
...
test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockTraceSegmentService.java
浏览文件 @
bcaa8be0
...
...
@@ -46,7 +46,7 @@ public class MockTraceSegmentService extends TraceSegmentReportServiceGrpc.Trace
for
(
SpanObjectV2
spanObject
:
traceSegmentObject
.
getSpansList
())
{
Span
.
SpanBuilder
spanBuilder
=
Span
.
builder
().
operationName
(
spanObject
.
getOperationName
()).
parentSpanId
(
spanObject
.
getParentSpanId
())
.
spanId
(
spanObject
.
getSpanId
()).
componentId
(
spanObject
.
getComponentId
()).
componentName
(
spanObject
.
getComponent
())
.
spanLayer
(
spanObject
.
getSpanLayer
().
toString
()).
endTime
(
spanObject
.
getEndTime
())
.
spanLayer
(
spanObject
.
getSpanLayer
().
toString
()).
endTime
(
spanObject
.
getEndTime
())
.
isError
(
spanObject
.
getIsError
())
.
startTime
(
spanObject
.
getStartTime
()).
spanType
(
spanObject
.
getSpanType
().
toString
())
.
peer
(
spanObject
.
getPeer
()).
peerId
(
spanObject
.
getPeerId
()).
operationId
(
spanObject
.
getOperationNameId
());
...
...
test/plugin/scenarios/apm-toolkit-trace-scenario/bin/startup.sh
0 → 100644
浏览文件 @
bcaa8be0
#!/bin/bash
#
# 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.
home
=
"
$(
cd
"
$(
dirname
$0
)
"
;
pwd
)
"
java
-jar
${
agent_opts
}
${
home
}
/../libs/apm-toolkit-trace-scenario.jar &
\ No newline at end of file
test/plugin/scenarios/apm-toolkit-trace-scenario/config/expectedData.yaml
0 → 100644
浏览文件 @
bcaa8be0
# 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.
registryItems
:
applications
:
-
{
apm-toolkit-trace-scenario
:
2
}
instances
:
-
{
apm-toolkit-trace-scenario
:
1
}
operationNames
:
-
apm-toolkit-trace-scenario
:
[
/apm-toolkit-trace-scenario/case/asyncVisit/runnable
,
/case/asyncVisit/runnable
,
/case/asyncVisit/callable
,
/apm-toolkit-trace-scenario/case/asyncVisit/callable
,
/case/tool-kit
]
heartbeat
:
[]
segmentItems
:
-
applicationCode
:
apm-toolkit-trace-scenario
segmentSize
:
gt
5
segments
:
-
segmentId
:
not
null
spans
:
-
operationName
:
test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testTag()
operationId
:
0
parentSpanId
:
0
spanId
:
1
spanLayer
:
Unknown
startTime
:
nq
0
endTime
:
nq
0
componentId
:
0
componentName
:
'
'
isError
:
false
spanType
:
Local
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
key
,
value
:
value
}
-
operationName
:
test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testInfo()
operationId
:
0
parentSpanId
:
0
spanId
:
2
spanLayer
:
Unknown
startTime
:
nq
0
endTime
:
nq
0
componentId
:
0
componentName
:
'
'
isError
:
false
spanType
:
Local
peer
:
'
'
peerId
:
0
logs
:
-
logEvent
:
-
{
key
:
event
,
value
:
info
}
-
{
key
:
message
,
value
:
TestInfoMsg
}
-
operationName
:
test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testDebug()
operationId
:
0
parentSpanId
:
0
spanId
:
3
spanLayer
:
Unknown
startTime
:
nq
0
endTime
:
nq
0
componentId
:
0
componentName
:
'
'
isError
:
false
spanType
:
Local
peer
:
'
'
peerId
:
0
logs
:
-
logEvent
:
-
{
key
:
event
,
value
:
debug
}
-
{
key
:
message
,
value
:
TestDebugMsg
}
-
operationName
:
test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testError()
operationId
:
0
parentSpanId
:
0
spanId
:
4
spanLayer
:
Unknown
startTime
:
nq
0
endTime
:
nq
0
componentId
:
0
componentName
:
'
'
isError
:
true
spanType
:
Local
peer
:
'
'
peerId
:
0
-
operationName
:
test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testErrorMsg()
operationId
:
0
parentSpanId
:
0
spanId
:
5
spanLayer
:
Unknown
startTime
:
nq
0
endTime
:
nq
0
componentId
:
0
componentName
:
'
'
isError
:
true
spanType
:
Local
peer
:
'
'
peerId
:
0
logs
:
-
logEvent
:
-
{
key
:
event
,
value
:
error
}
-
{
key
:
message
,
value
:
TestErrorMsg
}
-
operationName
:
test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testErrorThrowable()
operationId
:
0
parentSpanId
:
0
spanId
:
6
spanLayer
:
Unknown
startTime
:
nq
0
endTime
:
nq
0
componentId
:
0
componentName
:
'
'
isError
:
true
spanType
:
Local
peer
:
'
'
peerId
:
0
logs
:
-
logEvent
:
-
{
key
:
event
,
value
:
error
}
-
{
key
:
error.kind
,
value
:
java.lang.RuntimeException
}
-
{
key
:
message
,
value
:
Test-Exception
}
-
{
key
:
stack
,
value
:
not null
}
-
operationName
:
/case/tool-kit
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
14
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/apm-toolkit-trace-scenario/case/tool-kit'
}
-
{
key
:
http.method
,
value
:
GET
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/case/asyncVisit/callable
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
14
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/callable'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
Thread/org.apache.skywalking.apm.toolkit.trace.CallableWrapper/call
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
localhost:8080'
,
entryEndpoint
:
/case/tool-kit
,
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/apm-toolkit-trace-scenario/case/asyncVisit/runnable
operationId
:
0
parentSpanId
:
0
spanId
:
1
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
2
componentName
:
'
'
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/runnable'
}
-
{
key
:
http.method
,
value
:
GET
}
-
operationName
:
Thread/org.apache.skywalking.apm.toolkit.trace.RunnableWrapper/run
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Unknown
startTime
:
nq
0
endTime
:
nq
0
componentId
:
0
componentName
:
'
'
isError
:
false
spanType
:
Local
peer
:
'
'
peerId
:
0
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
/case/tool-kit
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossThread
,
parentSpanId
:
0
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
'
,
entryEndpoint
:
/case/tool-kit
,
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/apm-toolkit-trace-scenario/case/asyncVisit/callable
operationId
:
0
parentSpanId
:
0
spanId
:
1
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
2
componentName
:
'
'
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/callable'
}
-
{
key
:
http.method
,
value
:
GET
}
-
operationName
:
Thread/org.apache.skywalking.apm.toolkit.trace.CallableWrapper/call
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Unknown
startTime
:
nq
0
endTime
:
nq
0
componentId
:
0
componentName
:
'
'
isError
:
false
spanType
:
Local
peer
:
'
'
peerId
:
0
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
/case/tool-kit
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossThread
,
parentSpanId
:
0
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
'
,
entryEndpoint
:
/case/tool-kit
,
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/case/asyncVisit/runnable
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
14
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/runnable'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
Thread/org.apache.skywalking.apm.toolkit.trace.RunnableWrapper/run
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
localhost:8080'
,
entryEndpoint
:
/case/tool-kit
,
entryServiceInstanceId
:
1
}
\ No newline at end of file
test/plugin/scenarios/apm-toolkit-trace-scenario/configuration.yml
0 → 100644
浏览文件 @
bcaa8be0
# 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.
type
:
jvm
entryService
:
http://localhost:8080/apm-toolkit-trace-scenario/case/tool-kit
healthCheck
:
http://localhost:8080/apm-toolkit-trace-scenario/case/healthCheck
startScript
:
./bin/startup.sh
framework
:
apm-toolkit-trace
test/plugin/scenarios/apm-toolkit-trace-scenario/pom.xml
0 → 100644
浏览文件 @
bcaa8be0
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
apm-toolkit-trace-scenario
</artifactId>
<version>
5.0.0
</version>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<compiler.version>
1.8
</compiler.version>
<spring.boot.version>
2.1.6.RELEASE
</spring.boot.version>
<test.framework>
apm-toolkit-trace
</test.framework>
<test.framework.version>
1.0.0
</test.framework.version>
</properties>
<name>
skywalking-apm-toolkit-trace-scenario
</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${spring.boot.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.3
</version>
</dependency>
</dependencies>
<build>
<finalName>
apm-toolkit-trace-scenario
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
${compiler.version}
</source>
<target>
${compiler.version}
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<executions>
<execution>
<id>
assemble
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/assembly.xml
</descriptor>
</descriptors>
<outputDirectory>
./target/
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>
spring-snapshots
</id>
<url>
http://repo.spring.io/snapshot
</url>
</pluginRepository>
<pluginRepository>
<id>
spring-milestones
</id>
<url>
http://repo.spring.io/milestone
</url>
</pluginRepository>
</pluginRepositories>
</project>
\ No newline at end of file
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/assembly/assembly.xml
0 → 100644
浏览文件 @
bcaa8be0
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<assembly
xmlns=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"
>
<formats>
<format>
zip
</format>
</formats>
<fileSets>
<fileSet>
<directory>
./bin
</directory>
<fileMode>
0775
</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>
./target/apm-toolkit-trace-scenario.jar
</source>
<outputDirectory>
./libs
</outputDirectory>
<fileMode>
0775
</fileMode>
</file>
</files>
</assembly>
\ No newline at end of file
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/ActiveSpan.java
0 → 100644
浏览文件 @
bcaa8be0
/*
* 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.toolkit.trace
;
/**
* provide custom api that set tag for current active span.
*
* @author zhangxin
*/
public
class
ActiveSpan
{
/**
* @param key tag key
* @param value tag value
*/
public
static
void
tag
(
String
key
,
String
value
)
{
}
public
static
void
error
()
{
}
public
static
void
error
(
String
errorMsg
)
{
}
public
static
void
error
(
Throwable
throwable
)
{
}
public
static
void
debug
(
String
debugMsg
)
{
}
public
static
void
info
(
String
infoMsg
)
{
}
}
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/CallableWrapper.java
0 → 100644
浏览文件 @
bcaa8be0
/*
* 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.toolkit.trace
;
import
java.util.concurrent.Callable
;
/**
* @author carlvine500
*/
@TraceCrossThread
public
class
CallableWrapper
<
V
>
implements
Callable
<
V
>
{
final
Callable
<
V
>
callable
;
public
static
<
V
>
CallableWrapper
of
(
Callable
<
V
>
r
)
{
return
new
CallableWrapper
<
V
>(
r
);
}
public
CallableWrapper
(
Callable
<
V
>
callable
)
{
this
.
callable
=
callable
;
}
@Override
public
V
call
()
throws
Exception
{
return
callable
.
call
();
}
}
\ No newline at end of file
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/RunnableWrapper.java
0 → 100644
浏览文件 @
bcaa8be0
/*
* 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.toolkit.trace
;
/**
* @author lican
*/
@TraceCrossThread
public
class
RunnableWrapper
implements
Runnable
{
final
Runnable
runnable
;
public
RunnableWrapper
(
Runnable
runnable
)
{
this
.
runnable
=
runnable
;
}
public
static
RunnableWrapper
of
(
Runnable
r
)
{
return
new
RunnableWrapper
(
r
);
}
@Override
public
void
run
()
{
this
.
runnable
.
run
();
}
}
\ No newline at end of file
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/Trace.java
0 → 100644
浏览文件 @
bcaa8be0
/*
* 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.toolkit.trace
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* The agent create local span if the method that annotation with {@link Trace}. The value of span operation name will
* fetch by {@link #operationName()}. if the value of {@link #operationName()} is blank string. the operation name will
* be set the class name + method name.
*
* @author zhangxin
*/
@Target
(
ElementType
.
METHOD
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
Trace
{
/**
* @return operation name, the default value is blank string.
*/
String
operationName
()
default
""
;
}
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/TraceContext.java
0 → 100644
浏览文件 @
bcaa8be0
/*
* 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.toolkit.trace
;
/**
* Try to access the sky-walking tracer context.
* The context is not existed, always.
* only the middleware, component, or rpc-framework are supported in the current invoke stack, in the same thread,
* the context will be available.
* <p>
* Created by xin on 2016/12/15.
*/
public
class
TraceContext
{
/**
* Try to get the traceId of current trace context.
*
* @return traceId, if it exists, or empty {@link String}.
*/
public
static
String
traceId
()
{
return
""
;
}
}
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/TraceCrossThread.java
0 → 100644
浏览文件 @
bcaa8be0
/*
* 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.toolkit.trace
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @author carlvine500
*/
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
TraceCrossThread
{
}
\ No newline at end of file
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/Application.java
0 → 100644
浏览文件 @
bcaa8be0
/*
* 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
test.org.apache.skywalking.apm.testcase.toolkit
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
Application
.
class
,
args
);
}
}
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/controller/TestController.java
0 → 100644
浏览文件 @
bcaa8be0
/*
* 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
test.org.apache.skywalking.apm.testcase.toolkit.controller
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.client.ResponseHandler
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
/**
* @author caoyixiong
*/
@RestController
@RequestMapping
(
"/case"
)
public
class
TestController
{
private
static
final
String
SUCCESS
=
"Success"
;
@Autowired
private
TestService
testService
;
@RequestMapping
(
"/tool-kit"
)
public
String
toolKitCase
()
{
testService
.
testTag
();
testService
.
testInfo
();
testService
.
testDebug
();
testService
.
testError
();
testService
.
testErrorMsg
();
testService
.
testErrorThrowable
();
testService
.
asyncCallable
(()
->
{
visit
(
"http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/callable"
);
return
true
;
});
testService
.
asyncRunnable
(()
->
{
try
{
visit
(
"http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/runnable"
);
}
catch
(
IOException
e
)
{
// ignore
}
});
return
SUCCESS
;
}
@RequestMapping
(
"/healthCheck"
)
public
String
healthCheck
()
{
return
SUCCESS
;
}
@RequestMapping
(
"/asyncVisit/runnable"
)
public
String
asyncVisitRunnable
()
{
return
SUCCESS
;
}
@RequestMapping
(
"/asyncVisit/callable"
)
public
String
asyncVisitCallable
()
{
return
SUCCESS
;
}
private
static
void
visit
(
String
url
)
throws
IOException
{
CloseableHttpClient
httpclient
=
HttpClients
.
createDefault
();
try
{
HttpGet
httpget
=
new
HttpGet
(
url
);
ResponseHandler
<
String
>
responseHandler
=
response
->
{
HttpEntity
entity
=
response
.
getEntity
();
return
entity
!=
null
?
EntityUtils
.
toString
(
entity
)
:
null
;
};
httpclient
.
execute
(
httpget
,
responseHandler
);
}
finally
{
httpclient
.
close
();
}
}
}
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/controller/TestService.java
0 → 100644
浏览文件 @
bcaa8be0
/*
* 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
test.org.apache.skywalking.apm.testcase.toolkit.controller
;
import
org.apache.skywalking.apm.toolkit.trace.ActiveSpan
;
import
org.apache.skywalking.apm.toolkit.trace.CallableWrapper
;
import
org.apache.skywalking.apm.toolkit.trace.RunnableWrapper
;
import
org.apache.skywalking.apm.toolkit.trace.Trace
;
import
org.springframework.stereotype.Component
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
/**
* @author caoyixiong
*/
@Component
public
class
TestService
{
private
static
final
ExecutorService
SERVICE
=
Executors
.
newSingleThreadExecutor
(
r
->
{
Thread
thread
=
new
Thread
(
r
);
thread
.
setDaemon
(
true
);
return
thread
;
});
@Trace
public
void
testTag
()
{
ActiveSpan
.
tag
(
"key"
,
"value"
);
}
@Trace
public
void
testError
()
{
ActiveSpan
.
error
();
}
@Trace
public
void
testErrorMsg
()
{
ActiveSpan
.
error
(
"TestErrorMsg"
);
}
@Trace
public
void
testErrorThrowable
()
{
ActiveSpan
.
error
(
new
RuntimeException
(
"Test-Exception"
));
}
@Trace
public
void
testDebug
()
{
ActiveSpan
.
debug
(
"TestDebugMsg"
);
}
@Trace
public
void
testInfo
()
{
ActiveSpan
.
info
(
"TestInfoMsg"
);
}
public
void
asyncRunnable
(
Runnable
runnable
)
{
SERVICE
.
submit
(
RunnableWrapper
.
of
(
runnable
));
}
public
void
asyncCallable
(
Callable
<
Boolean
>
callable
)
{
SERVICE
.
submit
(
CallableWrapper
.
of
(
callable
));
}
}
test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/resources/application.yaml
0 → 100644
浏览文件 @
bcaa8be0
#
# 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.
#
#
server
:
port
:
8080
servlet
:
context-path
:
/apm-toolkit-trace-scenario
\ No newline at end of file
test/plugin/scenarios/apm-toolkit-trace-scenario/support-version.list
0 → 100644
浏览文件 @
bcaa8be0
# 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.
1.0.0
\ No newline at end of file
test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentAssert.java
浏览文件 @
bcaa8be0
...
...
@@ -104,6 +104,8 @@ public class SegmentAssert {
ExpressParser
.
parse
(
excepted
.
peer
()).
assertValue
(
"peer"
,
actualSpan
.
peer
());
ExpressParser
.
parse
(
excepted
.
spanLayer
()).
assertValue
(
"span layer"
,
actualSpan
.
spanLayer
());
ExpressParser
.
parse
(
excepted
.
peerId
()).
assertValue
(
"peer id"
,
actualSpan
.
peerId
());
ExpressParser
.
parse
(
excepted
.
error
()).
assertValue
(
"is error"
,
actualSpan
.
error
());
ExpressParser
.
parse
(
excepted
.
spanType
()).
assertValue
(
"span type"
,
actualSpan
.
spanType
());
tagsEquals
(
excepted
.
tags
(),
actualSpan
.
tags
());
logsEquals
(
excepted
.
logs
(),
actualSpan
.
logs
());
refEquals
(
excepted
.
refs
(),
actualSpan
.
refs
());
...
...
test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentForRead.java
浏览文件 @
bcaa8be0
...
...
@@ -184,7 +184,7 @@ public class SegmentForRead implements Segment {
private
String
endTime
;
private
String
componentId
;
private
String
componentName
;
private
boolean
isError
;
private
String
isError
;
private
String
spanType
;
private
String
peer
;
private
String
peerId
;
...
...
@@ -233,7 +233,7 @@ public class SegmentForRead implements Segment {
this
.
componentName
=
componentName
;
}
public
void
setError
(
boolean
error
)
{
public
void
setError
(
String
error
)
{
isError
=
error
;
}
...
...
@@ -318,7 +318,7 @@ public class SegmentForRead implements Segment {
return
componentName
;
}
@Override
public
boolean
error
()
{
@Override
public
String
error
()
{
return
isError
;
}
...
...
test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
浏览文件 @
bcaa8be0
...
...
@@ -41,7 +41,7 @@ public interface Span {
String
componentName
();
boolean
error
();
String
error
();
String
spanType
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录