Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
699a76a
bug fix - top menu dynamic apply
bill23-kim Feb 5, 2016
c38115f
change line selecting way - current all
bill23-kim Feb 12, 2016
c177f31
change line selecting way
bill23-kim Feb 13, 2016
660d932
add time in tooltip
bill23-kim Feb 15, 2016
18af57a
change total value finding way
bill23-kim Feb 15, 2016
df21029
bug fix
bill23-kim Feb 18, 2016
5b8aa4a
bug fix - chart buffer size
bill23-kim Feb 18, 2016
988847b
refactoring - rename method - TraceContextManager.getLocalContext() …
gunlee01 Feb 21, 2016
01d012a
special menu definition xml -> code
bill23-kim Feb 23, 2016
c47fad6
bug fix - on parsing the hookingClassSet
gunlee01 Feb 23, 2016
98e7701
support mariadb connector/j 1.3.x
gunlee01 Feb 23, 2016
a38dad0
Merge pull request #113 from scouter-project/dev
gunlee01 Feb 23, 2016
58dea07
heap max/used chart
bill23-kim Feb 24, 2016
076574c
realtime cpu usage to avgerage10sec
bill23-kim Feb 24, 2016
6194d02
bug fix
bill23-kim Feb 24, 2016
1a7864d
build name
gunlee01 Feb 25, 2016
a0195ee
commit, push test
gunlee01 Feb 26, 2016
41a6e2f
add options for boot class bci
sjokim Feb 26, 2016
0b010b5
add log
bill23-kim Mar 3, 2016
b2cacb3
separate service group view to throughput/elapsed
bill23-kim Mar 3, 2016
d8deb88
counter plugin dup bug fix
gunlee01 Mar 4, 2016
60775a2
bug fix - updated object type incorrectly
bill23-kim Mar 4, 2016
95b2d43
documentation about live demo
gunlee01 Mar 5, 2016
ec1bc55
Merge pull request #117 from scouter-project/dev
gunlee01 Mar 5, 2016
50b53d8
minor version up
bill23-kim Mar 6, 2016
9da22dd
Merge pull request #118 from scouter-project/dev
bill23-kim Mar 6, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ SCOUTER can help you.
## Documents
- [Document Home](./scouter.document/index.md)
- [Quick Start Guide (Quick Installation and Demo)](./scouter.document/main/Quick-Start.md)
- [Live Demo(Try to use scouter by connecting on live demo system)](./scouter.document/main/Live-Demo.md)
- [Client Screen Help](./scouter.document/client/How-To-Use-Client.md)

## Download
Expand Down Expand Up @@ -67,12 +68,16 @@ Scouter has three modules:
- **SWT & GEF4** : Charts and Diagrams
<br>

## Facebook
- [Scouter APM : Facebook Scouter user group](https://www.facebook.com/groups/scouterapm/)

## How to contribute
- TBD


## Q&A
- [Google Groups](https://groups.google.com/forum/#!forum/scouter-project)

## Facebook
- [Facebook Scouter user group](https://www.facebook.com/groups/1525329794448529/)

## License
Licensed under the Apache License, Version 2.0
<br>
Expand Down
10 changes: 7 additions & 3 deletions README_kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ APM은 Application performance montoring 또는 application performance manageme
## Documents
- [Document Home](./scouter.document/index_kr.md)
- [Quick Start(Scouter Demo 설치)](./scouter.document/main/Quick-Start_kr.md)
- [Live Demo(제공되는 Demo 시스템 바로 접속해 보기)](./scouter.document/main/Live-Demo_kr.md)
- [Client 화면 설명](./scouter.document/client/How-To-Use-Client_kr.md)

## Download
Expand Down Expand Up @@ -62,12 +63,15 @@ APM은 Application performance montoring 또는 application performance manageme
- **SWT & GEF4** : Charts and Diagrams
<br>

## Facebook
- [Scouter APM 사용자 모임 - Facebook 그룹](https://www.facebook.com/groups/scouterapm/)

## Scouter에 기여하기
- TBD

## Q&A
- [Google Groups](https://groups.google.com/forum/#!forum/scouter-project)

## Facebook
- [Facebook Scouter user group](https://www.facebook.com/groups/1525329794448529/)

## License
Licensed under the Apache License, Version 2.0
<br>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* Licensed 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 scouter.agent.counter.meter;

import scouter.lang.ref.DOUBLE;
import scouter.lang.ref.INT;
import scouter.util.MeteringUtil;
import scouter.util.MeteringUtil.Handler;

public class MeterResource {

static class Bucket {
double value;
int count;
}
private MeteringUtil<Bucket> meter = new MeteringUtil<Bucket>() {
protected Bucket create() {
return new Bucket();
};

protected void clear(Bucket o) {
o.value=0;
o.count = 0;
}
};

public synchronized void add(double value) {
Bucket b = meter.getCurrentBucket();
b.value += value;
b.count++;
}

public double getAvg(int period) {
final INT count = new INT();
final DOUBLE sum = new DOUBLE();
meter.search(period, new Handler<MeterResource.Bucket>() {
public void process(Bucket u) {
sum.value += u.value;
count.value += u.count;
}
});
return count.value == 0 ? 0 : sum.value / count.value;
}

public double getSum(int period) {
final DOUBLE sum = new DOUBLE();
meter.search(period, new Handler<MeterResource.Bucket>() {
public void process(Bucket u) {
sum.value += u.value;
}
});
return sum.value;
}

}
17 changes: 15 additions & 2 deletions scouter.agent.host/src/scouter/agent/counter/task/HostPerf.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import scouter.agent.Logger;
import scouter.agent.counter.CounterBasket;
import scouter.agent.counter.anotation.Counter;
import scouter.agent.counter.meter.MeterResource;
import scouter.agent.netio.data.DataProxy;
import scouter.lang.AlertLevel;
import scouter.lang.TimeTypeEnum;
Expand All @@ -31,7 +32,11 @@ public class HostPerf {
static int SLEEP_TIME = 2000;
static Sigar sigarImpl = new Sigar();
static SigarProxy sigar = SigarProxyCache.newInstance(sigarImpl, SLEEP_TIME);


MeterResource cpuMeter = new MeterResource();
MeterResource sysCpuMeter = new MeterResource();
MeterResource userCpuMeter = new MeterResource();

@Counter
public void process(CounterBasket pw) {
try {
Expand All @@ -48,10 +53,18 @@ void domain(CounterBasket pw) throws SigarException {

CpuPerc cpuPerc = sigar.getCpuPerc();
float cpu = (float) ((1.0D - cpuPerc.getIdle()) * 100);
alertCpu(cpu);
cpuMeter.add(cpu);
float sysCpu = (float) cpuPerc.getSys() * 100;
sysCpuMeter.add(sysCpu);
float userCpu = (float) cpuPerc.getUser() * 100;
userCpuMeter.add(userCpu);

cpu = (float) cpuMeter.getAvg(10);
sysCpu = (float) sysCpuMeter.getAvg(10);
userCpu = (float) userCpuMeter.getAvg(10);

alertCpu(cpu);

Mem m = sigar.getMem();
alertMem(m);

Expand Down
10 changes: 4 additions & 6 deletions scouter.agent.java/src/scouter/AnyTrace.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
package scouter;

import scouter.agent.netio.data.DataProxy;
import scouter.agent.trace.AlertProxy;
import scouter.agent.trace.TraceApiCall;
import scouter.agent.trace.TraceContext;
import scouter.agent.trace.TraceContextManager;
import scouter.agent.trace.TraceMain;
import scouter.lang.pack.XLogTypes;
import scouter.util.HashUtil;
import scouter.util.KeyGen;

public class AnyTrace {
Expand All @@ -42,7 +40,7 @@ public static void setServiceName(String name) {
}

public static void serviceError(String emsg) {
TraceContext ctx = TraceContextManager.getLocalContext();
TraceContext ctx = TraceContextManager.getContext();
if (ctx != null && ctx.error != 0) { // already started
ctx.error = DataProxy.sendError(emsg);
}
Expand Down Expand Up @@ -70,7 +68,7 @@ public static Object startApicall(String name, long apiTxid) {

public static void setApicallName(String name) {
try {
TraceContext ctx = TraceContextManager.getLocalContext();
TraceContext ctx = TraceContextManager.getContext();
if (ctx != null) {
if (ctx.apicall_name != null) { // already started subcall only
ctx.apicall_name = name;
Expand All @@ -86,7 +84,7 @@ public static void endApicall(Object stat, Throwable thr) {

public static void desc(String desc) {
try {
TraceContext ctx = TraceContextManager.getLocalContext();
TraceContext ctx = TraceContextManager.getContext();
if (ctx != null) {
ctx.desc = desc;
}
Expand All @@ -96,7 +94,7 @@ public static void desc(String desc) {

public static void login(String login) {
try {
TraceContext ctx = TraceContextManager.getLocalContext();
TraceContext ctx = TraceContextManager.getContext();
if (ctx != null) {
ctx.login = login;
}
Expand Down
6 changes: 4 additions & 2 deletions scouter.agent.java/src/scouter/agent/AgentTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ public byte[] transform(ClassLoader loader, String className, Class classBeingRe
AsyncRunner.getInstance().add(loader, className, classfileBuffer);
return null;
}
if (loader == null) {
return null;
if (loader == null ) {
if(conf._hook_boot_prefix==null || conf._hook_boot_prefix.length()==0 || false == className.startsWith(conf._hook_boot_prefix)){
return null;
}
}
}
if (className.startsWith("scouter/")) {
Expand Down
3 changes: 3 additions & 0 deletions scouter.agent.java/src/scouter/agent/Configure.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
public class Configure extends Thread {
public static boolean JDBC_REDEFINED = false;
private static Configure instance = null;

public final static synchronized Configure getInstance() {
if (instance == null) {
instance = new Configure();
Expand Down Expand Up @@ -182,6 +183,7 @@ public final static synchronized Configure getInstance() {
public boolean _hook_usertx_enabled = true;
public String _hook_direct_patch_classes = "";
public boolean _hook_spring_rest_enabled = false;
public String _hook_boot_prefix=null;

//Control
public boolean control_reject_service_enabled = false;
Expand Down Expand Up @@ -443,6 +445,7 @@ private void apply() {
this.trace_db2_enabled = getBoolean("trace_db2_enabled", true);
this._hook_usertx_enabled = getBoolean("_hook_usertx_enabled", true);
this._hook_direct_patch_classes = getValue("_hook_direct_patch_classes", "");
this._hook_boot_prefix = getValue("_hook_boot_prefix");
this.counter_recentuser_valid_ms = getLong("counter_recentuser_valid_ms", DateUtil.MILLIS_PER_FIVE_MINUTE);
this.counter_object_registry_path = getValue("counter_object_registry_path", "/tmp/scouter");
this.sfa_dump_enabled = getBoolean("sfa_dump_enabled", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class JDBCPreparedStatementASM implements IASM, Opcodes {
public final HashSet<String> target = HookingSet.getHookingClassSet(Configure.getInstance().hook_jdbc_pstmt_classes);
public final HashSet<String> noField = new HashSet<String>();
public JDBCPreparedStatementASM() {
target.add("org.mariadb.jdbc.MariaDbClientPreparedStatement");
target.add("org/mariadb/jdbc/MySQLPreparedStatement");
target.add("oracle/jdbc/driver/OraclePreparedStatement");
target.add("org/postgresql/jdbc2/AbstractJdbc2Statement");
Expand All @@ -53,6 +54,7 @@ public JDBCPreparedStatementASM() {
target.add("cubrid/jdbc/driver/CUBRIDPreparedStatement");

// @skyworker - MySQL ServerPreparedStatement는 특별히 필드를 추가하지 않음
noField.add("org.mariadb.jdbc.MariaDbClientPreparedStatement");
noField.add("com/mysql/jdbc/ServerPreparedStatement");
noField.add("jdbc/FakePreparedStatement2");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
public class JDBCStatementASM implements IASM, Opcodes {
public final HashSet<String> target = HookingSet.getHookingClassSet(Configure.getInstance().hook_jdbc_stmt_classes);
public JDBCStatementASM() {

target.add("org.mariadb.jdbc.MariaDbStatement");
target.add("org/mariadb/jdbc/MySQLStatement");
target.add("oracle/jdbc/driver/OracleStatement");
target.add("com/mysql/jdbc/StatementImpl");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public static HashSet<String> getHookingClassSet(String arg) {
if(c ==null)
return classSet;
for (int i = 0; i < c.length; i++) {
classSet.add(c[i]);
classSet.add(c[i].replace('.', '/').trim());
}
return classSet;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ public Pack activeThreadList(Pack param) {
ListValue ip = rPack.newList("ip");
ListValue sql = rPack.newList("sql");
ListValue subcall = rPack.newList("subcall");
ListValue login = rPack.newList("login");
ListValue desc = rPack.newList("desc");
Enumeration<TraceContext> en = TraceContextManager.getContextEnumeration();
while (en.hasMoreElements()) {
TraceContext ctx = en.nextElement();
Expand All @@ -154,6 +156,8 @@ public Pack activeThreadList(Pack param) {
Logger.println("A128", th);
cpu.add(0L);
}
login.add(ctx.login);
desc.add(ctx.desc);
}
rPack.put("complete", new BooleanValue(true));
return rPack;
Expand Down
2 changes: 1 addition & 1 deletion scouter.agent.java/src/scouter/agent/plugin/WrContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void profile(String msg) {

/**
* add xlog profile
* profile diplay like --> msg #value elapsed
* profile display like --> msg #value elapsed
* @param msg message
* @param value any value to display on a profile.
* @param elapsed any value to display on a profile.
Expand Down
10 changes: 5 additions & 5 deletions scouter.agent.java/src/scouter/agent/trace/TraceApiCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ public Stat(TraceContext ctx) {
}
}
public static void apiInfo(String className, String methodName, String methodDesc, Object _this, Object[] arg) {
TraceContext ctx = TraceContextManager.getLocalContext();
TraceContext ctx = TraceContextManager.getContext();
if (ctx != null && arg.length >= 2) {
ctx.apicall_target = arg[0] + ":" + arg[1];
}
}
public static Object startApicall(String className, String methodName, String methodDesc, Object _this, Object[] arg) {
try {
TraceContext ctx = TraceContextManager.getLocalContext();
TraceContext ctx = TraceContextManager.getContext();
if (ctx == null) {
return null;
}
Expand All @@ -85,7 +85,7 @@ public static Object startApicall(String className, String methodName, String me
return null;
}
public static Object startApicall(String name, long apiTxid) {
TraceContext ctx = TraceContextManager.getLocalContext();
TraceContext ctx = TraceContextManager.getContext();
if (ctx == null)
return null;
if (ctx.apicall_name != null) {
Expand Down Expand Up @@ -153,7 +153,7 @@ public static void endApicall(Object stat, Object returnValue, Throwable thr) {
public static Object startSocket(Socket socket, SocketAddress addr, int timeout) {
if (!(addr instanceof InetSocketAddress))
return null;
TraceContext ctx = TraceContextManager.getLocalContext();
TraceContext ctx = TraceContextManager.getContext();
if (ctx == null) {
if (Configure.getInstance().trace_background_socket_enabled) {
InetSocketAddress inet = (InetSocketAddress) addr;
Expand Down Expand Up @@ -211,7 +211,7 @@ public static void endSocket(Object stat, Throwable thr) {
}
}
public static void open(File file) {
TraceContext ctx = TraceContextManager.getLocalContext();
TraceContext ctx = TraceContextManager.getContext();
if (ctx != null) {
MessageStep m = new MessageStep();
m.start_time = (int) (System.currentTimeMillis() - ctx.startTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

package scouter.agent.trace;

import java.util.Enumeration;

import scouter.agent.Configure;
import scouter.util.LongEnumer;
import scouter.util.LongKeyMap;

import java.util.Enumeration;

public class TraceContextManager {

private static LongKeyMap<TraceContext> entry = new LongKeyMap<TraceContext>();
Expand Down Expand Up @@ -66,7 +66,7 @@ public static TraceContext getContext(long key) {
return entry.get(key);
}

public static TraceContext getLocalContext() {
public static TraceContext getContext() {
return local.get();
}

Expand Down
Loading