Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
2e2616d0
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 搜索 >>
提交
2e2616d0
编写于
10月 27, 2019
作者:
Z
zhangwei
提交者:
wu-sheng
10月 27, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test/plugin] spring async scenario optimize (#3723)
* optimize * fix license header
上级
f471293c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
98 addition
and
17 deletion
+98
-17
test/plugin/scenarios/spring-async-scenario/config/expectedData.yaml
.../scenarios/spring-async-scenario/config/expectedData.yaml
+42
-15
test/plugin/scenarios/spring-async-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/async/AsyncBean.java
...pache/skywalking/apm/testcase/spring/async/AsyncBean.java
+2
-2
test/plugin/scenarios/spring-async-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/async/AsyncServlet.java
...he/skywalking/apm/testcase/spring/async/AsyncServlet.java
+45
-0
test/plugin/scenarios/spring-async-scenario/src/main/webapp/WEB-INF/web.xml
...ios/spring-async-scenario/src/main/webapp/WEB-INF/web.xml
+9
-0
未找到文件。
test/plugin/scenarios/spring-async-scenario/config/expectedData.yaml
浏览文件 @
2e2616d0
...
...
@@ -13,22 +13,22 @@
# 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
:
-
{
spring-async-scenario
:
2
}
instances
:
-
{
spring-async-scenario
:
1
}
operationNames
:
-
spring-async-scenario
:
[
/spring-async-scenario/case/healthCheck
,
/spring-async-scenario/case/spring-async
,
/zh/team/
]
-
spring-async-scenario
:
[
/spring-async-scenario/case/asyncVisit
,
/spring-async-scenario/case/spring-async
]
heartbeat
:
[]
segmentItems
:
-
applicationCode
:
spring-async-scenario
segmentSize
:
g
e
4
segmentSize
:
g
t
5
segments
:
-
segmentId
:
not
null
spans
:
-
operationName
:
/spring-async-scenario/case/
healthCheck
-
operationName
:
/spring-async-scenario/case/
spring-async
operationId
:
0
parentSpanId
:
-1
spanId
:
0
...
...
@@ -42,11 +42,11 @@ segmentItems:
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-async-scenario/case/
healthCheck
'
}
-
{
key
:
http.method
,
value
:
HEAD
}
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-async-scenario/case/
spring-async
'
}
-
{
key
:
http.method
,
value
:
GET
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/spring-async-scenario/case/
spring-async
-
operationName
:
/spring-async-scenario/case/
asyncVisit
operationId
:
0
parentSpanId
:
-1
spanId
:
0
...
...
@@ -60,11 +60,39 @@ segmentItems:
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-async-scenario/case/
spring-async
'
}
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-async-scenario/case/
asyncVisit
'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
SpringAsync
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
localhost:8080'
,
entryEndpoint
:
/spring-async-scenario/case/spring-async
,
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/zh/team/
-
operationName
:
/spring-async-scenario/case/asyncVisit
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
1
componentName
:
'
'
isError
:
false
spanType
:
Entry
peer
:
'
'
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/spring-async-scenario/case/asyncVisit'
}
-
{
key
:
http.method
,
value
:
GET
}
refs
:
-
{
parentEndpointId
:
0
,
parentEndpoint
:
SpringAsync
,
networkAddressId
:
0
,
entryEndpointId
:
0
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
localhost:8080'
,
entryEndpoint
:
/spring-async-scenario/case/spring-async
,
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/spring-async-scenario/case/asyncVisit
operationId
:
0
parentSpanId
:
0
spanId
:
1
...
...
@@ -75,10 +103,10 @@ segmentItems:
componentName
:
'
'
isError
:
false
spanType
:
Exit
peer
:
skywalking.apache.org:
80
peer
:
localhost:80
80
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://
skywalking.apache.org/zh/team/?k1=v
'
}
-
{
key
:
url
,
value
:
'
http://
localhost:8080/spring-async-scenario/case/asyncVisit?by=system
'
}
-
{
key
:
http.method
,
value
:
GET
}
-
operationName
:
SpringAsync
operationId
:
0
...
...
@@ -101,7 +129,7 @@ segmentItems:
entryServiceInstanceId
:
1
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/
zh/team/
-
operationName
:
/
spring-async-scenario/case/asyncVisit
operationId
:
0
parentSpanId
:
0
spanId
:
1
...
...
@@ -112,10 +140,10 @@ segmentItems:
componentName
:
'
'
isError
:
false
spanType
:
Exit
peer
:
skywalking.apache.org:
80
peer
:
localhost:80
80
peerId
:
0
tags
:
-
{
key
:
url
,
value
:
'
http://
skywalking.apache.org/zh/team/?k2=v
'
}
-
{
key
:
url
,
value
:
'
http://
localhost:8080/spring-async-scenario/case/asyncVisit?by=customize
'
}
-
{
key
:
http.method
,
value
:
GET
}
-
operationName
:
SpringAsync
operationId
:
0
...
...
@@ -136,4 +164,3 @@ segmentItems:
parentTraceSegmentId
:
not null
,
parentServiceInstanceId
:
1
,
networkAddress
:
'
'
,
entryEndpoint
:
/spring-async-scenario/case/spring-async
,
entryServiceInstanceId
:
1
}
test/plugin/scenarios/spring-async-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/async/AsyncBean.java
浏览文件 @
2e2616d0
...
...
@@ -34,11 +34,11 @@ public class AsyncBean {
@Async
public
void
sendVisitBySystem
()
throws
IOException
{
httpBean
.
visit
(
"http://
skywalking.apache.org/zh/team/?k1=v
"
);
httpBean
.
visit
(
"http://
localhost:8080/spring-async-scenario/case/asyncVisit?by=system
"
);
}
@Async
(
"customizeAsync"
)
public
void
sendVisitByCustomize
()
throws
IOException
{
httpBean
.
visit
(
"http://
skywalking.apache.org/zh/team/?k2=v
"
);
httpBean
.
visit
(
"http://
localhost:8080/spring-async-scenario/case/asyncVisit?by=customize
"
);
}
}
test/plugin/scenarios/spring-async-scenario/src/main/java/org/apache/skywalking/apm/testcase/spring/async/AsyncServlet.java
0 → 100644
浏览文件 @
2e2616d0
/*
* 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.testcase.spring.async
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServlet
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
/**
* @author zhangwei
*/
public
class
AsyncServlet
extends
HttpServlet
{
private
static
final
long
serialVersionUID
=
4644954650555106445L
;
@Override
protected
void
doGet
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
PrintWriter
writer
=
resp
.
getWriter
();
writer
.
write
(
"Success"
);
writer
.
flush
();
}
@Override
protected
void
doPost
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
this
.
doGet
(
req
,
resp
);
}
}
test/plugin/scenarios/spring-async-scenario/src/main/webapp/WEB-INF/web.xml
浏览文件 @
2e2616d0
...
...
@@ -39,4 +39,13 @@
<servlet-name>
healthCheck
</servlet-name>
<url-pattern>
/case/healthCheck
</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>
asyncVisit
</servlet-name>
<servlet-class>
org.apache.skywalking.apm.testcase.spring.async.AsyncServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
asyncVisit
</servlet-name>
<url-pattern>
/case/asyncVisit
</url-pattern>
</servlet-mapping>
</web-app>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录