Skip to content

Commit d584bf2

Browse files
committed
Merge branch 'develop'
2 parents c8aef28 + 64997ec commit d584bf2

File tree

223 files changed

+14136
-413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+14136
-413
lines changed

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.github.scouter-project</groupId>
66
<artifactId>scouter-parent</artifactId>
7-
<version>1.7.3.2</version>
7+
<version>1.7.4.SNAPSHOT</version>
88
<packaging>pom</packaging>
99

1010
<name>SCOUTER APM</name>
@@ -15,6 +15,7 @@
1515

1616
<modules>
1717
<module>scouter.common</module>
18+
<module>scouter.webapp</module>
1819
<module>scouter.server.boot</module>
1920
<module>scouter.server</module>
2021
<module>scouter.agent.host</module>
@@ -27,10 +28,15 @@
2728
<scouter.agent.java.assembly.name>scouter-java-agent-assembly</scouter.agent.java.assembly.name>
2829
<scouter.agent.batch.assembly.name>scouter-batch-agent-assembly</scouter.agent.batch.assembly.name>
2930
<scouter.server.assembly.name>scouter-server-assembly</scouter.server.assembly.name>
31+
<scouter.webapp.assembly.name>scouter-webapp-assembly</scouter.webapp.assembly.name>
3032

3133
<scouter.whole.packaging.prepare.dir>${project.basedir}/../target/whole-pack-working</scouter.whole.packaging.prepare.dir>
3234
<scouter.product.name>scouter-all-${project.version}</scouter.product.name>
3335

36+
<jetty.version>9.4.6.v20170531</jetty.version>
37+
<jersey.version>2.25.1</jersey.version>
38+
<slf4j.version>1.7.25</slf4j.version>
39+
<logback.version>1.2.3</logback.version>
3440
</properties>
3541

3642
<repositories>

scouter.agent.batch/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.github.scouter-project</groupId>
77
<artifactId>scouter-parent</artifactId>
8-
<version>1.7.3.2</version>
8+
<version>1.7.4.SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>scouter-agent-batch</artifactId>

scouter.agent.host/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.github.scouter-project</groupId>
66
<artifactId>scouter-parent</artifactId>
7-
<version>1.7.3.2</version>
7+
<version>1.7.4.SNAPSHOT</version>
88
</parent>
99

1010
<artifactId>scouter-agent-host</artifactId>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[counter]
2+
//public void counter(scouter.lang.pack.PerfCounterPack $pack)

scouter.agent.java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.github.scouter-project</groupId>
66
<artifactId>scouter-parent</artifactId>
7-
<version>1.7.3.2</version>
7+
<version>1.7.4.SNAPSHOT</version>
88
</parent>
99

1010
<artifactId>scouter-agent-java</artifactId>

scouter.agent.java/src/main/java/scouter/agent/asm/JDBCStatementASM.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
import scouter.agent.Configure;
2424
import scouter.agent.Logger;
2525
import scouter.agent.asm.jdbc.PsUpdateCountMV;
26+
import scouter.agent.asm.jdbc.PsCloseMV;
2627
import scouter.agent.asm.jdbc.StExecuteMV;
28+
import scouter.agent.asm.jdbc.StInitMV;
2729
import scouter.agent.asm.util.HookingSet;
2830

2931
import java.util.HashSet;
@@ -78,12 +80,18 @@ public void visit(int version, int access, String name, String signature, String
7880
@Override
7981
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
8082
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
83+
if ("<init>".equals(name)) {
84+
return new StInitMV(access, desc, mv);
85+
}
86+
8187
if (StExecuteMV.isTarget(name)) {
8288
if (desc.startsWith("(Ljava/lang/String;)")) {
8389
return new StExecuteMV(access, desc, mv, owner, name);
8490
}
8591
} else if ("getUpdateCount".equals(name) && "()I".equals(desc)) {
8692
return new PsUpdateCountMV(mv);
93+
} else if ("close".equals(name) && "()V".equals(desc)) {
94+
return new PsCloseMV(mv);
8795
}
8896
return mv;
8997
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2015 Scouter Project.
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 scouter.agent.asm.jdbc;
18+
19+
import scouter.agent.trace.TraceSQL;
20+
import scouter.org.objectweb.asm.MethodVisitor;
21+
import scouter.org.objectweb.asm.Opcodes;
22+
import scouter.org.objectweb.asm.commons.LocalVariablesSorter;
23+
24+
public class StInitMV extends LocalVariablesSorter implements Opcodes {
25+
26+
private final static String TRACESQL = TraceSQL.class.getName().replace('.', '/');
27+
private final static String METHOD_INIT = "stmtInit";
28+
private final static String SIGNATURE_INIT = "(Ljava/lang/Object;)V";
29+
30+
public StInitMV(int access, String desc, MethodVisitor mv) {
31+
super(ASM5,access, desc, mv);
32+
}
33+
34+
@Override
35+
public void visitInsn(int opcode) {
36+
if (opcode >= IRETURN && opcode <= RETURN) {
37+
mv.visitVarInsn(ALOAD, 0);
38+
mv.visitMethodInsn(Opcodes.INVOKESTATIC, TRACESQL, METHOD_INIT, SIGNATURE_INIT, false);
39+
}
40+
mv.visitInsn(opcode);
41+
}
42+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package scouter.agent.counter.task;
2+
3+
import scouter.agent.counter.CounterBasket;
4+
import scouter.agent.counter.anotation.Counter;
5+
import scouter.agent.plugin.PluginCounter;
6+
7+
public class PluginTask {
8+
9+
@Counter
10+
public void pluginCounter(CounterBasket pw) {
11+
PluginCounter.counter(pw);
12+
}
13+
}

scouter.agent.java/src/main/java/scouter/agent/netio/request/handle/AgentThread.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,22 @@ public Pack threadDetail(Pack param) {
5151
if(thread != 0L) {
5252
p = ThreadUtil.getThreadDetail(thread);
5353
ctx = TraceContextManager.getContext(thread);
54+
55+
if (ctx != null) {
56+
p.put("Service Txid", new TextValue(Hexa32.toString32(ctx.txid)));
57+
p.put("Service Name", new TextValue(AgentCommonConstant.removeSpringRequestMappingPostfixFlag(ctx.serviceName)));
58+
long etime = System.currentTimeMillis() - ctx.startTime;
59+
p.put("Service Elapsed", new DecimalValue(etime));
60+
String sql = ctx.sqltext;
61+
if (sql != null) {
62+
p.put("SQL", sql);
63+
}
64+
String subcall = ctx.apicall_name;
65+
if (subcall != null) {
66+
p.put("Subcall", subcall);
67+
}
68+
}
69+
5470
} else {
5571
p = new MapPack();
5672
ctx = TraceContextManager.getDeferredContext(txid);
@@ -64,6 +80,7 @@ public Pack threadDetail(Pack param) {
6480
p.put("Service Name", new TextValue(AgentCommonConstant.removeSpringRequestMappingPostfixFlag(ctx.serviceName)));
6581
long etime = System.currentTimeMillis() - ctx.startTime;
6682
p.put("Service Elapsed", new DecimalValue(etime));
83+
6784
} else {
6885
p.put("Thread Name", new TextValue("[No Thread] End"));
6986
p.put("State", new TextValue("end"));
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package scouter.agent.plugin;
2+
3+
import scouter.lang.pack.PerfCounterPack;
4+
5+
abstract public class AbstractCounter extends AbstractPlugin {
6+
7+
abstract public void counter(PerfCounterPack pack);
8+
9+
}

0 commit comments

Comments
 (0)