Skip to content
Merged

Dev #49

Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions scouter.agent.java/src/scouter/agent/Configure.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public final static synchronized Configure getInstance() {
public int heap_perm_warning_pct = 90;
public long heap_perm_alert_interval = 30000;

public boolean enable_spring_request_mapping = true;
public boolean hook_spring_request_mapping = false;
public boolean debug_sql_call = false;

public int socket_open_fullstack_port = 0;
Expand Down Expand Up @@ -546,7 +546,7 @@ private void apply() {
this.heap_perm_alert_interval = getLong("heap_perm_alert_interval", 30000);
this.heap_perm_warning_pct = getInt("heap_perm_warning_pct", 90);

this.enable_spring_request_mapping = getBoolean("enable_spring_request_mapping", true);
this.hook_spring_request_mapping = getBoolean("hook_spring_request_mapping", false);

this.alert_message_length = getInt("alert_message_length", 3000);
this.alert_send_interval = getInt("alert_send_interval", 3000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public boolean isTarget(String className) {
Configure conf = Configure.getInstance();

public ClassVisitor transform(ClassVisitor cv, String className, ClassDesc classDesc) {
if (conf.enable_spring_request_mapping == false)
if (conf.hook_spring_request_mapping == false)
return cv;

if (classDesc.anotation != null) {
Expand Down
Binary file modified scouter.client/splash.bmp
Binary file not shown.
2 changes: 1 addition & 1 deletion scouter.deploy/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<property name="deploy-dir" value="./out/package"/>
<property name="outpack-dir" value="./out"/>

<property name="VERSION" value="0.3.11"/>
<property name="VERSION" value="0.3.12"/>


<target name="packing">
Expand Down
24 changes: 13 additions & 11 deletions scouter.server/src/scouter/server/db/TextPermWR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ object TextPermWR {

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

val common = new IntSet();
common.add(HashUtil.hash(TextTypes.METHOD));
common.add(HashUtil.hash(TextTypes.GROUP));
common.add(HashUtil.hash(TextTypes.CITY));
//move to perm db
common.add(HashUtil.hash(TextTypes.LOGIN));
common.add(HashUtil.hash(TextTypes.DESC));
common.add(HashUtil.hash(TextTypes.GROUP));
common.add(HashUtil.hash(TextTypes.USER_AGENT));

// val common = new IntSet();
// common.add(HashUtil.hash(TextTypes.METHOD));
// common.add(HashUtil.hash(TextTypes.GROUP));
// common.add(HashUtil.hash(TextTypes.CITY));
// //move to perm db
// common.add(HashUtil.hash(TextTypes.LOGIN));
// common.add(HashUtil.hash(TextTypes.DESC));
// common.add(HashUtil.hash(TextTypes.GROUP));
// common.add(HashUtil.hash(TextTypes.USER_AGENT));

//에러만 날짜별로 저장한다.-20151110
val errorHash = HashUtil.hash(TextTypes.ERROR);
def isA(divs: Int): Boolean = {
return common.contains(divs);
return divs != errorHash;
}

ThreadScala.start("scouter.server.db.TextPermWR") {
Expand Down
3 changes: 2 additions & 1 deletion scouter.server/src/scouter/server/plugin/PlugInLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ private IPlugIn create(File file, String className, Class superClass, Class para
method = CtNewMethod.make("public void " + methodName + "(" + parameter + " p){}", impl);
impl.addMethod(method);
}
method.setBody("{" + parameter + " $p=$1;" + body + "}");

method.setBody("{" + parameter + " $pack=$1;" + body + "}");
c = impl.toClass(new URLClassLoader(new URL[0], this.getClass().getClassLoader()), null);

IPlugIn plugin = (IPlugIn) c.newInstance();
Expand Down
32 changes: 17 additions & 15 deletions scouter.server/src/scouter/server/plugin/alert/AlertRuleLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public synchronized static AlertRuleLoader getInstance() {
if (instance == null) {
instance = new AlertRuleLoader();
instance.setDaemon(true);
instance.setName("FxAlertRuleLoader");
instance.setName("AlertRuleLoader");
instance.start();
}
return instance;
Expand Down Expand Up @@ -125,6 +125,7 @@ private void checkModified(File root) {
if (conf.lastModified != ruleConf.lastModified()) {
conf = createConf(name, ruleConf);
alertConfTable.put(name, conf);

}
}
}
Expand All @@ -144,20 +145,22 @@ private File getConfFile(String f) {
return null;
}

//각 룰에 대한 기본 설정을 로딩한다.
// 각 룰에 대한 기본 설정을 로딩한다.
// 각 설정은 스크립트에서 변경할 수 있다.
private AlertConf createConf(String name, File confFile) {
AlertConf conf = new AlertConf();
if (confFile != null) {
if (confFile != null && confFile.canRead()) {
conf.lastModified = confFile.lastModified();
byte[] body = FileUtil.readAll(confFile);
Properties p = new Properties();
try {
p.load(new ByteArrayInputStream(body));
} catch (IOException e) {
if (body != null) {
Properties p = new Properties();
try {
p.load(new ByteArrayInputStream(body));
} catch (Exception e) {
}
conf.history_size = getInt(p, "history_size", 0);
conf.silent_time = getInt(p, "silent_time", 0);
}
conf.history_size = getInt(p, "history_size", 0);
conf.silent_time = getInt(p, "silent_time", 0);
}
return conf;
}
Expand All @@ -182,19 +185,18 @@ private AlertRule createRule(String name, File ruleFile) {
Class c = null;
CtClass cc = cp.get(AlertRule.class.getName());
CtClass impl = null;
CtMethod method = null;
try {
impl = cp.get(name);
impl.defrost();
CtMethod method = impl.getMethod("process", "(" + nativeName(RealCounter.class) + ")V");
method.setBody("{" + RealCounter.class.getName() + " $c=$1;" + body + "}");
c = impl.toClass(new URLClassLoader(new URL[0], this.getClass().getClassLoader()), null);
method = impl.getMethod("process", "(" + nativeName(RealCounter.class) + ")V");
} catch (javassist.NotFoundException e) {
impl = cp.makeClass(name, cc);
CtMethod method = CtNewMethod.make("public void process(" + RealCounter.class.getName() + " c){}", impl);
method = CtNewMethod.make("public void process(" + RealCounter.class.getName() + " c){}", impl);
impl.addMethod(method);
method.setBody("{" + RealCounter.class.getName() + " $c=$1;" + body + "}");
c = impl.toClass(new URLClassLoader(new URL[0], this.getClass().getClassLoader()), null);
}
method.setBody("{" + RealCounter.class.getName() + " $counter=$1;" + body + "}");
c = impl.toClass(new URLClassLoader(new URL[0], this.getClass().getClassLoader()), null);

AlertRule rule = (AlertRule) c.newInstance();
rule.lastModified = ruleFile.lastModified();
Expand Down