Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
62060749
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
62060749
编写于
11月 07, 2019
作者:
Z
zhang-wei
提交者:
wu-sheng
11月 07, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test/plugin] merge undertow scenario (#3797)
* merge undertow scenario * update elapsed time
上级
2c481f9d
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
111 addition
and
448 deletion
+111
-448
Jenkinsfile-Agent-Test-3
Jenkinsfile-Agent-Test-3
+1
-7
Jenkinsfile-Agent-Test-4
Jenkinsfile-Agent-Test-4
+3
-3
docs/en/guides/Plugin-test.md
docs/en/guides/Plugin-test.md
+5
-7
test/plugin/run.sh
test/plugin/run.sh
+2
-2
test/plugin/scenarios/undertow-routing-scenario/bin/startup.sh
...plugin/scenarios/undertow-routing-scenario/bin/startup.sh
+0
-21
test/plugin/scenarios/undertow-routing-scenario/config/expectedData.yaml
...narios/undertow-routing-scenario/config/expectedData.yaml
+0
-106
test/plugin/scenarios/undertow-routing-scenario/configuration.yml
...gin/scenarios/undertow-routing-scenario/configuration.yml
+0
-21
test/plugin/scenarios/undertow-routing-scenario/pom.xml
test/plugin/scenarios/undertow-routing-scenario/pom.xml
+0
-114
test/plugin/scenarios/undertow-routing-scenario/src/main/assembly/assembly.xml
.../undertow-routing-scenario/src/main/assembly/assembly.xml
+0
-41
test/plugin/scenarios/undertow-routing-scenario/src/main/java/org/apache/skywalking/amp/testcase/undertow/Application.java
.../apache/skywalking/amp/testcase/undertow/Application.java
+0
-72
test/plugin/scenarios/undertow-routing-scenario/support-version.list
.../scenarios/undertow-routing-scenario/support-version.list
+0
-44
test/plugin/scenarios/undertow-scenario/config/expectedData.yaml
...ugin/scenarios/undertow-scenario/config/expectedData.yaml
+66
-6
test/plugin/scenarios/undertow-scenario/src/main/java/org/apache/skywalking/amp/testcase/undertow/Application.java
.../apache/skywalking/amp/testcase/undertow/Application.java
+34
-4
未找到文件。
Jenkinsfile-Agent-Test-3
浏览文件 @
62060749
...
...
@@ -67,7 +67,7 @@ pipeline {
sh './mvnw -f test/plugin/pom.xml clean package -DskipTests docker:build'
}
}
stage('Test Cases Report (1
35
)') {
stage('Test Cases Report (1
19
)') {
steps {
echo "Test Cases Report"
}
...
...
@@ -110,12 +110,6 @@ pipeline {
}
}
stage('kafka 0.11.0.0-2.3.0 (16)') {
steps {
sh 'bash test/plugin/run.sh kafka-scenario'
}
}
stage('mongodb 3.4.0-3.11.1 (17)') {
steps {
sh 'bash test/plugin/run.sh mongodb-3.x-scenario'
...
...
Jenkinsfile-Agent-Test-4
浏览文件 @
62060749
...
...
@@ -68,7 +68,7 @@ pipeline {
}
}
stage('Test Cases Report (1
42
)') {
stage('Test Cases Report (1
35
)') {
steps {
echo "Test Cases Report"
}
...
...
@@ -84,9 +84,9 @@ pipeline {
parallel {
stage('Group1') {
stages {
stage('
undertow-routing 1.3.0-2.0.27 (23
)') {
stage('
kafka 0.11.0.0-2.3.0 (16
)') {
steps {
sh 'bash test/plugin/run.sh
undertow-routing
-scenario'
sh 'bash test/plugin/run.sh
kafka
-scenario'
}
}
...
...
docs/en/guides/Plugin-test.md
浏览文件 @
62060749
...
...
@@ -642,21 +642,19 @@ postgresql 9.2.x-9.4.x | 36 | 1243.03
sofarpc 5.4.0-5.6.2 | 23 | 817.77
spring 3.0.x | 8 | 231.11
#### Group 2 (
3138.09
3s)
#### Group 2 (
2433.3
3s)
scenario name | versions | elapsed time (sec)
---|---|---
spring async 4.3.x-5.1.x | 35 | 967.70
kafka 0.11.0.0-2.3.0 | 16 | 704.75
mongodb 3.4.0-3.11.1 | 17 | 1465.63
### Workload 4
#### Group 1 (1
688.243
s)
#### Group 1 (1
778.45
s)
scenario name | versions | elapsed time (sec)
---|---|---
undertow-routing 1.3.0-2.0.27 | 23 | 643.31
kafka 0.11.0.0-2.3.0 | 16 | 704.75
ehcache 2.8.x-2.10.x | 19 | 440.71
undertow 1.3.0-2.0.27 | 23 | 6
04.2
0
undertow 1.3.0-2.0.27 | 23 | 6
33.0
0
#### Group 2 (2148.155s)
scenario name | versions | elapsed time (sec)
...
...
@@ -665,4 +663,4 @@ spring-webflux 2.x | 18 | 705.60
spring 4.1.x-4.2.x | 20 | 574.75
solrj 7.x | 12 | 367.05
httpclient 4.3.x-4.5.x | 14 | 300.61
httpasyncclient 4.0-4.1.3 | 7 | 200.11
\ No newline at end of file
httpasyncclient 4.0-4.1.3 | 7 | 200.11
test/plugin/run.sh
浏览文件 @
62060749
...
...
@@ -143,9 +143,9 @@ test -z "$scenario_name" && exitWithMessage "Missing value for the scenario argu
if
[[
!
-d
${
agent_home
}
]]
;
then
echo
"[WARN] SkyWalking Agent not exists"
${
mvnw
}
-f
${
home
}
/../../pom.xml
-Pagent
-DskipTests
-DBUILD_NO
=
${
BUILD_NO
:
=local
}
clean package
${
mvnw
}
-f
${
home
}
/../../pom.xml
-Pagent
-DskipTests
clean package
fi
[[
"
$force_build
"
==
"on"
]]
&&
${
mvnw
}
-f
${
home
}
/pom.xml clean package
-DskipTests
docker:build
[[
"
$force_build
"
==
"on"
]]
&&
${
mvnw
}
-f
${
home
}
/pom.xml clean package
-DskipTests
-DBUILD_NO
=
${
BUILD_NO
:
=local
}
docker:build
workspace
=
"
${
home
}
/workspace/
${
scenario_name
}
"
task_state_house
=
"
${
workspace
}
/.states"
...
...
test/plugin/scenarios/undertow-routing-scenario/bin/startup.sh
已删除
100644 → 0
浏览文件 @
2c481f9d
#!/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/undertow-routing-scenario.jar &
\ No newline at end of file
test/plugin/scenarios/undertow-routing-scenario/config/expectedData.yaml
已删除
100644 → 0
浏览文件 @
2c481f9d
# 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
:
-
{
undertow-routing-scenario
:
2
}
instances
:
-
{
undertow-routing-scenario
:
1
}
operationNames
:
-
undertow-routing-scenario
:
[
/undertow-routing-scenario/case/undertow1
,
'
/undertow-routing-scenario/case/{context}'
]
heartbeat
:
[]
segmentItems
:
-
applicationCode
:
undertow-routing-scenario
segmentSize
:
gt
3
segments
:
-
segmentId
:
not
null
spans
:
-
operationName
:
/undertow-routing-scenario/case/{context}
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
49
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/undertow-routing-scenario/case/undertow'
}
-
{
key
:
http.method
,
value
:
GET
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/undertow-routing-scenario/case/{context}
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
49
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/undertow-routing-scenario/case/undertow1'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
UndertowDispatch
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
localhost:8080'
,
entryEndpoint
:
'
/undertow-routing-scenario/case/{context}'
,
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/undertow-routing-scenario/case/undertow1
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/undertow-routing-scenario/case/undertow1?send=httpHandler'
}
-
{
key
:
http.method
,
value
:
GET
}
-
operationName
:
UndertowDispatch
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Unknown
startTime
:
nq
0
endTime
:
nq
0
componentId
:
49
componentName
:
'
'
isError
:
false
spanType
:
Local
peer
:
'
'
peerId
:
0
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
'
/undertow-routing-scenario/case/{context}'
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossThread
,
parentSpanId
:
0
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
'
,
entryEndpoint
:
'
/undertow-routing-scenario/case/{context}'
,
entryServiceInstanceId
:
1
}
\ No newline at end of file
test/plugin/scenarios/undertow-routing-scenario/configuration.yml
已删除
100644 → 0
浏览文件 @
2c481f9d
# 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/undertow-routing-scenario/case/undertow
healthCheck
:
http://localhost:8080/undertow-routing-scenario/case/healthCheck
startScript
:
./bin/startup.sh
framework
:
undertow
\ No newline at end of file
test/plugin/scenarios/undertow-routing-scenario/pom.xml
已删除
100644 → 0
浏览文件 @
2c481f9d
<?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>
undertow-routing-scenario
</artifactId>
<packaging>
jar
</packaging>
<version>
5.0.0
</version>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<compiler.version>
1.8
</compiler.version>
<start-class>
org.apache.skywalking.amp.testcase.undertow.Application
</start-class>
<test.framework>
undertow
</test.framework>
<test.framework.version>
1.3.0.Final
</test.framework.version>
</properties>
<name>
skywalking-undertow-routing-scenario
</name>
<dependencies>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
javax.servlet-api
</artifactId>
<version>
3.1.0
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
io.undertow
</groupId>
<artifactId>
undertow-core
</artifactId>
<version>
${test.framework.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.3
</version>
</dependency>
</dependencies>
<build>
<finalName>
undertow-routing-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/undertow-routing-scenario/src/main/assembly/assembly.xml
已删除
100644 → 0
浏览文件 @
2c481f9d
<?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>
${project.build.directory}/undertow-routing-scenario.jar
</source>
<outputDirectory>
./libs
</outputDirectory>
<fileMode>
0775
</fileMode>
</file>
</files>
</assembly>
test/plugin/scenarios/undertow-routing-scenario/src/main/java/org/apache/skywalking/amp/testcase/undertow/Application.java
已删除
100644 → 0
浏览文件 @
2c481f9d
/*
* 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.amp.testcase.undertow
;
import
io.undertow.Undertow
;
import
io.undertow.server.HttpHandler
;
import
io.undertow.server.RoutingHandler
;
import
io.undertow.util.Headers
;
import
io.undertow.util.Methods
;
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
java.io.IOException
;
public
class
Application
{
private
static
final
String
TEMPLATE
=
"/undertow-routing-scenario/case/{context}"
;
private
static
final
String
CASE_URL
=
"/undertow-routing-scenario/case/undertow"
;
public
static
void
main
(
String
[]
args
)
{
HttpHandler
httpHandler
=
exchange
->
{
if
(
CASE_URL
.
equals
(
exchange
.
getRequestPath
()))
{
exchange
.
dispatch
(
httpServerExchange
->
visit
(
"http://localhost:8080/undertow-routing-scenario/case/undertow1?send=httpHandler"
));
}
exchange
.
getResponseHeaders
().
put
(
Headers
.
CONTENT_TYPE
,
"text/plain"
);
exchange
.
getResponseSender
().
send
(
"Success"
);
};
RoutingHandler
handler
=
new
RoutingHandler
();
handler
.
add
(
Methods
.
GET
,
TEMPLATE
,
httpHandler
);
handler
.
add
(
Methods
.
HEAD
,
TEMPLATE
,
httpHandler
);
Undertow
server
=
Undertow
.
builder
()
.
addHttpListener
(
8080
,
"0.0.0.0"
)
.
setHandler
(
handler
).
build
();
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
(
server:
:
stop
));
server
.
start
();
}
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/undertow-routing-scenario/support-version.list
已删除
100644 → 0
浏览文件 @
2c481f9d
# 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
# "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.
# undertow has a total of 90 versions from 1.3.0 to 2.0.27, in order to reduce the workload of agent-plugin-test,
# so, some test cases are excluded according to the following rules.
# 1.3.x 1.4.x: select the first, middle, and last version
# 2.0.x: when there are many releases in the same month, choose the last one
1.3.0.Final
1.3.17.Final
1.3.33.Final
1.4.0.Final
1.4.12.Final
1.4.27.Final
2.0.0.Final
2.0.3.Final
2.0.4.Final
2.0.8.Final
2.0.9.Final
2.0.11.Final
2.0.13.Final
2.0.15.Final
2.0.16.Final
2.0.17.Final
2.0.19.Final
2.0.20.Final
2.0.21.Final
2.0.22.Final
2.0.23.Final
2.0.26.Final
2.0.27.Final
\ No newline at end of file
test/plugin/scenarios/undertow-scenario/config/expectedData.yaml
浏览文件 @
62060749
...
...
@@ -20,11 +20,12 @@ registryItems:
instances
:
-
{
undertow-scenario
:
1
}
operationNames
:
-
undertow-scenario
:
[
/undertow-scenario/case/undertow1
,
/undertow-scenario/case/undertow
]
-
undertow-scenario
:
[
/undertow-scenario/case/undertow1
,
/undertow-scenario/case/undertow
,
/undertow-routing-scenario/case/undertow
,
'
/undertow-routing-scenario/case/{context}'
]
heartbeat
:
[]
segmentItems
:
-
applicationCode
:
undertow-scenario
segmentSize
:
gt
3
segmentSize
:
gt
5
segments
:
-
segmentId
:
not
null
spans
:
...
...
@@ -44,6 +45,29 @@ segmentItems:
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/undertow-scenario/case/undertow'
}
-
{
key
:
http.method
,
value
:
GET
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/undertow-routing-scenario/case/{context}
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
49
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8081/undertow-routing-scenario/case/undertow'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
UndertowDispatch
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
localhost:8081'
,
entryEndpoint
:
/undertow-scenario/case/undertow
,
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/undertow-scenario/case/undertow1
...
...
@@ -69,7 +93,7 @@ segmentItems:
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/undertow-
scenario/case/undertow1
-
operationName
:
/undertow-
routing-scenario/case/undertow
operationId
:
0
parentSpanId
:
0
spanId
:
1
...
...
@@ -80,10 +104,10 @@ segmentItems:
componentName
:
'
'
isError
:
false
spanType
:
Exit
peer
:
localhost:808
0
peer
:
localhost:808
1
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:808
0/undertow-scenario/case/undertow1?send=runnable
'
}
-
{
key
:
url
,
value
:
'
http://localhost:808
1/undertow-routing-scenario/case/undertow?send=httpHandler
'
}
-
{
key
:
http.method
,
value
:
GET
}
-
operationName
:
UndertowDispatch
operationId
:
0
...
...
@@ -102,4 +126,40 @@ segmentItems:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
/undertow-scenario/case/undertow
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossThread
,
parentSpanId
:
0
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
'
,
entryEndpoint
:
/undertow-scenario/case/undertow
,
entryServiceInstanceId
:
1
}
\ No newline at end of file
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/undertow-scenario/case/undertow1
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/undertow-scenario/case/undertow1?send=runnable'
}
-
{
key
:
http.method
,
value
:
GET
}
-
operationName
:
UndertowDispatch
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Unknown
startTime
:
nq
0
endTime
:
nq
0
componentId
:
49
componentName
:
'
'
isError
:
false
spanType
:
Local
peer
:
'
'
peerId
:
0
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
'
/undertow-routing-scenario/case/{context}'
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossThread
,
parentSpanId
:
0
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
'
,
entryEndpoint
:
/undertow-scenario/case/undertow
,
entryServiceInstanceId
:
1
}
test/plugin/scenarios/undertow-scenario/src/main/java/org/apache/skywalking/amp/testcase/undertow/Application.java
浏览文件 @
62060749
...
...
@@ -19,7 +19,10 @@
package
org.apache.skywalking.amp.testcase.undertow
;
import
io.undertow.Undertow
;
import
io.undertow.server.HttpHandler
;
import
io.undertow.server.RoutingHandler
;
import
io.undertow.util.Headers
;
import
io.undertow.util.Methods
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.client.ResponseHandler
;
import
org.apache.http.client.methods.HttpGet
;
...
...
@@ -33,14 +36,23 @@ public class Application {
private
static
final
String
CASE_URL
=
"/undertow-scenario/case/undertow"
;
private
static
final
String
TEMPLATE
=
"/undertow-routing-scenario/case/{context}"
;
private
static
final
String
ROUTING_CASE_URL
=
"/undertow-routing-scenario/case/undertow"
;
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
new
Thread
(
Application:
:
undertowRouting
).
start
();
undertow
();
}
private
static
void
undertow
()
{
Undertow
server
=
Undertow
.
builder
()
.
addHttpListener
(
8080
,
"0.0.0.0"
)
.
setHandler
(
exchange
->
{
if
(
CASE_URL
.
equals
(
exchange
.
getRequestPath
()))
{
exchange
.
dispatch
(()
->
{
try
{
visit
(
"http://localhost:808
0/undertow-scenario/case/undertow1?send=runnable
"
);
visit
(
"http://localhost:808
1/undertow-routing-scenario/case/undertow?send=httpHandler
"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -53,17 +65,35 @@ public class Application {
server
.
start
();
}
private
static
void
undertowRouting
()
{
HttpHandler
httpHandler
=
exchange
->
{
if
(
ROUTING_CASE_URL
.
equals
(
exchange
.
getRequestPath
()))
{
exchange
.
dispatch
(
httpServerExchange
->
visit
(
"http://localhost:8080/undertow-scenario/case/undertow1?send=runnable"
));
}
exchange
.
getResponseHeaders
().
put
(
Headers
.
CONTENT_TYPE
,
"text/plain"
);
exchange
.
getResponseSender
().
send
(
"Success"
);
};
RoutingHandler
handler
=
new
RoutingHandler
();
handler
.
add
(
Methods
.
GET
,
TEMPLATE
,
httpHandler
);
handler
.
add
(
Methods
.
HEAD
,
TEMPLATE
,
httpHandler
);
Undertow
server
=
Undertow
.
builder
()
.
addHttpListener
(
8081
,
"0.0.0.0"
)
.
setHandler
(
handler
).
build
();
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
(
server:
:
stop
));
server
.
start
();
}
private
static
void
visit
(
String
url
)
throws
IOException
{
CloseableHttpClient
http
c
lient
=
HttpClients
.
createDefault
();
CloseableHttpClient
http
C
lient
=
HttpClients
.
createDefault
();
try
{
HttpGet
httpget
=
new
HttpGet
(
url
);
ResponseHandler
<
String
>
responseHandler
=
response
->
{
HttpEntity
entity
=
response
.
getEntity
();
return
entity
!=
null
?
EntityUtils
.
toString
(
entity
)
:
null
;
};
http
c
lient
.
execute
(
httpget
,
responseHandler
);
http
C
lient
.
execute
(
httpget
,
responseHandler
);
}
finally
{
http
c
lient
.
close
();
http
C
lient
.
close
();
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录