Skip to content

Commit aa18d63

Browse files
committed
Merge pull request #49 from scouter-project/dev
Dev
2 parents 1a3a6d2 + b727e78 commit aa18d63

File tree

7 files changed

+36
-31
lines changed

7 files changed

+36
-31
lines changed

scouter.agent.java/src/scouter/agent/Configure.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public final static synchronized Configure getInstance() {
258258
public int heap_perm_warning_pct = 90;
259259
public long heap_perm_alert_interval = 30000;
260260

261-
public boolean enable_spring_request_mapping = true;
261+
public boolean hook_spring_request_mapping = false;
262262
public boolean debug_sql_call = false;
263263

264264
public int socket_open_fullstack_port = 0;
@@ -546,7 +546,7 @@ private void apply() {
546546
this.heap_perm_alert_interval = getLong("heap_perm_alert_interval", 30000);
547547
this.heap_perm_warning_pct = getInt("heap_perm_warning_pct", 90);
548548

549-
this.enable_spring_request_mapping = getBoolean("enable_spring_request_mapping", true);
549+
this.hook_spring_request_mapping = getBoolean("hook_spring_request_mapping", false);
550550

551551
this.alert_message_length = getInt("alert_message_length", 3000);
552552
this.alert_send_interval = getInt("alert_send_interval", 3000);

scouter.agent.java/src/scouter/agent/asm/SpringReqMapASM.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public boolean isTarget(String className) {
4242
Configure conf = Configure.getInstance();
4343

4444
public ClassVisitor transform(ClassVisitor cv, String className, ClassDesc classDesc) {
45-
if (conf.enable_spring_request_mapping == false)
45+
if (conf.hook_spring_request_mapping == false)
4646
return cv;
4747

4848
if (classDesc.anotation != null) {

scouter.client/splash.bmp

122 KB
Binary file not shown.

scouter.deploy/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<property name="deploy-dir" value="./out/package"/>
55
<property name="outpack-dir" value="./out"/>
66

7-
<property name="VERSION" value="0.3.11"/>
7+
<property name="VERSION" value="0.3.12"/>
88

99

1010
<target name="packing">

scouter.server/src/scouter/server/db/TextPermWR.scala

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,20 @@ object TextPermWR {
4141

4242
val queue = new RequestQueue[Data](DBCtr.LARGE_MAX_QUE_SIZE);
4343

44-
val common = new IntSet();
45-
common.add(HashUtil.hash(TextTypes.METHOD));
46-
common.add(HashUtil.hash(TextTypes.GROUP));
47-
common.add(HashUtil.hash(TextTypes.CITY));
48-
//move to perm db
49-
common.add(HashUtil.hash(TextTypes.LOGIN));
50-
common.add(HashUtil.hash(TextTypes.DESC));
51-
common.add(HashUtil.hash(TextTypes.GROUP));
52-
common.add(HashUtil.hash(TextTypes.USER_AGENT));
53-
44+
// val common = new IntSet();
45+
// common.add(HashUtil.hash(TextTypes.METHOD));
46+
// common.add(HashUtil.hash(TextTypes.GROUP));
47+
// common.add(HashUtil.hash(TextTypes.CITY));
48+
// //move to perm db
49+
// common.add(HashUtil.hash(TextTypes.LOGIN));
50+
// common.add(HashUtil.hash(TextTypes.DESC));
51+
// common.add(HashUtil.hash(TextTypes.GROUP));
52+
// common.add(HashUtil.hash(TextTypes.USER_AGENT));
53+
54+
//에러만 날짜별로 저장한다.-20151110
55+
val errorHash = HashUtil.hash(TextTypes.ERROR);
5456
def isA(divs: Int): Boolean = {
55-
return common.contains(divs);
57+
return divs != errorHash;
5658
}
5759

5860
ThreadScala.start("scouter.server.db.TextPermWR") {

scouter.server/src/scouter/server/plugin/PlugInLoader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ private IPlugIn create(File file, String className, Class superClass, Class para
167167
method = CtNewMethod.make("public void " + methodName + "(" + parameter + " p){}", impl);
168168
impl.addMethod(method);
169169
}
170-
method.setBody("{" + parameter + " $p=$1;" + body + "}");
170+
171+
method.setBody("{" + parameter + " $pack=$1;" + body + "}");
171172
c = impl.toClass(new URLClassLoader(new URL[0], this.getClass().getClassLoader()), null);
172173

173174
IPlugIn plugin = (IPlugIn) c.newInstance();

scouter.server/src/scouter/server/plugin/alert/AlertRuleLoader.java

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public synchronized static AlertRuleLoader getInstance() {
4949
if (instance == null) {
5050
instance = new AlertRuleLoader();
5151
instance.setDaemon(true);
52-
instance.setName("FxAlertRuleLoader");
52+
instance.setName("AlertRuleLoader");
5353
instance.start();
5454
}
5555
return instance;
@@ -125,6 +125,7 @@ private void checkModified(File root) {
125125
if (conf.lastModified != ruleConf.lastModified()) {
126126
conf = createConf(name, ruleConf);
127127
alertConfTable.put(name, conf);
128+
128129
}
129130
}
130131
}
@@ -144,20 +145,22 @@ private File getConfFile(String f) {
144145
return null;
145146
}
146147

147-
//각 룰에 대한 기본 설정을 로딩한다.
148+
// 각 룰에 대한 기본 설정을 로딩한다.
148149
// 각 설정은 스크립트에서 변경할 수 있다.
149150
private AlertConf createConf(String name, File confFile) {
150151
AlertConf conf = new AlertConf();
151-
if (confFile != null) {
152+
if (confFile != null && confFile.canRead()) {
152153
conf.lastModified = confFile.lastModified();
153154
byte[] body = FileUtil.readAll(confFile);
154-
Properties p = new Properties();
155-
try {
156-
p.load(new ByteArrayInputStream(body));
157-
} catch (IOException e) {
155+
if (body != null) {
156+
Properties p = new Properties();
157+
try {
158+
p.load(new ByteArrayInputStream(body));
159+
} catch (Exception e) {
160+
}
161+
conf.history_size = getInt(p, "history_size", 0);
162+
conf.silent_time = getInt(p, "silent_time", 0);
158163
}
159-
conf.history_size = getInt(p, "history_size", 0);
160-
conf.silent_time = getInt(p, "silent_time", 0);
161164
}
162165
return conf;
163166
}
@@ -182,19 +185,18 @@ private AlertRule createRule(String name, File ruleFile) {
182185
Class c = null;
183186
CtClass cc = cp.get(AlertRule.class.getName());
184187
CtClass impl = null;
188+
CtMethod method = null;
185189
try {
186190
impl = cp.get(name);
187191
impl.defrost();
188-
CtMethod method = impl.getMethod("process", "(" + nativeName(RealCounter.class) + ")V");
189-
method.setBody("{" + RealCounter.class.getName() + " $c=$1;" + body + "}");
190-
c = impl.toClass(new URLClassLoader(new URL[0], this.getClass().getClassLoader()), null);
192+
method = impl.getMethod("process", "(" + nativeName(RealCounter.class) + ")V");
191193
} catch (javassist.NotFoundException e) {
192194
impl = cp.makeClass(name, cc);
193-
CtMethod method = CtNewMethod.make("public void process(" + RealCounter.class.getName() + " c){}", impl);
195+
method = CtNewMethod.make("public void process(" + RealCounter.class.getName() + " c){}", impl);
194196
impl.addMethod(method);
195-
method.setBody("{" + RealCounter.class.getName() + " $c=$1;" + body + "}");
196-
c = impl.toClass(new URLClassLoader(new URL[0], this.getClass().getClassLoader()), null);
197197
}
198+
method.setBody("{" + RealCounter.class.getName() + " $counter=$1;" + body + "}");
199+
c = impl.toClass(new URLClassLoader(new URL[0], this.getClass().getClassLoader()), null);
198200

199201
AlertRule rule = (AlertRule) c.newInstance();
200202
rule.lastModified = ruleFile.lastModified();

0 commit comments

Comments
 (0)