Skip to content

Commit bcc8aec

Browse files
committed
pinpoint-apm#2396 add commons dbcp2 plugin
add commons-dbcp2 plugin
1 parent 2d33b55 commit bcc8aec

File tree

27 files changed

+511
-0
lines changed

27 files changed

+511
-0
lines changed

‎agent/src/main/resources-local/pinpoint.config‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,13 @@ profiler.jdbc.cubrid.rollback=true
288288
profiler.jdbc.dbcp=true
289289
profiler.jdbc.dbcp.connectionclose=true
290290

291+
#
292+
# DBCP2
293+
#
294+
# Profile DBCP2.
295+
profiler.jdbc.dbcp2=true
296+
profiler.jdbc.dbcp2.connectionclose=true
297+
291298
#
292299
# CASSANDRA
293300
#

‎agent/src/main/resources-release/pinpoint.config‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,13 @@ profiler.jdbc.cubrid.rollback=true
283283
profiler.jdbc.dbcp=true
284284
profiler.jdbc.dbcp.connectionclose=true
285285

286+
#
287+
# DBCP2
288+
#
289+
# Profile DBCP2.
290+
profiler.jdbc.dbcp2=true
291+
profiler.jdbc.dbcp2.connectionclose=true
292+
286293
#
287294
# CASSANDRA
288295
#

‎agent/src/main/resources/pinpoint-real-env-lowoverhead-sample.config‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,13 @@ profiler.jdbc.cubrid.rollback=false
261261
profiler.jdbc.dbcp=true
262262
profiler.jdbc.dbcp.connectionclose=false
263263

264+
#
265+
# DBCP2
266+
#
267+
# Profile DBCP2.
268+
profiler.jdbc.dbcp2=true
269+
profiler.jdbc.dbcp2.connectionclose=true
270+
264271
#
265272
# CASSANDRA
266273
#

‎agent/src/test/resources/activemq/client/pinpoint-activemq-client.config‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,13 @@ profiler.jdbc.cubrid.rollback=true
261261
profiler.jdbc.dbcp=true
262262
profiler.jdbc.dbcp.connectionclose=true
263263

264+
#
265+
# DBCP2
266+
#
267+
# Profile DBCP2.
268+
profiler.jdbc.dbcp2=true
269+
profiler.jdbc.dbcp2.connectionclose=true
270+
264271
#
265272
# CASSANDRA
266273
#

‎agent/src/test/resources/pinpoint-disabled-plugin-test.config‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ profiler.jdbc.cubrid.rollback=true
195195
profiler.jdbc.dbcp=true
196196
profiler.jdbc.dbcp.connectionclose=true
197197

198+
#
199+
# DBCP2
200+
#
201+
profiler.jdbc.dbcp2=true
202+
profiler.jdbc.dbcp2.connectionclose=true
198203

199204
###########################################################
200205
# Apache HTTP Client 4.x #

‎agent/src/test/resources/pinpoint-spring-bean-test.config‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ profiler.jdbc.cubrid.rollback=true
194194
profiler.jdbc.dbcp=true
195195
profiler.jdbc.dbcp.connectionclose=true
196196

197+
#
198+
# DBCP2
199+
#
200+
profiler.jdbc.dbcp2=true
201+
profiler.jdbc.dbcp2.connectionclose=true
197202

198203
###########################################################
199204
# Apache HTTP Client 4.x #

‎plugins/dbcp2/.gitignore‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/target/
2+
/.settings/
3+
/.classpath
4+
/.project
5+
/*.iml

‎plugins/dbcp2/clover.license‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
RMRqrdbgbKFhbaVnDxHUdDQvrOQXxIBklnvcmahheubVC
2+
mh2KM35CLkwUHS4DH7QVhxy52J5hnWbyEm6Cyd3KkF<mV
3+
RmmnSVOqOMnOnMMrmMqwXomoroNrqPNRrPSsWwtUxXuUU
4+
sRONqpnmqmUUnqonmstsmmmmmUUnqonmstsmmmmmUUGfk
5+
mlfkqUUnmmmm

‎plugins/dbcp2/pom.xml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
~ Copyright 2016 NAVER Corp.
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
<parent>
21+
<groupId>com.navercorp.pinpoint</groupId>
22+
<artifactId>pinpoint</artifactId>
23+
<relativePath>../..</relativePath>
24+
<version>1.6.1-SNAPSHOT</version>
25+
</parent>
26+
27+
<artifactId>pinpoint-commons-dbcp2-plugin</artifactId>
28+
<name>pinpoint-commons-dbcp2-plugin</name>
29+
<packaging>jar</packaging>
30+
31+
<dependencies>
32+
<dependency>
33+
<groupId>com.navercorp.pinpoint</groupId>
34+
<artifactId>pinpoint-bootstrap-core</artifactId>
35+
<scope>provided</scope>
36+
</dependency>
37+
</dependencies>
38+
</project>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright 2016 NAVER Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.navercorp.pinpoint.plugin.commons.dbcp2;
18+
19+
import com.navercorp.pinpoint.bootstrap.config.ProfilerConfig;
20+
21+
/**
22+
* @author Taejin Koo
23+
*/
24+
public class CommonsDbcp2Config {
25+
26+
static final String DBCP2_PLUGIN_ENABLE = "profiler.jdbc.dbcp2";
27+
static final String DBCP2_PROFILE_CONNECTIONCLOSE_ENABLE = "profiler.jdbc.dbcp2.connectionclose";
28+
29+
private final boolean pluginEnable;
30+
private final boolean profileClose;
31+
32+
public CommonsDbcp2Config(ProfilerConfig config) {
33+
pluginEnable = config.readBoolean(DBCP2_PLUGIN_ENABLE, false);
34+
profileClose = config.readBoolean(DBCP2_PROFILE_CONNECTIONCLOSE_ENABLE, false);
35+
}
36+
37+
public boolean isPluginEnable() {
38+
return pluginEnable;
39+
}
40+
41+
public boolean isProfileClose() {
42+
return profileClose;
43+
}
44+
45+
}

0 commit comments

Comments
 (0)