Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
f48e11c9
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,发现更多精彩内容 >>
提交
f48e11c9
编写于
10月 28, 2019
作者:
wu-sheng
提交者:
kezhenxu94
10月 28, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Refactor:extract common module postgresql-common (#3725)" (#3728)
This reverts commit
d9fcda13
.
上级
a4078194
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
62 addition
and
414 deletion
+62
-414
apm-sniffer/apm-sdk-plugin/pom.xml
apm-sniffer/apm-sdk-plugin/pom.xml
+0
-1
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/pom.xml
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/pom.xml
+8
-6
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/CreateCallableStatementInterceptor.java
...n/jdbc/postgresql/CreateCallableStatementInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/CreatePreparedStatementInterceptor.java
...n/jdbc/postgresql/CreatePreparedStatementInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/CreateStatementInterceptor.java
...pm/plugin/jdbc/postgresql/CreateStatementInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/JDBCPrepareStatementWithStringArrayInterceptor.java
...resql/JDBCPrepareStatementWithStringArrayInterceptor.java
+2
-2
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/PreparedStatementExecuteMethodsInterceptor.java
...ostgresql/PreparedStatementExecuteMethodsInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/StatementExecuteMethodsInterceptor.java
...n/jdbc/postgresql/StatementExecuteMethodsInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/Variables.java
...ache/skywalking/apm/plugin/jdbc/postgresql/Variables.java
+5
-9
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/AbstractJdbc2StatementInstrumentation.java
...tgresql/define/AbstractJdbc2StatementInstrumentation.java
+4
-3
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/ConnectionInstrumentation.java
...gin/jdbc/postgresql/define/ConnectionInstrumentation.java
+1
-2
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/Constants.java
...ywalking/apm/plugin/jdbc/postgresql/define/Constants.java
+31
-0
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/Jdbc3ConnectionInstrumentation.java
...dbc/postgresql/define/Jdbc3ConnectionInstrumentation.java
+0
-1
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/Jdbc4ConnectionInstrumentation.java
...dbc/postgresql/define/Jdbc4ConnectionInstrumentation.java
+0
-1
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/PgCallableStatementInstrumentation.java
...postgresql/define/PgCallableStatementInstrumentation.java
+2
-2
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/PgPreparedStatementInstrumentation.java
...postgresql/define/PgPreparedStatementInstrumentation.java
+2
-2
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/PgStatementInstrumentation.java
...in/jdbc/postgresql/define/PgStatementInstrumentation.java
+2
-2
apm-sniffer/apm-sdk-plugin/postgresql-common/pom.xml
apm-sniffer/apm-sdk-plugin/postgresql-common/pom.xml
+0
-53
apm-sniffer/apm-sdk-plugin/postgresql-common/src/test/java/CreateCallableStatementInterceptorTest.java
...src/test/java/CreateCallableStatementInterceptorTest.java
+0
-64
apm-sniffer/apm-sdk-plugin/postgresql-common/src/test/java/CreatePreparedStatementInterceptorTest.java
...src/test/java/CreatePreparedStatementInterceptorTest.java
+0
-60
apm-sniffer/apm-sdk-plugin/postgresql-common/src/test/java/PreparedStatementExecuteMethodsInterceptorTest.java
.../java/PreparedStatementExecuteMethodsInterceptorTest.java
+0
-102
apm-sniffer/apm-sdk-plugin/postgresql-common/src/test/java/StatementExecuteMethodsInterceptorTest.java
...src/test/java/StatementExecuteMethodsInterceptorTest.java
+0
-99
未找到文件。
apm-sniffer/apm-sdk-plugin/pom.xml
浏览文件 @
f48e11c9
...
...
@@ -54,7 +54,6 @@
<module>
mysql-common
</module>
<module>
h2-1.x-plugin
</module>
<module>
postgresql-8.x-plugin
</module>
<module>
postgresql-common
</module>
<module>
rocketMQ-3.x-plugin
</module>
<module>
rocketMQ-4.x-plugin
</module>
<module>
elastic-job-2.x-plugin
</module>
...
...
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/pom.xml
浏览文件 @
f48e11c9
...
...
@@ -48,11 +48,13 @@
<version>
${project.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
apm-postgresql-commons
</artifactId>
<version>
${project.version}
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>
maven-deploy-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
apm-sniffer/apm-sdk-plugin/postgresql-
common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/interceptor
/CreateCallableStatementInterceptor.java
→
apm-sniffer/apm-sdk-plugin/postgresql-
8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql
/CreateCallableStatementInterceptor.java
浏览文件 @
f48e11c9
...
...
@@ -17,7 +17,7 @@
*/
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
.interceptor
;
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
;
import
java.lang.reflect.Method
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
...
...
apm-sniffer/apm-sdk-plugin/postgresql-
common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/interceptor
/CreatePreparedStatementInterceptor.java
→
apm-sniffer/apm-sdk-plugin/postgresql-
8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql
/CreatePreparedStatementInterceptor.java
浏览文件 @
f48e11c9
...
...
@@ -17,7 +17,7 @@
*/
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
.interceptor
;
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
;
import
java.lang.reflect.Method
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
...
...
apm-sniffer/apm-sdk-plugin/postgresql-
common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/interceptor
/CreateStatementInterceptor.java
→
apm-sniffer/apm-sdk-plugin/postgresql-
8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql
/CreateStatementInterceptor.java
浏览文件 @
f48e11c9
...
...
@@ -17,7 +17,7 @@
*/
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
.interceptor
;
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
;
import
java.lang.reflect.Method
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
...
...
apm-sniffer/apm-sdk-plugin/postgresql-
common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/interceptor
/JDBCPrepareStatementWithStringArrayInterceptor.java
→
apm-sniffer/apm-sdk-plugin/postgresql-
8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql
/JDBCPrepareStatementWithStringArrayInterceptor.java
浏览文件 @
f48e11c9
...
...
@@ -17,16 +17,16 @@
*/
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
.interceptor
;
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
;
import
java.lang.reflect.Method
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.plugin.jdbc.trace.SWPreparedStatement
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo
;
import
org.apache.skywalking.apm.plugin.jdbc.trace.SWPreparedStatement
;
/**
* {@link JDBCPrepareStatementWithStringArrayInterceptor} return {@link SWPreparedStatement} instance that wrapper the
...
...
apm-sniffer/apm-sdk-plugin/postgresql-
common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/interceptor
/PreparedStatementExecuteMethodsInterceptor.java
→
apm-sniffer/apm-sdk-plugin/postgresql-
8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql
/PreparedStatementExecuteMethodsInterceptor.java
浏览文件 @
f48e11c9
...
...
@@ -17,7 +17,7 @@
*/
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
.interceptor
;
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
;
import
java.lang.reflect.Method
;
import
org.apache.skywalking.apm.agent.core.conf.Config
;
...
...
apm-sniffer/apm-sdk-plugin/postgresql-
common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/interceptor
/StatementExecuteMethodsInterceptor.java
→
apm-sniffer/apm-sdk-plugin/postgresql-
8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql
/StatementExecuteMethodsInterceptor.java
浏览文件 @
f48e11c9
...
...
@@ -16,7 +16,7 @@
*
*/
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
.interceptor
;
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
;
import
java.lang.reflect.Method
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
...
...
apm-sniffer/apm-sdk-plugin/postgresql-
common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/Constant
s.java
→
apm-sniffer/apm-sdk-plugin/postgresql-
8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/Variable
s.java
100644 → 100755
浏览文件 @
f48e11c9
...
...
@@ -15,15 +15,11 @@
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.plugin.jdbc.postgresql
;
/**
* @author aderm
*/
public
class
Constants
{
public
static
final
String
CREATE_STATEMENT_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.interceptor.CreateStatementInterceptor"
;
public
static
final
String
CREATE_PREPARED_STATEMENT_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.interceptor.CreatePreparedStatementInterceptor"
;
public
static
final
String
CREATE_CALLABLE_STATEMENT_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.interceptor.CreateCallableStatementInterceptor"
;
public
static
final
String
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.interceptor.PreparedStatementExecuteMethodsInterceptor"
;
public
static
final
String
PG_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.interceptor.StatementExecuteMethodsInterceptor"
;
public
final
class
Variables
{
public
static
final
String
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.PreparedStatementExecuteMethodsInterceptor"
;
public
static
final
String
PG_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.StatementExecuteMethodsInterceptor"
;
}
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/AbstractJdbc2StatementInstrumentation.java
浏览文件 @
f48e11c9
...
...
@@ -24,11 +24,12 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.Constants
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
jdbc
.
postgresql
.
Variables
.
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
jdbc
.
postgresql
.
Variables
.
PG_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
public
class
AbstractJdbc2StatementInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
...
...
@@ -48,7 +49,7 @@ public class AbstractJdbc2StatementInstrumentation extends ClassInstanceMethodsE
}
@Override
public
String
getMethodsInterceptor
()
{
return
Constants
.
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
return
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
}
@Override
public
boolean
isOverrideArgs
()
{
...
...
@@ -63,7 +64,7 @@ public class AbstractJdbc2StatementInstrumentation extends ClassInstanceMethodsE
}
@Override
public
String
getMethodsInterceptor
()
{
return
Constants
.
PG_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
return
PG_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
}
@Override
public
boolean
isOverrideArgs
()
{
...
...
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/ConnectionInstrumentation.java
浏览文件 @
f48e11c9
...
...
@@ -25,7 +25,6 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.Constants
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
...
...
@@ -49,7 +48,7 @@ import static org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMa
*/
public
class
ConnectionInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
PREPARE_STATEMENT_METHOD_WITH_STRING_ARRAY_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.
interceptor.
JDBCPrepareStatementWithStringArrayInterceptor"
;
private
static
final
String
PREPARE_STATEMENT_METHOD_WITH_STRING_ARRAY_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.JDBCPrepareStatementWithStringArrayInterceptor"
;
public
static
final
String
PG_CONNECTION_ENHANCE_CLASS
=
"org.postgresql.jdbc.PgConnection"
;
public
static
final
String
STRING_ARRAY_ARGUMENT_TYPE
=
"java.lang.String[]"
;
public
static
final
String
PG_JDBC42_CONNECTION_ENHANCE_CLASS
=
"org.postgresql.jdbc42.Jdbc42Connection"
;
...
...
apm-sniffer/apm-sdk-plugin/postgresql-
common/src/test/java/CreateStatementInterceptorTest
.java
→
apm-sniffer/apm-sdk-plugin/postgresql-
8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/Constants
.java
100644 → 100755
浏览文件 @
f48e11c9
...
...
@@ -16,46 +16,16 @@
*
*/
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
powermock
.
api
.
mockito
.
PowerMockito
.
when
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.interceptor.CreateStatementInterceptor
;
import
org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.mockito.Matchers
;
import
org.mockito.Mock
;
import
org.mockito.runners.MockitoJUnitRunner
;
package
org.apache.skywalking.apm.plugin.jdbc.postgresql.define
;
/**
* @author aderm
* Interceptor class name constant variable
*
* @author zhangxin
*/
@RunWith
(
MockitoJUnitRunner
.
class
)
public
class
CreateStatementInterceptorTest
{
private
CreateStatementInterceptor
interceptor
;
@Mock
private
EnhancedInstance
ret
;
@Mock
private
EnhancedInstance
objectInstance
;
@Mock
private
ConnectionInfo
connectionInfo
;
@Before
public
void
setUp
()
{
interceptor
=
new
CreateStatementInterceptor
();
when
(
objectInstance
.
getSkyWalkingDynamicField
()).
thenReturn
(
connectionInfo
);
}
@Test
public
void
testResultIsEnhanceInstance
()
throws
Throwable
{
interceptor
.
afterMethod
(
objectInstance
,
null
,
new
Object
[]
{
"SELECT * FROM test"
},
null
,
ret
);
verify
(
ret
).
setSkyWalkingDynamicField
(
Matchers
.
any
());
}
public
class
Constants
{
public
static
final
String
CREATE_STATEMENT_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.CreateStatementInterceptor"
;
public
static
final
String
CREATE_PREPARED_STATEMENT_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.CreatePreparedStatementInterceptor"
;
public
static
final
String
CREATE_CALLABLE_STATEMENT_INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.jdbc.postgresql.CreateCallableStatementInterceptor"
;
}
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/Jdbc3ConnectionInstrumentation.java
浏览文件 @
f48e11c9
...
...
@@ -26,7 +26,6 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsIn
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.Constants
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
...
...
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/Jdbc4ConnectionInstrumentation.java
浏览文件 @
f48e11c9
...
...
@@ -25,7 +25,6 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.Constants
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
...
...
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/PgCallableStatementInstrumentation.java
浏览文件 @
f48e11c9
...
...
@@ -24,11 +24,11 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.Constants
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
bytebuddy
.
ArgumentTypeNameMatch
.
takesArgumentWithType
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
jdbc
.
postgresql
.
Variables
.
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
public
class
PgCallableStatementInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
...
...
@@ -44,7 +44,7 @@ public class PgCallableStatementInstrumentation extends ClassInstanceMethodsEnha
}
@Override
public
String
getMethodsInterceptor
()
{
return
Constants
.
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
return
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
}
@Override
public
boolean
isOverrideArgs
()
{
...
...
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/PgPreparedStatementInstrumentation.java
浏览文件 @
f48e11c9
...
...
@@ -24,11 +24,11 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.Constants
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
bytebuddy
.
ArgumentTypeNameMatch
.
takesArgumentWithType
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
jdbc
.
postgresql
.
Variables
.
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
/**
* @author zhang xin
...
...
@@ -49,7 +49,7 @@ public class PgPreparedStatementInstrumentation extends ClassInstanceMethodsEnha
}
@Override
public
String
getMethodsInterceptor
()
{
return
Constants
.
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
return
PG_PREPARED_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
}
@Override
public
boolean
isOverrideArgs
()
{
...
...
apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/define/PgStatementInstrumentation.java
浏览文件 @
f48e11c9
...
...
@@ -24,11 +24,11 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.Constants
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
bytebuddy
.
ArgumentTypeNameMatch
.
takesArgumentWithType
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
jdbc
.
postgresql
.
Variables
.
PG_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
/**
* @author zhang xin
...
...
@@ -52,7 +52,7 @@ public class PgStatementInstrumentation extends ClassInstanceMethodsEnhancePlugi
}
@Override
public
String
getMethodsInterceptor
()
{
return
Constants
.
PG_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
return
PG_STATEMENT_EXECUTE_METHOD_INTERCEPTOR
;
}
@Override
public
boolean
isOverrideArgs
()
{
...
...
apm-sniffer/apm-sdk-plugin/postgresql-common/pom.xml
已删除
100755 → 0
浏览文件 @
a4078194
<!--
~ 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"
>
<parent>
<artifactId>
apm-sdk-plugin
</artifactId>
<groupId>
org.apache.skywalking
</groupId>
<version>
6.5.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apm-postgresql-commons
</artifactId>
<packaging>
jar
</packaging>
<name>
apm-postgresql-commons
</name>
<url>
http://maven.apache.org
</url>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<postgresql.version>
42.0.0
</postgresql.version>
<guava.version>
20.0
</guava.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
<version>
${postgresql.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
apm-jdbc-commons
</artifactId>
<version>
${project.version}
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
</project>
apm-sniffer/apm-sdk-plugin/postgresql-common/src/test/java/CreateCallableStatementInterceptorTest.java
已删除
100644 → 0
浏览文件 @
a4078194
/*
* 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.
*
*/
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.interceptor.CreateCallableStatementInterceptor
;
import
org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.mockito.Matchers
;
import
org.mockito.Mock
;
import
org.mockito.runners.MockitoJUnitRunner
;
/**
* @author aderm
*/
@RunWith
(
MockitoJUnitRunner
.
class
)
public
class
CreateCallableStatementInterceptorTest
{
private
CreateCallableStatementInterceptor
interceptor
;
@Mock
private
EnhancedInstance
objectInstance
;
@Mock
private
EnhancedInstance
ret
;
@Mock
private
ConnectionInfo
connectionInfo
;
@Before
public
void
setUp
()
{
interceptor
=
new
CreateCallableStatementInterceptor
();
when
(
objectInstance
.
getSkyWalkingDynamicField
()).
thenReturn
(
connectionInfo
);
}
@Test
public
void
testResultIsEnhanceInstance
()
throws
Throwable
{
interceptor
.
afterMethod
(
objectInstance
,
null
,
new
Object
[]
{
"SELECT * FORM test"
},
null
,
ret
);
verify
(
ret
).
setSkyWalkingDynamicField
(
Matchers
.
any
());
}
}
apm-sniffer/apm-sdk-plugin/postgresql-common/src/test/java/CreatePreparedStatementInterceptorTest.java
已删除
100644 → 0
浏览文件 @
a4078194
/*
* 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.
*
*/
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.interceptor.CreatePreparedStatementInterceptor
;
import
org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.mockito.Matchers
;
import
org.mockito.Mock
;
import
org.mockito.runners.MockitoJUnitRunner
;
/**
* @author aderm
*/
@RunWith
(
MockitoJUnitRunner
.
class
)
public
class
CreatePreparedStatementInterceptorTest
{
private
CreatePreparedStatementInterceptor
interceptor
;
@Mock
private
EnhancedInstance
ret
;
@Mock
private
EnhancedInstance
objectInstance
;
@Mock
private
ConnectionInfo
connectionInfo
;
@Before
public
void
setUp
()
{
interceptor
=
new
CreatePreparedStatementInterceptor
();
when
(
objectInstance
.
getSkyWalkingDynamicField
()).
thenReturn
(
connectionInfo
);
}
@Test
public
void
testResultEnhanceInstance
()
throws
Throwable
{
interceptor
.
afterMethod
(
objectInstance
,
null
,
new
Object
[]{
"SELECT * FROM test"
},
null
,
ret
);
verify
(
ret
).
setSkyWalkingDynamicField
(
Matchers
.
any
());
}
}
apm-sniffer/apm-sdk-plugin/postgresql-common/src/test/java/PreparedStatementExecuteMethodsInterceptorTest.java
已删除
100644 → 0
浏览文件 @
a4078194
/*
* 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.
*
*/
import
static
org
.
hamcrest
.
CoreMatchers
.
is
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
java.lang.reflect.Method
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractTracingSpan
;
import
org.apache.skywalking.apm.agent.core.context.trace.SpanLayer
;
import
org.apache.skywalking.apm.agent.core.context.trace.TraceSegment
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.test.helper.SegmentHelper
;
import
org.apache.skywalking.apm.agent.test.tools.AgentServiceRule
;
import
org.apache.skywalking.apm.agent.test.tools.SegmentStorage
;
import
org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint
;
import
org.apache.skywalking.apm.agent.test.tools.SpanAssert
;
import
org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
org.apache.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.interceptor.PreparedStatementExecuteMethodsInterceptor
;
import
org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.mockito.Mock
;
import
org.powermock.modules.junit4.PowerMockRunner
;
import
org.powermock.modules.junit4.PowerMockRunnerDelegate
;
/**
* @author aderm
*/
@RunWith
(
PowerMockRunner
.
class
)
@PowerMockRunnerDelegate
(
TracingSegmentRunner
.
class
)
public
class
PreparedStatementExecuteMethodsInterceptorTest
{
@SegmentStoragePoint
private
SegmentStorage
segmentStorage
;
@Rule
public
AgentServiceRule
serviceRule
=
new
AgentServiceRule
();
private
PreparedStatementExecuteMethodsInterceptor
interceptor
;
@Mock
private
ConnectionInfo
connectionInfo
;
@Mock
private
EnhancedInstance
objectInstance
;
@Mock
private
Method
method
;
private
StatementEnhanceInfos
statementEnhanceInfos
;
@Before
public
void
setUp
()
{
interceptor
=
new
PreparedStatementExecuteMethodsInterceptor
();
statementEnhanceInfos
=
new
StatementEnhanceInfos
(
connectionInfo
,
"SELECT * FROM test WHERE item1=? and item2=?"
,
"CallableStatement"
);
statementEnhanceInfos
.
setParameter
(
1
,
"abc"
);
statementEnhanceInfos
.
setParameter
(
2
,
"def"
);
when
(
objectInstance
.
getSkyWalkingDynamicField
()).
thenReturn
(
statementEnhanceInfos
);
when
(
method
.
getName
()).
thenReturn
(
"executeQuery"
);
when
(
connectionInfo
.
getComponent
()).
thenReturn
(
ComponentsDefine
.
POSTGRESQL_DRIVER
);
when
(
connectionInfo
.
getDBType
()).
thenReturn
(
"POSTGRESQL"
);
when
(
connectionInfo
.
getDatabaseName
()).
thenReturn
(
"test"
);
when
(
connectionInfo
.
getDatabasePeer
()).
thenReturn
(
"localhost:5432"
);
}
@Test
public
void
testCreateDatabaseSpan
()
throws
Throwable
{
interceptor
.
beforeMethod
(
objectInstance
,
method
,
new
Object
[]{
"WHERE item1=? and item2=?"
},
null
,
null
);
interceptor
.
afterMethod
(
objectInstance
,
method
,
new
Object
[]{
"WHERE item1=? and item2=?"
},
null
,
null
);
assertThat
(
segmentStorage
.
getTraceSegments
().
size
(),
is
(
1
));
TraceSegment
segment
=
segmentStorage
.
getTraceSegments
().
get
(
0
);
assertThat
(
SegmentHelper
.
getSpans
(
segment
).
size
(),
is
(
1
));
AbstractTracingSpan
span
=
SegmentHelper
.
getSpans
(
segment
).
get
(
0
);
SpanAssert
.
assertLayer
(
span
,
SpanLayer
.
DB
);
assertThat
(
span
.
getOperationName
(),
is
(
"POSTGRESQL/JDBI/CallableStatement/"
));
SpanAssert
.
assertTag
(
span
,
0
,
"sql"
);
SpanAssert
.
assertTag
(
span
,
1
,
"test"
);
SpanAssert
.
assertTag
(
span
,
2
,
"SELECT * FROM test WHERE item1=? and item2=?"
);
}
}
apm-sniffer/apm-sdk-plugin/postgresql-common/src/test/java/StatementExecuteMethodsInterceptorTest.java
已删除
100644 → 0
浏览文件 @
a4078194
/*
* 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.
*
*/
import
static
org
.
hamcrest
.
CoreMatchers
.
is
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
java.lang.reflect.Method
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractTracingSpan
;
import
org.apache.skywalking.apm.agent.core.context.trace.SpanLayer
;
import
org.apache.skywalking.apm.agent.core.context.trace.TraceSegment
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.test.helper.SegmentHelper
;
import
org.apache.skywalking.apm.agent.test.tools.AgentServiceRule
;
import
org.apache.skywalking.apm.agent.test.tools.SegmentStorage
;
import
org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint
;
import
org.apache.skywalking.apm.agent.test.tools.SpanAssert
;
import
org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
org.apache.skywalking.apm.plugin.jdbc.define.StatementEnhanceInfos
;
import
org.apache.skywalking.apm.plugin.jdbc.postgresql.interceptor.StatementExecuteMethodsInterceptor
;
import
org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.mockito.Mock
;
import
org.powermock.modules.junit4.PowerMockRunner
;
import
org.powermock.modules.junit4.PowerMockRunnerDelegate
;
/**
* @author aderm
*/
@RunWith
(
PowerMockRunner
.
class
)
@PowerMockRunnerDelegate
(
TracingSegmentRunner
.
class
)
public
class
StatementExecuteMethodsInterceptorTest
{
@SegmentStoragePoint
private
SegmentStorage
segmentStorage
;
@Rule
public
AgentServiceRule
serviceRule
=
new
AgentServiceRule
();
private
StatementExecuteMethodsInterceptor
interceptor
;
@Mock
private
ConnectionInfo
connectionInfo
;
@Mock
private
EnhancedInstance
objectInstance
;
@Mock
private
Method
method
;
private
StatementEnhanceInfos
statementEnhanceInfos
;
@Before
public
void
setUp
()
{
interceptor
=
new
StatementExecuteMethodsInterceptor
();
statementEnhanceInfos
=
new
StatementEnhanceInfos
(
connectionInfo
,
"SELECT * FROM test"
,
"CallableStatement"
);
when
(
objectInstance
.
getSkyWalkingDynamicField
()).
thenReturn
(
statementEnhanceInfos
);
when
(
method
.
getName
()).
thenReturn
(
"executeQuery"
);
when
(
connectionInfo
.
getComponent
()).
thenReturn
(
ComponentsDefine
.
POSTGRESQL_DRIVER
);
when
(
connectionInfo
.
getDBType
()).
thenReturn
(
"POSTGRESQL"
);
when
(
connectionInfo
.
getDatabaseName
()).
thenReturn
(
"test"
);
when
(
connectionInfo
.
getDatabasePeer
()).
thenReturn
(
"localhost:5432"
);
}
@Test
public
void
testCreateDatabaseSpan
()
throws
Throwable
{
interceptor
.
beforeMethod
(
objectInstance
,
method
,
new
Object
[]{
"SELECT * FROM test"
},
null
,
null
);
interceptor
.
afterMethod
(
objectInstance
,
method
,
new
Object
[]{
"SELECT * FROM test"
},
null
,
null
);
assertThat
(
segmentStorage
.
getTraceSegments
().
size
(),
is
(
1
));
TraceSegment
segment
=
segmentStorage
.
getTraceSegments
().
get
(
0
);
assertThat
(
SegmentHelper
.
getSpans
(
segment
).
size
(),
is
(
1
));
AbstractTracingSpan
span
=
SegmentHelper
.
getSpans
(
segment
).
get
(
0
);
SpanAssert
.
assertLayer
(
span
,
SpanLayer
.
DB
);
assertThat
(
span
.
getOperationName
(),
is
(
"POSTGRESQL/JDBI/CallableStatement/"
));
SpanAssert
.
assertTag
(
span
,
0
,
"sql"
);
SpanAssert
.
assertTag
(
span
,
1
,
"test"
);
SpanAssert
.
assertTag
(
span
,
2
,
"SELECT * FROM test"
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录