diff --git a/build_client.sh b/build_client.sh
index bd6357ee7..124e18d77 100755
--- a/build_client.sh
+++ b/build_client.sh
@@ -4,6 +4,11 @@
# download maven from :
# https://maven.apache.org
+if [ ! -z "${JAVA_11_HOME}" ]; then
+ echo JAVA_11_HOME: ${JAVA_11_HOME}
+ JAVA_HOME=${JAVA_11_HOME}
+fi
+
MVN="`which mvn`"
if [ ! -z "${MAVEN_HOME}" ]; then
echo MAVEN_HOME: ${MAVEN_HOME}
diff --git a/pom.xml b/pom.xml
index 474692dec..34cf0cf6d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
io.github.scouter-project
scouter-parent
- 2.10.2
+ 2.15.0
pom
SCOUTER APM
diff --git a/scouter.agent.batch/pom.xml b/scouter.agent.batch/pom.xml
index 924dba26b..37f98f87b 100644
--- a/scouter.agent.batch/pom.xml
+++ b/scouter.agent.batch/pom.xml
@@ -5,7 +5,7 @@
io.github.scouter-project
scouter-parent
- 2.10.2
+ 2.15.0
scouter-agent-batch
diff --git a/scouter.agent.host/pom.xml b/scouter.agent.host/pom.xml
index 7c466db45..f4815c59e 100644
--- a/scouter.agent.host/pom.xml
+++ b/scouter.agent.host/pom.xml
@@ -4,7 +4,7 @@
io.github.scouter-project
scouter-parent
- 2.10.2
+ 2.15.0
scouter-agent-host
diff --git a/scouter.agent.java/pom.xml b/scouter.agent.java/pom.xml
index 1ed7750d4..4eeea57a1 100644
--- a/scouter.agent.java/pom.xml
+++ b/scouter.agent.java/pom.xml
@@ -4,7 +4,7 @@
io.github.scouter-project
scouter-parent
- 2.10.2
+ 2.15.0
scouter-agent-java
@@ -384,12 +384,12 @@
org.ow2.asm
asm
- 8.0.1
+ 9.2
org.ow2.asm
asm-commons
- 8.0.1
+ 9.2
diff --git a/scouter.agent.java/src/main/java/scouter/agent/AgentTransformer.java b/scouter.agent.java/src/main/java/scouter/agent/AgentTransformer.java
index e8f79f62a..b2266d170 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/AgentTransformer.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/AgentTransformer.java
@@ -229,7 +229,7 @@ public byte[] transform(final ClassLoader loader, String className, final Class
ObjTypeDetector.check(className);
final ClassDesc classDesc = new ClassDesc();
ClassReader cr = new ClassReader(classfileBuffer);
- cr.accept(new ClassVisitor(Opcodes.ASM8) {
+ cr.accept(new ClassVisitor(Opcodes.ASM9) {
public void visit(int version, int access, String name, String signature, String superName,
String[] interfaces) {
classDesc.set(version, access, name, signature, superName, interfaces);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/Configure.java b/scouter.agent.java/src/main/java/scouter/agent/Configure.java
index 0c49cc7dd..6e53ac954 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/Configure.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/Configure.java
@@ -141,10 +141,13 @@ public static final Configure getInstance() {
// @ConfigDesc("Activating profile summary function")
// public boolean profile_summary_mode_enabled = false;
+ @ConfigDesc("turn off profile")
+ public boolean profile_off = false;
+
@ConfigDesc("Profiling the memory usage of each method")
public boolean profile_thread_cputime_enabled = false;
@ConfigDesc("Profiling the memory usage of each service")
- public boolean profile_thread_memory_usage_enabled = true;
+ public boolean profile_thread_memory_usage_enabled = false;
@ConfigDesc("ThreadStack profile for open socket")
public boolean profile_socket_open_fullstack_enabled = false;
@ConfigDesc("ThreadStack profile for a certain port of open socket")
@@ -227,6 +230,8 @@ public static final Configure getInstance() {
public String trace_http_client_ip_header_key = "";
@ConfigDesc("Activating gxid connection in HttpTransfer")
public boolean trace_interservice_enabled = true;
+ @ConfigDesc("propagate b3 header")
+ public boolean trace_propagete_b3_header = true;
@ConfigDesc("")
public String _trace_interservice_gxid_header_key = "X-Scouter-Gxid";
@ConfigDesc("")
@@ -366,6 +371,8 @@ public static final Configure getInstance() {
@ConfigDesc("XLog sampling mode enabled")
public boolean xlog_sampling_enabled = false;
+ @ConfigDesc("rate precision, default 1 means 1%. use 10 for 0.1%.")
+ public int xlog_sampling_rate_precision = 1;
@ConfigDesc("XLog sampling but discard profile only not XLog.")
public boolean xlog_sampling_only_profile = false;
@ConfigDesc("XLog sampling bound millisecond - step1(lowest : range - from 0 to here)")
@@ -387,6 +394,8 @@ public static final Configure getInstance() {
//XLog sampling for service patterns options
@ConfigDesc("XLog patterned sampling mode enabled")
public boolean xlog_patterned_sampling_enabled = false;
+ @ConfigDesc("rate precision, default 1 means 1%. use 10 for 0.1%.")
+ public int xlog_patterned_sampling_rate_precision = 1;
@ConfigDesc("XLog patterned sampling service patterns\neg) /user/{userId},/device/*")
@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
public String xlog_patterned_sampling_service_patterns = "";
@@ -411,6 +420,8 @@ public static final Configure getInstance() {
//XLog patterned sampling options for another sampling group
@ConfigDesc("XLog patterned sampling mode enabled")
public boolean xlog_patterned2_sampling_enabled = false;
+ @ConfigDesc("rate precision, default 1 means 1%. use 10 for 0.1%.")
+ public int xlog_patterned2_sampling_rate_precision = 1;
@ConfigDesc("XLog patterned sampling service patterns\neg) /user/{userId},/device/*")
@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
public String xlog_patterned2_sampling_service_patterns = "";
@@ -435,6 +446,8 @@ public static final Configure getInstance() {
//XLog patterned sampling options for another sampling group
@ConfigDesc("XLog patterned sampling mode enabled")
public boolean xlog_patterned3_sampling_enabled = false;
+ @ConfigDesc("rate precision, default 1 means 1%. use 10 for 0.1%.")
+ public int xlog_patterned3_sampling_rate_precision = 1;
@ConfigDesc("XLog patterned sampling service patterns\neg) /user/{userId},/device/*")
@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
public String xlog_patterned3_sampling_service_patterns = "";
@@ -459,6 +472,8 @@ public static final Configure getInstance() {
//XLog patterned sampling options for another sampling group
@ConfigDesc("XLog patterned sampling mode enabled")
public boolean xlog_patterned4_sampling_enabled = false;
+ @ConfigDesc("rate precision, default 1 means 1%. use 10 for 0.1%.")
+ public int xlog_patterned4_sampling_rate_precision = 1;
@ConfigDesc("XLog patterned sampling service patterns\neg) /user/{userId},/device/*")
@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
public String xlog_patterned4_sampling_service_patterns = "";
@@ -483,6 +498,8 @@ public static final Configure getInstance() {
//XLog patterned sampling options for another sampling group
@ConfigDesc("XLog patterned sampling mode enabled")
public boolean xlog_patterned5_sampling_enabled = false;
+ @ConfigDesc("rate precision, default 1 means 1%. use 10 for 0.1%.")
+ public int xlog_patterned5_sampling_rate_precision = 1;
@ConfigDesc("XLog patterned sampling service patterns\neg) /user/{userId},/device/*")
@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
public String xlog_patterned5_sampling_service_patterns = "";
@@ -780,6 +797,10 @@ public static final Configure getInstance() {
public boolean _psts_enabled = false;
@ConfigDesc("PSTS(periodical stacktrace step) thread dump Interval(ms) - hard min limit 2000")
public int _psts_dump_interval_ms = 10000;
+ @ConfigDesc("PSTS(periodical stacktrace step) thread dump min time. it dumps only the elapsed time is over than this option")
+ public int _psts_dump_min_ms = 1000;
+ @ConfigDesc("PSTS(periodical stacktrace step) thread dump max count in 1 interval")
+ public int _psts_dump_max_count = 100;
public boolean _psts_progressive_reactor_thread_trace_enabled = true;
//Summary
@@ -953,8 +974,10 @@ private void apply() {
this.autodump_cpu_exceeded_dump_cnt = getInt("autodump_cpu_exceeded_dump_cnt", 3);
this.mgr_static_content_extensions = getValue("mgr_static_content_extensions", "js, htm, html, gif, png, jpg, css");
+
+ this.profile_off = getBoolean("profile_off", false);
this.profile_thread_cputime_enabled = getBoolean("profile_thread_cputime_enabled", false);
- this.profile_thread_memory_usage_enabled = getBoolean("profile_thread_memory_usage_enabled", true);
+ this.profile_thread_memory_usage_enabled = getBoolean("profile_thread_memory_usage_enabled", false);
this.profile_socket_open_fullstack_enabled = getBoolean("profile_socket_open_fullstack_enabled", false);
this.trace_background_socket_enabled = getBoolean("trace_background_socket_enabled", true);
this.profile_socket_open_fullstack_port = getInt("profile_socket_open_fullstack_port", 0);
@@ -1099,6 +1122,7 @@ private void apply() {
this.trace_http_client_ip_header_key = getValue("trace_http_client_ip_header_key", "");
this.trace_interservice_enabled = getBoolean("trace_interservice_enabled", true);
+ this.trace_propagete_b3_header = getBoolean("trace_propagete_b3_header", true);
this.trace_response_gxid_enabled = getBoolean("trace_response_gxid_enabled", false);
this._trace_interservice_gxid_header_key = getValue("_trace_interservice_gxid_header_key", "X-Scouter-Gxid");
this._trace_interservice_callee_header_key = getValue("_trace_interservice_callee_header_key", "X-Scouter-Callee");
@@ -1152,6 +1176,8 @@ private void apply() {
this._psts_enabled = getBoolean("_psts_enabled", false);
this._psts_dump_interval_ms = getInt("_psts_dump_interval_ms", 10000);
+ this._psts_dump_min_ms = getInt("_psts_dump_min_ms", 1000);
+ this._psts_dump_max_count = getInt("_psts_dump_max_count", 100);
this._psts_progressive_reactor_thread_trace_enabled = getBoolean("_psts_progressive_reactor_dump_enabled", true);
// 웹시스템으로 부터 WAS 사이의 성능과 어떤 웹서버가 요청을 보내 왔는지를 추적하는 기능을 ON/OFF하고
@@ -1231,6 +1257,7 @@ private void apply() {
this.xlog_sampling_exclude_patterns = getValue("xlog_sampling_exclude_patterns", "");
this.xlog_sampling_enabled = getBoolean("xlog_sampling_enabled", false);
+ this.xlog_sampling_rate_precision = getInt("xlog_sampling_rate_precision", 1);
this.xlog_sampling_only_profile = getBoolean("xlog_sampling_only_profile", false);
this.xlog_sampling_step1_ms = getInt("xlog_sampling_step1_ms", 100);
this.xlog_sampling_step1_rate_pct = getInt("xlog_sampling_step1_rate_pct", 3);
@@ -1241,6 +1268,7 @@ private void apply() {
this.xlog_sampling_over_rate_pct = getInt("xlog_sampling_over_rate_pct", 100);
this.xlog_patterned_sampling_enabled = getBoolean("xlog_patterned_sampling_enabled", false);
+ this.xlog_patterned_sampling_rate_precision = getInt("xlog_patterned_sampling_rate_precision", 1);
this.xlog_patterned_sampling_service_patterns = getValue("xlog_patterned_sampling_service_patterns", "");
this.xlog_patterned_sampling_only_profile = getBoolean("xlog_patterned_sampling_only_profile", false);
this.xlog_patterned_sampling_step1_ms = getInt("xlog_patterned_sampling_step1_ms", 100);
@@ -1252,6 +1280,7 @@ private void apply() {
this.xlog_patterned_sampling_over_rate_pct = getInt("xlog_patterned_sampling_over_rate_pct", 100);
this.xlog_patterned2_sampling_enabled = getBoolean("xlog_patterned2_sampling_enabled", false);
+ this.xlog_patterned2_sampling_rate_precision = getInt("xlog_patterned2_sampling_rate_precision", 1);
this.xlog_patterned2_sampling_service_patterns = getValue("xlog_patterned2_sampling_service_patterns", "");
this.xlog_patterned2_sampling_only_profile = getBoolean("xlog_patterned2_sampling_only_profile", false);
this.xlog_patterned2_sampling_step1_ms = getInt("xlog_patterned2_sampling_step1_ms", 100);
@@ -1263,6 +1292,7 @@ private void apply() {
this.xlog_patterned2_sampling_over_rate_pct = getInt("xlog_patterned2_sampling_over_rate_pct", 100);
this.xlog_patterned3_sampling_enabled = getBoolean("xlog_patterned3_sampling_enabled", false);
+ this.xlog_patterned3_sampling_rate_precision = getInt("xlog_patterned3_sampling_rate_precision", 1);
this.xlog_patterned3_sampling_service_patterns = getValue("xlog_patterned3_sampling_service_patterns", "");
this.xlog_patterned3_sampling_only_profile = getBoolean("xlog_patterned3_sampling_only_profile", false);
this.xlog_patterned3_sampling_step1_ms = getInt("xlog_patterned3_sampling_step1_ms", 100);
@@ -1274,6 +1304,7 @@ private void apply() {
this.xlog_patterned3_sampling_over_rate_pct = getInt("xlog_patterned3_sampling_over_rate_pct", 100);
this.xlog_patterned4_sampling_enabled = getBoolean("xlog_patterned4_sampling_enabled", false);
+ this.xlog_patterned4_sampling_rate_precision = getInt("xlog_patterned4_sampling_rate_precision", 1);
this.xlog_patterned4_sampling_service_patterns = getValue("xlog_patterned4_sampling_service_patterns", "");
this.xlog_patterned4_sampling_only_profile = getBoolean("xlog_patterned4_sampling_only_profile", false);
this.xlog_patterned4_sampling_step1_ms = getInt("xlog_patterned4_sampling_step1_ms", 100);
@@ -1285,6 +1316,7 @@ private void apply() {
this.xlog_patterned4_sampling_over_rate_pct = getInt("xlog_patterned4_sampling_over_rate_pct", 100);
this.xlog_patterned5_sampling_enabled = getBoolean("xlog_patterned5_sampling_enabled", false);
+ this.xlog_patterned5_sampling_rate_precision = getInt("xlog_patterned5_sampling_rate_precision", 1);
this.xlog_patterned5_sampling_service_patterns = getValue("xlog_patterned5_sampling_service_patterns", "");
this.xlog_patterned5_sampling_only_profile = getBoolean("xlog_patterned5_sampling_only_profile", false);
this.xlog_patterned5_sampling_step1_ms = getInt("xlog_patterned5_sampling_step1_ms", 100);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/DirectPatch.java b/scouter.agent.java/src/main/java/scouter/agent/DirectPatch.java
index b710ff1c1..de43c5904 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/DirectPatch.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/DirectPatch.java
@@ -51,7 +51,7 @@ private static String getClassName(byte[] bytes) {
try {
final ClassDesc classDesc = new ClassDesc();
ClassReader cr = new ClassReader(bytes);
- cr.accept(new ClassVisitor(Opcodes.ASM8) {
+ cr.accept(new ClassVisitor(Opcodes.ASM9) {
public void visit(int version, int access, String name, String signature, String superName,
String[] interfaces) {
classDesc.set(version, access, name, signature, superName, interfaces);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/LambdaFormTransformer.java b/scouter.agent.java/src/main/java/scouter/agent/LambdaFormTransformer.java
index b8b839836..6207389f3 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/LambdaFormTransformer.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/LambdaFormTransformer.java
@@ -71,7 +71,7 @@ public byte[] transform(final ClassLoader loader, String className, final Class
final ClassDesc classDesc = new ClassDesc();
ClassReader cr = new ClassReader(classfileBuffer);
- cr.accept(new ClassVisitor(Opcodes.ASM8) {
+ cr.accept(new ClassVisitor(Opcodes.ASM9) {
public void visit(int version, int access, String name, String signature, String superName,
String[] interfaces) {
classDesc.set(version, access, name, signature, superName, interfaces);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/AddFieldASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/AddFieldASM.java
index f4ef068ff..c183deb2a 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/AddFieldASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/AddFieldASM.java
@@ -51,7 +51,7 @@ class AddFieldCV extends ClassVisitor implements Opcodes {
private String field;
private String className;
public AddFieldCV(ClassVisitor cv, String className, String field) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.field = field;
this.className = className;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/ApiCallResponseObjectASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/ApiCallResponseObjectASM.java
index a6e08e1d0..140038843 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/ApiCallResponseObjectASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/ApiCallResponseObjectASM.java
@@ -58,7 +58,7 @@ class ApiCallResponseObjectCV extends ClassVisitor implements Opcodes {
String className;
public ApiCallResponseObjectCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -89,7 +89,7 @@ class ApiCallResponseObjectInitMV extends LocalVariablesSorter implements Opcode
private Label startFinally = new Label();
public ApiCallResponseObjectInitMV(String className, int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
this.name = name;
this.desc = desc;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallASM.java
index 8c975089f..71dd565d3 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallASM.java
@@ -122,7 +122,7 @@ class ApicallExtCV extends ClassVisitor implements Opcodes {
private HookingSet mset;
public ApicallExtCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -152,7 +152,7 @@ class ApicallExtMV extends LocalVariablesSorter implements Opcodes {
public ApicallExtMV(int access, String desc, MethodVisitor mv, Type[] paramTypes, boolean isStatic,
String classname, String methodname, String methoddesc) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.paramTypes = paramTypes;
this.returnType = Type.getReturnType(desc);
this.isStatic = isStatic;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallInfoASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallInfoASM.java
index fbdfeb1b9..4745b49a9 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallInfoASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallInfoASM.java
@@ -59,7 +59,7 @@ class ApicallInfoCV extends ClassVisitor implements Opcodes {
public String className;
private HookingSet mset;
public ApicallInfoCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -84,7 +84,7 @@ class ApicallInfoMV extends LocalVariablesSorter implements Opcodes {
private static final String START_SIGNATURE = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;[Ljava/lang/Object;)V";
public ApicallInfoMV(int access, String desc, MethodVisitor mv, Type[] paramTypes, boolean isStatic,
String classname, String methodname, String methoddesc) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.paramTypes = paramTypes;
this.isStatic = isStatic;
this.className = classname;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallJavaHttpRequestASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallJavaHttpRequestASM.java
index 76510c1f1..a5ead8595 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallJavaHttpRequestASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallJavaHttpRequestASM.java
@@ -35,7 +35,7 @@ class ApicallJavaHttpRequestCV extends ClassVisitor implements Opcodes {
public String className;
private HookingSet mset;
public ApicallJavaHttpRequestCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -58,7 +58,7 @@ class ApicallJavaHttpRequestMV extends LocalVariablesSorter implements Opcodes {
String desc;
public ApicallJavaHttpRequestMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
@@ -69,4 +69,4 @@ public void visitCode() {
mv.visitMethodInsn(Opcodes.INVOKESTATIC, TARGET, METHOD, METHOD_DESC, false);
mv.visitCode();
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallSpringHandleResponseASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallSpringHandleResponseASM.java
index e4efc2341..d5cec82f4 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallSpringHandleResponseASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallSpringHandleResponseASM.java
@@ -58,7 +58,7 @@ class RestTemplateResponseHandlerCV extends ClassVisitor implements Opcodes {
public String className;
private HookingSet mset;
public RestTemplateResponseHandlerCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -86,7 +86,7 @@ class RestTemplateResponseHandlerMV extends LocalVariablesSorter implements Opco
int respIdx;
public RestTemplateResponseHandlerMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
this.respIdx = AsmUtil.getIdxByType(access, desc, Type.getType("Lorg/springframework/http/client/ClientHttpResponse;"));
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallSpringHttpAccessorASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallSpringHttpAccessorASM.java
index 40da1b57a..5da0582f3 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallSpringHttpAccessorASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallSpringHttpAccessorASM.java
@@ -54,7 +54,7 @@ class HttpAccessorCV extends ClassVisitor implements Opcodes {
public String className;
private HookingSet mset;
public HttpAccessorCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -84,7 +84,7 @@ class CreateRequestMV extends LocalVariablesSorter implements Opcodes {
private Type returnType;
public CreateRequestMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
this.returnType = Type.getReturnType(desc);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallWebClientInfoASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallWebClientInfoASM.java
index 9ed49a6a1..65851f75a 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallWebClientInfoASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallWebClientInfoASM.java
@@ -62,7 +62,7 @@ class WebClientRequestBuilderBodyInserterCV extends ClassVisitor implements Opco
public String className;
private HookingSet mset;
public WebClientRequestBuilderBodyInserterCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -90,7 +90,7 @@ class RequestBuilderBodyInserterWriteToMV extends LocalVariablesSorter implement
int respIdx;
public RequestBuilderBodyInserterWriteToMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallWebClientResponseASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallWebClientResponseASM.java
index 74e4af1a6..22ab37287 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallWebClientResponseASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/ApicallWebClientResponseASM.java
@@ -60,7 +60,7 @@ class WebClientResponseLogCV extends ClassVisitor implements Opcodes {
public String className;
private HookingSet mset;
public WebClientResponseLogCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -88,7 +88,7 @@ class WebClientResponseLogMV extends LocalVariablesSorter implements Opcodes {
int respIdx;
public WebClientResponseLogMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/CapArgsASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/CapArgsASM.java
index a1bf98dc0..7ab3c29d8 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/CapArgsASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/CapArgsASM.java
@@ -54,7 +54,7 @@ class CapArgsCV extends ClassVisitor implements Opcodes {
private HookingSet mset;
public CapArgsCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -88,7 +88,7 @@ class CapArgsMV extends LocalVariablesSorter implements Opcodes {
public CapArgsMV(int access, String desc, MethodVisitor mv, Type[] paramTypes, boolean isStatic, String classname,
String methodname, String methoddesc) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.paramTypes = paramTypes;
this.isStatic = isStatic;
this.className = classname;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/CapReturnASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/CapReturnASM.java
index f6cfeed37..499a37096 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/CapReturnASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/CapReturnASM.java
@@ -56,7 +56,7 @@ class CapReturnCV extends ClassVisitor implements Opcodes {
private HookingSet mset;
public CapReturnCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -91,7 +91,7 @@ public CapReturnMV(int access, String desc, MethodVisitor mv,
String classname,
String methodname,
String methoddesc, boolean isStatic) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.returnType = Type.getReturnType(desc);
this.className = classname;
this.methodName = methodname;
@@ -205,4 +205,4 @@ private void pushCommon() {
mv.visitVarInsn(Opcodes.ALOAD, 0);
}
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/CapThisASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/CapThisASM.java
index 47f60b805..2066be222 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/CapThisASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/CapThisASM.java
@@ -52,7 +52,7 @@ class CapThisCV extends ClassVisitor implements Opcodes {
private String className;
public CapThisCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -77,7 +77,7 @@ class CapThisMV extends MethodVisitor implements Opcodes {
private String methodDesc;
public CapThisMV(String classname, String methoddesc, MethodVisitor mv) {
- super(ASM8, mv);
+ super(ASM9, mv);
this.className = classname;
this.methodDesc = methoddesc;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/HttpReactiveServiceASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/HttpReactiveServiceASM.java
index ce5a3fc06..440fe86a3 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/HttpReactiveServiceASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/HttpReactiveServiceASM.java
@@ -66,7 +66,7 @@ class HttpReactiveServiceCV extends ClassVisitor implements Opcodes {
private String className;
public HttpReactiveServiceCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@Override
@@ -95,7 +95,7 @@ public MethodVisitor visitMethod(int access, String name, String desc, String si
// private static final String START_SIGNATURE = "(Ljava/lang/Object;)V";
//
// public HttpReactiveInitMV(int access, String desc, MethodVisitor mv) {
-// super(ASM8, access, desc, mv);
+// super(ASM9, access, desc, mv);
// }
//
// @Override
@@ -117,7 +117,7 @@ class HttpReactiveServiceMV extends LocalVariablesSorter implements Opcodes {
//TODO private final static String REJECT = "reject";
public HttpReactiveServiceMV(int access, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
}
@Override
@@ -147,7 +147,7 @@ public void visitInsn(int opcode) {
// private String className;
//
// public HttpReactiveServiceResCV(ClassVisitor cv, String className) {
-// super(ASM8, cv);
+// super(ASM9, cv);
// this.className = className;
// }
// @Override
@@ -172,7 +172,7 @@ public void visitInsn(int opcode) {
//
//
// public HttpReactiveServiceResMV(int access, String desc, MethodVisitor mv) {
-// super(ASM8, access, desc, mv);
+// super(ASM9, access, desc, mv);
// }
//
// @Override
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/HttpServiceASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/HttpServiceASM.java
index 1dca8d6d7..dc013dd42 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/HttpServiceASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/HttpServiceASM.java
@@ -52,7 +52,7 @@ class HttpServiceCV extends ClassVisitor implements Opcodes {
private static String TARGET_SIGNATURE = "(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;";
private String className;
public HttpServiceCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@Override
@@ -86,7 +86,7 @@ class HttpServiceMV extends LocalVariablesSorter implements Opcodes {
private Label startFinally = new Label();
private boolean httpservlet;
public HttpServiceMV(int access, String desc, MethodVisitor mv, boolean httpservlet) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.httpservlet = httpservlet;
}
private int statIdx;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/InitialContextASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/InitialContextASM.java
index 546be13a0..01bc9adae 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/InitialContextASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/InitialContextASM.java
@@ -50,7 +50,7 @@ class InitialContextCV extends ClassVisitor implements Opcodes {
public String className;
public InitialContextCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -78,7 +78,7 @@ class InitialContextMV extends LocalVariablesSorter implements Opcodes {
public InitialContextMV(int access, String desc, MethodVisitor mv, String classname, String methodname,
String methoddesc) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.returnType = Type.getReturnType(desc);
}
@@ -102,4 +102,4 @@ private void code() {
mv.visitMethodInsn(Opcodes.INVOKESTATIC, CLASS, METHOD, SIGNATURE, false);
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCConnectionOpenASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCConnectionOpenASM.java
index 13b4b3149..ec37b5223 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCConnectionOpenASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCConnectionOpenASM.java
@@ -84,7 +84,7 @@ class DbcOpenCV extends ClassVisitor implements Opcodes {
private HookingSet mset;
public DbcOpenCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -118,7 +118,7 @@ class DbcOpenMV extends LocalVariablesSorter implements Opcodes {
private Label startFinally = new Label();
public DbcOpenMV(int access, String desc, MethodVisitor mv, String fullname, int fullname_hash) {
- super(Opcodes.ASM8, access, desc, mv);
+ super(Opcodes.ASM9, access, desc, mv);
this.fullname = fullname;
this.fullname_hash = fullname_hash;
this.isStatic = (access & ACC_STATIC) != 0;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCDriverASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCDriverASM.java
index 75d896637..ee637efa7 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCDriverASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCDriverASM.java
@@ -49,7 +49,7 @@ class JDBCDriverCV extends ClassVisitor implements Opcodes {
public String className;
private HookingSet mset;
public JDBCDriverCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -78,7 +78,7 @@ class JDBCDriverMV extends LocalVariablesSorter implements Opcodes {
private Label startFinally = new Label();
public JDBCDriverMV(int access, String desc, MethodVisitor mv, String fullname) {
- super(ASM8,access, desc, mv);
+ super(ASM9,access, desc, mv);
this.strArgIdx = AsmUtil.getStringIdx(access, desc);
}
private int strArgIdx;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCGetConnectionASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCGetConnectionASM.java
index a1d919a55..a4c7dd59a 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCGetConnectionASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCGetConnectionASM.java
@@ -67,7 +67,7 @@ class DataSourceCV extends ClassVisitor implements Opcodes {
private HookingSet mset;
public DataSourceCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
@@ -98,7 +98,7 @@ class DataSourceMV extends LocalVariablesSorter implements Opcodes {
private String methodDesc;
public DataSourceMV(int access, String desc, MethodVisitor mv, String className, String methodName) {
- super(ASM8,access, desc, mv);
+ super(ASM9,access, desc, mv);
this.returnType = Type.getReturnType(desc);
this.className = className;
this.methodName = methodName;
@@ -125,4 +125,4 @@ public void visitInsn(int opcode) {
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCPreparedStatementASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCPreparedStatementASM.java
index 8b7807d76..f1792e1f7 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCPreparedStatementASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCPreparedStatementASM.java
@@ -111,7 +111,7 @@ class PreparedStatementCV extends ClassVisitor implements Opcodes {
private String owner;
public PreparedStatementCV(ClassVisitor cv, HashSet noField) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.noField = noField;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCResultSetASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCResultSetASM.java
index b08bea4b3..dc2dc100c 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCResultSetASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCResultSetASM.java
@@ -119,7 +119,7 @@ class ResultSetCV extends ClassVisitor implements Opcodes {
JDBCResultSetASM.Scope scope;
public ResultSetCV(ClassVisitor cv, JDBCResultSetASM.Scope scope) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.scope = scope;
}
@Override
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCStatementASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCStatementASM.java
index c0a2c1623..bfe8565aa 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCStatementASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/JDBCStatementASM.java
@@ -76,7 +76,7 @@ public ClassVisitor transform(ClassVisitor cv, String className, ClassDesc class
class StatementCV extends ClassVisitor implements Opcodes {
private String owner;
public StatementCV(ClassVisitor cv) {
- super(ASM8, cv);
+ super(ASM9, cv);
}
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/JspServletASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/JspServletASM.java
index 0b5bb3c06..b370d4023 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/JspServletASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/JspServletASM.java
@@ -72,7 +72,7 @@ class JspServletCV extends ClassVisitor implements Opcodes {
private HookingSet mset;
public JspServletCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -100,7 +100,7 @@ class JspServletMV extends LocalVariablesSorter implements Opcodes {
private boolean isStatic;
public JspServletMV(int access, String desc, MethodVisitor mv, Type[] paramTypes, boolean isStatic) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.paramTypes = paramTypes;
this.isStatic = isStatic;
@@ -165,4 +165,4 @@ public void visitCode() {
mv.visitMethodInsn(Opcodes.INVOKESTATIC, CLASS, METHOD, SIGNATURE,false);
super.visitCode();
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/MapImplASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/MapImplASM.java
index 8619bf486..2e550f900 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/MapImplASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/MapImplASM.java
@@ -33,7 +33,7 @@ class MapImplCV extends ClassVisitor implements Opcodes {
private String className;
public MapImplCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@Override
@@ -58,7 +58,7 @@ class MapImplMV extends LocalVariablesSorter implements Opcodes {
private String className;
public MapImplMV(int access, String desc, MethodVisitor mv, String className) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
}
@@ -75,4 +75,4 @@ public void visitInsn(int opcode) {
mv.visitInsn(opcode);
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/MethodASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/MethodASM.java
index ff38ff170..731c8fc72 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/MethodASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/MethodASM.java
@@ -104,7 +104,7 @@ class MethodCV extends ClassVisitor implements Opcodes {
private List excludeTarget;
public MethodCV(ClassVisitor cv, HookingSet mset, List excludeTarget, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.excludeTarget = excludeTarget;
this.className = className;
@@ -181,7 +181,7 @@ class MethodMV extends LocalVariablesSorter implements Opcodes {
private Label startFinally = new Label();
public MethodMV(int access, String desc, MethodVisitor mv, String fullname, int fullname_hash) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.fullname = fullname;
this.fullname_hash = fullname_hash;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/ScouterClassWriter.java b/scouter.agent.java/src/main/java/scouter/agent/asm/ScouterClassWriter.java
index f8b9e503c..e2e8643bb 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/ScouterClassWriter.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/ScouterClassWriter.java
@@ -176,6 +176,9 @@ private ClassReader typeInfo(final String type) throws IOException {
is = ClassLoader.getSystemResourceAsStream(type + ".class");
} else {
is = loader.getResourceAsStream(type + ".class");
+ if(is == null){
+ is = ClassLoader.getSystemResourceAsStream(type + ".class");
+ }
}
if (is == null) {
return null;
@@ -188,4 +191,4 @@ private ClassReader typeInfo(final String type) throws IOException {
}
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/ServiceASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/ServiceASM.java
index bd7aef2ca..3b0991a45 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/ServiceASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/ServiceASM.java
@@ -74,7 +74,7 @@ class ServiceCV extends ClassVisitor implements Opcodes {
private byte xType;
public ServiceCV(ClassVisitor cv, HookingSet mset, String className,byte xType) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
this.xType=xType;
@@ -124,7 +124,7 @@ class ServiceMV extends LocalVariablesSorter implements Opcodes {
public ServiceMV(int access, String desc, MethodVisitor mv, String fullname,Type[] paramTypes,
boolean isStatic,byte xType,String classname, String methodname, String methoddesc) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.fullname = fullname;
this.paramTypes = paramTypes;
this.strArgIdx = AsmUtil.getStringIdx(access, desc);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/SocketASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/SocketASM.java
index 544ba8194..e1aa17746 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/SocketASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/SocketASM.java
@@ -55,7 +55,7 @@ class SocketCV extends ClassVisitor implements Opcodes {
private HookingSet mset;
public SocketCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -84,7 +84,7 @@ class SocketMV extends LocalVariablesSorter implements Opcodes {
private Label startFinally = new Label();
public SocketMV(int access, String desc, MethodVisitor mv) {
- super(ASM8,access, desc, mv);
+ super(ASM9,access, desc, mv);
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/SpringReqMapASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/SpringReqMapASM.java
index 090374fd3..8ecb1f6bb 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/SpringReqMapASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/SpringReqMapASM.java
@@ -68,7 +68,7 @@ class SpringReqMapCV extends ClassVisitor implements Opcodes {
public String classRequestMappingUrl;
public SpringReqMapCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -97,7 +97,7 @@ public MethodVisitor visitMethod(int access, String methodName, String desc, Str
class SpringReqMapCVAV extends AnnotationVisitor implements Opcodes {
public SpringReqMapCVAV(AnnotationVisitor av) {
- super(ASM8, av);
+ super(ASM9, av);
}
@Override
@@ -114,7 +114,7 @@ public AnnotationVisitor visitArray(String name) {
class SpringReqMapCVAVAV extends AnnotationVisitor implements Opcodes {
public SpringReqMapCVAVAV(AnnotationVisitor av) {
- super(ASM8, av);
+ super(ASM9, av);
}
@Override
@@ -145,7 +145,7 @@ class SpringReqMapMV extends LocalVariablesSorter implements Opcodes {
private String desc;
public SpringReqMapMV(String className, int access, String methodName, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
this.access = access;
this.methodName = methodName;
@@ -266,7 +266,7 @@ public void visitCode() {
class SpringReqMapMVAV extends AnnotationVisitor implements Opcodes {
public SpringReqMapMVAV(AnnotationVisitor av) {
- super(ASM8, av);
+ super(ASM9, av);
}
@Override
@@ -285,7 +285,7 @@ class SpringReqMapMVAVAV extends AnnotationVisitor implements Opcodes {
String paramName;
public SpringReqMapMVAVAV(AnnotationVisitor av, String paramName) {
- super(ASM8, av);
+ super(ASM9, av);
this.paramName = paramName;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/SqlMapASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/SqlMapASM.java
index 2a1f31172..2a47201a6 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/SqlMapASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/SqlMapASM.java
@@ -74,7 +74,7 @@ class SqlMapCV extends ClassVisitor implements Opcodes {
public String className;
public SqlMapCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -106,7 +106,7 @@ class SqlMapMV extends LocalVariablesSorter implements Opcodes {
public SqlMapMV(int access, String desc, MethodVisitor mv, Type[] paramTypes, boolean isStatic, String classname,
String methodname, String methoddesc) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.paramTypes = paramTypes;
this.isStatic = isStatic;
this.methodName = methodname;
@@ -135,4 +135,4 @@ public void visitCode() {
mv.visitMethodInsn(Opcodes.INVOKESTATIC, CLASS, METHOD, SIGNATURE, false);
super.visitCode();
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/UserExceptionASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/UserExceptionASM.java
index 9052da3bb..0a65fb384 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/UserExceptionASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/UserExceptionASM.java
@@ -58,7 +58,7 @@ class UserExceptionCV extends ClassVisitor implements Opcodes {
private String className;
public UserExceptionCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -83,7 +83,7 @@ class UserExceptionConsturtorMV extends MethodVisitor implements Opcodes {
private String methodDesc;
public UserExceptionConsturtorMV(String classname, String methoddesc, MethodVisitor mv) {
- super(ASM8, mv);
+ super(ASM9, mv);
this.className = classname;
this.methodDesc = methoddesc;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/UserExceptionHandlerASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/UserExceptionHandlerASM.java
index f51f51089..5cb6aad3f 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/UserExceptionHandlerASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/UserExceptionHandlerASM.java
@@ -53,7 +53,7 @@ class UserExceptionHandlerCV extends ClassVisitor implements Opcodes {
private HookingSet mset;
public UserExceptionHandlerCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -87,7 +87,7 @@ class UserExceptionHandlerMV extends LocalVariablesSorter implements Opcodes {
public UserExceptionHandlerMV(int access, String desc, MethodVisitor mv, Type[] paramTypes, boolean isStatic, String classname,
String methodname, String methoddesc) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.paramTypes = paramTypes;
this.isStatic = isStatic;
this.className = classname;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/UserTxASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/UserTxASM.java
index a9b1cb517..7740ea80a 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/UserTxASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/UserTxASM.java
@@ -48,7 +48,7 @@ public ClassVisitor transform(ClassVisitor cv, String className, ClassDesc class
class UserTxCV extends ClassVisitor implements Opcodes {
public UserTxCV(ClassVisitor cv) {
- super(ASM8, cv);
+ super(ASM9, cv);
}
@Override
public MethodVisitor visitMethod(int access, String methodName, String desc, String signature, String[] exceptions) {
@@ -72,7 +72,7 @@ class UTXOpenMV extends LocalVariablesSorter implements Opcodes {
private static final String SIGNATURE = "()V";
public UTXOpenMV(int access, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
}
@Override
@@ -91,7 +91,7 @@ class UTXCloseMV extends LocalVariablesSorter implements Opcodes {
private String method;
public UTXCloseMV(int access, String desc, MethodVisitor mv, String method) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.method = method;
}
@@ -101,4 +101,4 @@ public void visitCode() {
mv.visitMethodInsn(Opcodes.INVOKESTATIC, TRACE_SQL, METHOD, SIGNATURE, false);
super.visitCode();
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/AsyncContextDispatchASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/AsyncContextDispatchASM.java
index 62792d498..c24721ae3 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/AsyncContextDispatchASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/AsyncContextDispatchASM.java
@@ -70,7 +70,7 @@ class AsyncContextCV extends ClassVisitor implements Opcodes {
HookingSet mset;
public AsyncContextCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -104,7 +104,7 @@ class DispatchMV extends LocalVariablesSorter implements Opcodes {
String desc;
public DispatchMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/CallRunnableASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/CallRunnableASM.java
index a12cdf98c..20e9f2b0e 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/CallRunnableASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/CallRunnableASM.java
@@ -94,7 +94,7 @@ class CallRunnableCV extends ClassVisitor implements Opcodes {
String className;
public CallRunnableCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -136,7 +136,7 @@ class CallOrRunMV extends LocalVariablesSorter implements Opcodes {
private int statIdx;
public CallOrRunMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
this.returnType = Type.getReturnType(desc);
@@ -217,7 +217,7 @@ class InitMV extends LocalVariablesSorter implements Opcodes {
String desc;
public InitMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/CoroutineThreadNameASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/CoroutineThreadNameASM.java
index 6397019c0..d10be1296 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/CoroutineThreadNameASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/CoroutineThreadNameASM.java
@@ -51,7 +51,7 @@ class CoroutineIdCV extends ClassVisitor implements Opcodes {
public String className;
public CoroutineIdCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -79,7 +79,7 @@ class CoroutineIdUpdateThreadContextMV extends LocalVariablesSorter implements O
private String className;
public CoroutineIdUpdateThreadContextMV(int access, String desc, MethodVisitor mv, String className) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
}
@@ -120,7 +120,7 @@ class CoroutineIdRestoreThreadContextMV extends LocalVariablesSorter implements
private String className;
public CoroutineIdRestoreThreadContextMV(int access, String desc, MethodVisitor mv, String className) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/HystrixCommandASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/HystrixCommandASM.java
index a3a2ffad5..600e20daf 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/HystrixCommandASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/HystrixCommandASM.java
@@ -74,7 +74,7 @@ class HystrixCommandPrepareCV extends ClassVisitor implements Opcodes {
private HookingSet mset;
public HystrixCommandPrepareCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -97,7 +97,7 @@ class HystrixCommandReceiveCV extends ClassVisitor implements Opcodes {
private HookingSet mset;
public HystrixCommandReceiveCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -134,7 +134,7 @@ class HystrixCommandReceiveMV extends LocalVariablesSorter implements Opcodes {
private int statIdx;
public HystrixCommandReceiveMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
this.returnType = Type.getReturnType(desc);
@@ -215,7 +215,7 @@ class HystrixCommandPrepareMV extends LocalVariablesSorter implements Opcodes {
String desc;
public HystrixCommandPrepareMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/LambdaFormASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/LambdaFormASM.java
index d770a72dc..e61cb8057 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/LambdaFormASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/LambdaFormASM.java
@@ -47,7 +47,7 @@ class LambdaFormCV extends ClassVisitor implements Opcodes {
String factoryMethodDesc;
public LambdaFormCV(ClassVisitor cv, String className, String lambdaMethodName, String lambdaMethodDesc, String factoryMethodName, String factoryMethodDesc) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
this.lambdaMethodName = lambdaMethodName;
this.lambdaMethodDesc = lambdaMethodDesc;
@@ -107,7 +107,7 @@ class LambdaMV extends LocalVariablesSorter implements Opcodes {
public LambdaMV(int access, String name, String desc, MethodVisitor mv,
String fullName, Type[] paramTypes, String className) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
@@ -217,7 +217,7 @@ class FacotoryMV extends LocalVariablesSorter implements Opcodes {
private Type returnType;
public FacotoryMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
this.returnType = Type.getReturnType(desc);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/MonoKtASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/MonoKtASM.java
index 76f1cd776..6e3ca33bb 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/MonoKtASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/MonoKtASM.java
@@ -54,7 +54,7 @@ class MonoKtCV extends ClassVisitor implements Opcodes {
public String className;
public MonoKtCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -80,7 +80,7 @@ class MonoKtMV extends LocalVariablesSorter implements Opcodes {
private String className;
public MonoKtMV(int access, String desc, MethodVisitor mv, String className) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/RequestStartAsyncASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/RequestStartAsyncASM.java
index 1afec8bed..8aa49be05 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/RequestStartAsyncASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/RequestStartAsyncASM.java
@@ -68,7 +68,7 @@ class RequestCV extends ClassVisitor implements Opcodes {
HookingSet mset;
public RequestCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -96,7 +96,7 @@ class StartAsyncMV extends LocalVariablesSorter implements Opcodes {
private Type returnType;
public StartAsyncMV(int access, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
returnType = Type.getReturnType(desc);
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/ThreadASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/ThreadASM.java
index 350e176d7..48ed9b5f4 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/ThreadASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/ThreadASM.java
@@ -51,7 +51,7 @@ class ThreadCV extends ClassVisitor implements Opcodes {
private String className;
public ThreadCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
Logger.println("G001", "Thread.class - " + className);
}
@@ -74,7 +74,7 @@ class ThreadNameMV extends LocalVariablesSorter implements Opcodes {
private String className;
public ThreadNameMV(int access, String desc, MethodVisitor mv, String className) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/executor/ExecutorServiceASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/executor/ExecutorServiceASM.java
index 9e70ecea3..a8a2a6856 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/executor/ExecutorServiceASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/executor/ExecutorServiceASM.java
@@ -54,7 +54,7 @@ class ThreadPoolExecutorCV extends ClassVisitor implements Opcodes {
String className;
public ThreadPoolExecutorCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -84,7 +84,7 @@ class ThreadPoolExecutorExecuteMV extends LocalVariablesSorter implements Opcode
String desc;
public ThreadPoolExecutorExecuteMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
@@ -102,7 +102,7 @@ class AbstractExecutorServiceCV extends ClassVisitor implements Opcodes {
String className;
public AbstractExecutorServiceCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -126,7 +126,7 @@ class AbstraceExecutorServiceSubmitMV extends LocalVariablesSorter implements Op
String desc;
public AbstraceExecutorServiceSubmitMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
@@ -149,7 +149,7 @@ class ThreadPoolExecutorGetTaskMV extends LocalVariablesSorter implements Opcode
String desc;
public ThreadPoolExecutorGetTaskMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/spring/SpringAsyncExecutionASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/spring/SpringAsyncExecutionASM.java
index d9ebc7209..5d8a10a69 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/spring/SpringAsyncExecutionASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/spring/SpringAsyncExecutionASM.java
@@ -58,7 +58,7 @@ class SpringAsyncExecutionCV extends ClassVisitor implements Opcodes {
HookingSet mset;
public SpringAsyncExecutionCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -89,7 +89,7 @@ class SubmitMV extends LocalVariablesSorter implements Opcodes {
String desc;
public SubmitMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
@@ -112,7 +112,7 @@ class DetermineMV extends LocalVariablesSorter implements Opcodes {
String desc;
public DetermineMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/spring/SpringAsyncExecutionAspectSupportDoSubmitASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/spring/SpringAsyncExecutionAspectSupportDoSubmitASM.java
index 8298848ff..9447db165 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/spring/SpringAsyncExecutionAspectSupportDoSubmitASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/asyncsupport/spring/SpringAsyncExecutionAspectSupportDoSubmitASM.java
@@ -69,7 +69,7 @@ class SpringAsyncExecutionAspectSupportCV extends ClassVisitor implements Opcode
HookingSet mset;
public SpringAsyncExecutionAspectSupportCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -95,7 +95,7 @@ class DoSubmitMV extends LocalVariablesSorter implements Opcodes {
private static final String CALL_SIGNATURE = "(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Callable;";
public DoSubmitMV(int access, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
}
@Override
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/elasticsearch/HttpNioEntityASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/elasticsearch/HttpNioEntityASM.java
index ddd335aee..006c0159d 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/elasticsearch/HttpNioEntityASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/elasticsearch/HttpNioEntityASM.java
@@ -55,7 +55,7 @@ class HttpNioEntityCV extends ClassVisitor implements Opcodes {
public String className;
public HttpNioEntityCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -95,7 +95,7 @@ class HttpNioEntityMV extends LocalVariablesSorter implements Opcodes {
private String className;
public HttpNioEntityMV(int access, String desc, MethodVisitor mv, String className) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/elasticsearch/RestClientASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/elasticsearch/RestClientASM.java
index 0fc2962cf..45341bfe0 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/elasticsearch/RestClientASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/elasticsearch/RestClientASM.java
@@ -50,7 +50,7 @@ static class RestClientCV extends ClassVisitor implements Opcodes {
public String className;
public RestClientCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -76,7 +76,7 @@ static class RestClientStartMV extends LocalVariablesSorter implements Opcodes {
private String className;
public RestClientStartMV(int access, String desc, MethodVisitor mv, String className) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
}
@@ -93,7 +93,7 @@ static class RequestLoggerCV extends ClassVisitor implements Opcodes {
public String className;
public RequestLoggerCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -122,7 +122,7 @@ static class RequestLoggerMV extends LocalVariablesSorter implements Opcodes {
private String className;
public RequestLoggerMV(int access, String desc, MethodVisitor mv, String className) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
}
@@ -144,7 +144,7 @@ static class RequestFailLoggerMV extends LocalVariablesSorter implements Opcodes
private String className;
public RequestFailLoggerMV(int access, String desc, MethodVisitor mv, String className) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
}
@@ -158,4 +158,4 @@ public void visitCode() {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsClearParametersMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsClearParametersMV.java
index 5e0d5bbed..d626bb754 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsClearParametersMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsClearParametersMV.java
@@ -28,7 +28,7 @@ public class PsClearParametersMV extends LocalVariablesSorter implements Opcodes
// /////////////////////////////////////////////////////////////////
public PsClearParametersMV(int access, String desc, MethodVisitor mv, String owner) {
- super(ASM8,access, desc, mv);
+ super(ASM9,access, desc, mv);
this.owner = owner;
}
@@ -44,4 +44,4 @@ public void visitCode() {
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsCloseMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsCloseMV.java
index e9c060345..346ddb3a8 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsCloseMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsCloseMV.java
@@ -26,7 +26,7 @@ public class PsCloseMV extends MethodVisitor implements Opcodes {
private static final String SIGNATURE = "(Ljava/lang/Object;)V";
public PsCloseMV(MethodVisitor mv) {
- super(ASM8, mv);
+ super(ASM9, mv);
}
@Override
@@ -37,4 +37,4 @@ public void visitInsn(int opcode) {
}
mv.visitInsn(opcode);
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsExecuteMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsExecuteMV.java
index 753eef632..e8ea7a54b 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsExecuteMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsExecuteMV.java
@@ -58,7 +58,7 @@ public static boolean isTarget(String name, String desc) {
private static final String END_SIGNATURE = "(Ljava/lang/Object;Ljava/lang/Throwable;I)V";
public PsExecuteMV(int access, String desc, MethodVisitor mv, String owner,String name) {
- super(ASM8,access, desc, mv);
+ super(ASM9,access, desc, mv);
this.owner = owner;
this.returnType = Type.getReturnType(desc);
this.desc = desc;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsInitMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsInitMV.java
index 08b3f0884..fa69c827d 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsInitMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsInitMV.java
@@ -45,7 +45,7 @@ public class PsInitMV extends LocalVariablesSorter implements Opcodes {
private boolean isUstatement = false;
public PsInitMV(int access, String desc, MethodVisitor mv, String owner) {
- super(ASM8,access, desc, mv);
+ super(ASM9,access, desc, mv);
this.owner = owner;
this.sqlIdx = AsmUtil.getStringIdx(access, desc);
@@ -89,4 +89,4 @@ public void visitInsn(int opcode) {
mv.visitInsn(opcode);
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsSetMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsSetMV.java
index c07a1c469..692803082 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsSetMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsSetMV.java
@@ -49,7 +49,7 @@ public class PsSetMV extends LocalVariablesSorter implements Opcodes {
target.put("setClob", "(ILjava/sql/Clob;)V");
target.put("setObject", "(ILjava/lang/Object;)V");
target.put("setString", "(ILjava/lang/String;)V");
- target.put("setDate", "(IBLjava/sql/Date;)V");
+ target.put("setDate", "(ILjava/sql/Date;)V");
target.put("setTime", "(ILjava/sql/Time;)V");
target.put("setTimestamp", "(ILjava/sql/Timestamp;)V");
target.put("setURL", "(ILjava/net/URL;)V"); //
@@ -62,7 +62,7 @@ public static String getSetSignature(String name) {
private final static String TRACESQL = TraceSQL.class.getName().replace('.', '/');
public PsSetMV(int access, String name, String desc, MethodVisitor mv, String owner) {
- super(ASM8,access, desc, mv);
+ super(ASM9,access, desc, mv);
this.owner = owner;
this.args = Type.getArgumentTypes(desc);
@@ -123,4 +123,4 @@ public void visitCode() {
super.visitCode();
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsUpdateCountMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsUpdateCountMV.java
index e36b3a617..2206a75ba 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsUpdateCountMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/PsUpdateCountMV.java
@@ -32,7 +32,7 @@ public class PsUpdateCountMV extends MethodVisitor implements Opcodes {
private static final String SIGNATURE = "(I)I";
public PsUpdateCountMV(MethodVisitor mv) {
- super(ASM8, mv);
+ super(ASM9, mv);
}
@Override
@@ -42,4 +42,4 @@ public void visitInsn(int opcode) {
}
mv.visitInsn(opcode);
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsCloseMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsCloseMV.java
index afc8cae5d..53711ece9 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsCloseMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsCloseMV.java
@@ -26,7 +26,7 @@ public class RsCloseMV extends MethodVisitor implements Opcodes {
private static final String SIGNATURE = "(Ljava/lang/Object;)V";
public RsCloseMV(MethodVisitor mv) {
- super(ASM8, mv);
+ super(ASM9, mv);
}
@Override
@@ -37,4 +37,4 @@ public void visitInsn(int opcode) {
}
mv.visitInsn(opcode);
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsInitMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsInitMV.java
index e8fc67519..854b5fb4c 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsInitMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsInitMV.java
@@ -32,7 +32,7 @@ public class RsInitMV extends LocalVariablesSorter implements Opcodes {
private final static String SIGNATURE = "(Ljava/lang/Object;)V";
public RsInitMV(int access, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
}
@Override
@@ -43,4 +43,4 @@ public void visitInsn(int opcode) {
}
mv.visitInsn(opcode);
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsNextMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsNextMV.java
index 92348600b..cd32d4000 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsNextMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/RsNextMV.java
@@ -27,7 +27,7 @@ public class RsNextMV extends MethodVisitor implements Opcodes {
private static final String SIGNATURE = "(Z)Z";
public RsNextMV(MethodVisitor mv) {
- super(ASM8, mv);
+ super(ASM9, mv);
}
@Override
@@ -37,4 +37,4 @@ public void visitInsn(int opcode) {
}
mv.visitInsn(opcode);
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/StExecuteMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/StExecuteMV.java
index 8c3716087..9456adeb9 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/StExecuteMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/StExecuteMV.java
@@ -51,7 +51,7 @@ public static boolean isTarget(String name) {
private static final String END_SIGNATURE = "(Ljava/lang/Object;Ljava/lang/Throwable;I)V";
public StExecuteMV(int access, String desc, MethodVisitor mv, String owner, String name) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.returnType = Type.getReturnType(desc);
this.desc = desc;
this.methodType = methodType(name);
@@ -153,4 +153,4 @@ public void visitMaxs(int maxStack, int maxLocals) {
mv.visitInsn(ATHROW);
mv.visitMaxs(maxStack + 8, maxLocals + 2);
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/StInitMV.java b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/StInitMV.java
index 60142a7f2..38d67a979 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/StInitMV.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/jdbc/StInitMV.java
@@ -28,7 +28,7 @@ public class StInitMV extends LocalVariablesSorter implements Opcodes {
private final static String SIGNATURE_INIT = "(Ljava/lang/Object;)V";
public StInitMV(int access, String desc, MethodVisitor mv) {
- super(ASM8,access, desc, mv);
+ super(ASM9,access, desc, mv);
}
@Override
@@ -39,4 +39,4 @@ public void visitInsn(int opcode) {
}
mv.visitInsn(opcode);
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/mongodb/MongoCommandProtocolASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/mongodb/MongoCommandProtocolASM.java
index d7248a7c8..2eeb01dac 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/mongodb/MongoCommandProtocolASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/mongodb/MongoCommandProtocolASM.java
@@ -57,7 +57,7 @@ static class MongoCommandProtocolCV extends ClassVisitor implements Opcodes {
public String className;
public MongoCommandProtocolCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -139,7 +139,7 @@ static class ExecuteAsyncMV extends LocalVariablesSorter implements Opcodes {
public ExecuteAsyncMV(int access, String desc, MethodVisitor mv, String className, boolean namespace,
boolean command, boolean readPreference, boolean payload, String version) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
this.namespace = namespace;
this.command = command;
@@ -215,7 +215,7 @@ static class ExecuteMV extends LocalVariablesSorter implements Opcodes {
public ExecuteMV(int access, String desc, MethodVisitor mv, String className, boolean namespace,
boolean command, boolean readPreference, boolean payload, String version) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
this.namespace = namespace;
this.command = command;
@@ -292,4 +292,4 @@ public void visitMaxs(int maxStack, int maxLocals) {
mv.visitMaxs(maxStack + 8, maxLocals + 2);
}
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/redis/JedisCommandASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/redis/JedisCommandASM.java
index 46f58fdb8..214ba6083 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/redis/JedisCommandASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/redis/JedisCommandASM.java
@@ -60,7 +60,7 @@ class JedisCommandCV extends ClassVisitor implements Opcodes {
String className;
public JedisCommandCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -93,7 +93,7 @@ class JedisCommandMV extends LocalVariablesSorter implements Opcodes {
private Label startFinally = new Label();
public JedisCommandMV(String className, int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
this.name = name;
this.desc = desc;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/redis/JedisProtocolASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/redis/JedisProtocolASM.java
index 895dd4517..86e02627d 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/redis/JedisProtocolASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/redis/JedisProtocolASM.java
@@ -70,7 +70,7 @@ class JedisProtocolCV extends ClassVisitor implements Opcodes {
HookingSet mset;
public JedisProtocolCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -104,7 +104,7 @@ class SendCommandMV extends LocalVariablesSorter implements Opcodes {
private Label startFinally = new Label();
public SendCommandMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
this.returnType = Type.getReturnType(desc);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/redis/LettuceASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/redis/LettuceASM.java
index 7e7f97aee..4a5eda8f0 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/redis/LettuceASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/redis/LettuceASM.java
@@ -40,7 +40,7 @@ class LettuceCV extends ClassVisitor implements Opcodes {
private boolean hasChannelDescriptor = false;
LettuceCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
@@ -80,7 +80,7 @@ class LettuceMV extends LocalVariablesSorter implements Opcodes {
private String ownerClass;
LettuceMV(int access, String desc, String ownerClass, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.ownerClass = ownerClass;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/redis/RedisCacheKeyASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/redis/RedisCacheKeyASM.java
index 769e3ce0d..33b9bf281 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/redis/RedisCacheKeyASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/redis/RedisCacheKeyASM.java
@@ -78,7 +78,7 @@ class RedisCacheKeyCV extends ClassVisitor implements Opcodes {
boolean existKeyElementField;
public RedisCacheKeyCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -123,7 +123,7 @@ class GetKeyBytesMV extends LocalVariablesSorter implements Opcodes {
private Type returnType;
public GetKeyBytesMV(int access, String className, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.className = className;
this.name = name;
this.desc = desc;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/redis/RedisKeyASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/redis/RedisKeyASM.java
index 67128b288..eec6f7331 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/redis/RedisKeyASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/redis/RedisKeyASM.java
@@ -69,7 +69,7 @@ class RedisKeySetCV extends ClassVisitor implements Opcodes {
HookingSet mset;
public RedisKeySetCV(ClassVisitor cv, HookingSet mset, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.mset = mset;
this.className = className;
}
@@ -98,7 +98,7 @@ class KeySetMV extends LocalVariablesSorter implements Opcodes {
private Type returnType;
public KeySetMV(int access, String name, String desc, MethodVisitor mv) {
- super(ASM8, access, desc, mv);
+ super(ASM9, access, desc, mv);
this.name = name;
this.desc = desc;
this.returnType = Type.getReturnType(desc);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/test/MongoModifyASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/test/MongoModifyASM.java
index c07472eec..51172cef7 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/test/MongoModifyASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/test/MongoModifyASM.java
@@ -65,7 +65,7 @@ public MethodVisitor visitMethod(int access, String methodName, String desc, Str
}
public InternalConnectionCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/asm/test/ReactorModifyASM.java b/scouter.agent.java/src/main/java/scouter/agent/asm/test/ReactorModifyASM.java
index 92ce1f659..18a9e4de6 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/asm/test/ReactorModifyASM.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/asm/test/ReactorModifyASM.java
@@ -64,7 +64,7 @@ public void visit(int version, int access, String name, String signature, String
}
public OptimizableOperatorCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
}
@@ -91,7 +91,7 @@ public FieldVisitor visitField(int access, String name, String descriptor, Strin
}
public MonoOnAssemblyCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
}
@@ -118,7 +118,7 @@ public FieldVisitor visitField(int access, String name, String descriptor, Strin
}
public FluxOnAssemblyCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
}
@@ -145,7 +145,7 @@ public FieldVisitor visitField(int access, String name, String descriptor, Strin
}
public AssemblySnapshotCV(ClassVisitor cv, String className) {
- super(ASM8, cv);
+ super(ASM9, cv);
this.className = className;
}
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/counter/task/DebugService.java b/scouter.agent.java/src/main/java/scouter/agent/counter/task/DebugService.java
index cff4e1444..2ad1f1e1a 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/counter/task/DebugService.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/counter/task/DebugService.java
@@ -35,7 +35,7 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.Enumeration;
+import java.util.Map;
public class DebugService {
@@ -54,13 +54,13 @@ public void checkService(CounterBasket pw) {
}
StringBuilder stuckMsg = new StringBuilder();
//TODO reactive support
- Enumeration en = TraceContextManager.getContextEnumeration();
- while (en.hasMoreElements()) {
- TraceContext ctx = en.nextElement();
+ for (Map.Entry e : TraceContextManager.getContextEntries()) {
+ TraceContext ctx = e.getValue();
if (checkStuck) {
checkStcukService(ctx, stuckOut, stuckMsg);
}
}
+
if (stuckMsg.length() > 0) {
AlertProxy.sendAlert(AlertLevel.WARN, "STUCK_SERVICE", stuckMsg.toString());
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/counter/task/MakeStack.java b/scouter.agent.java/src/main/java/scouter/agent/counter/task/MakeStack.java
index fdb829a31..87cc3c243 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/counter/task/MakeStack.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/counter/task/MakeStack.java
@@ -20,6 +20,7 @@
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
+import java.util.Map;
public class MakeStack {
static Configure conf = Configure.getInstance();
@@ -82,20 +83,34 @@ public void stackTraceStepGenerator(CounterBasket pw) {
return;
}
lastStackTraceGenTime = now;
+ int minMs = conf._psts_dump_min_ms;
+ int maxCount = conf._psts_dump_max_count;
ThreadMXBean tmxBean = ManagementFactory.getThreadMXBean();
- Enumeration en = TraceContextManager.getContextEnumeration();
- while (en.hasMoreElements()) {
- TraceContext ctx = en.nextElement();
+
+ List ctxList = new ArrayList();
+ int doCount = 0;
+ for (Map.Entry e : TraceContextManager.getContextEntries()) {
+ if (maxCount > 0 && doCount >= maxCount) {
+ break;
+ }
+ doCount++;
+ TraceContext ctx = e.getValue();
if (ctx != null) {
- if (ctx.isReactiveStarted) {
- reactiveStepDump(tmxBean, ctx);
- } else {
- stepDump(tmxBean, ctx);
+ long elapsed = (System.currentTimeMillis() - ctx.startTime);
+ if (minMs <= 0 || elapsed >= minMs) {
+ ctxList.add(ctx);
}
}
}
- long elapsed = (System.currentTimeMillis() - now);
+
+ for (TraceContext ctx : ctxList) {
+ if (ctx.isReactiveStarted) {
+ reactiveStepDump(tmxBean, ctx);
+ } else {
+ stepDump(tmxBean, ctx);
+ }
+ }
}
private void stepDump(ThreadMXBean tmxBean, TraceContext ctx) {
diff --git a/scouter.agent.java/src/main/java/scouter/agent/netio/request/handle/AgentThread.java b/scouter.agent.java/src/main/java/scouter/agent/netio/request/handle/AgentThread.java
index 5bc0ff7a1..b16501352 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/netio/request/handle/AgentThread.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/netio/request/handle/AgentThread.java
@@ -40,18 +40,9 @@
import java.io.IOException;
import java.util.Enumeration;
+import java.util.Map;
-import static scouter.net.RequestCmd.OBJECT_ACTIVE_SERVICE_LIST;
-import static scouter.net.RequestCmd.OBJECT_THREAD_CONTROL;
-import static scouter.net.RequestCmd.OBJECT_THREAD_DETAIL;
-import static scouter.net.RequestCmd.OBJECT_THREAD_DUMP;
-import static scouter.net.RequestCmd.OBJECT_THREAD_LIST;
-import static scouter.net.RequestCmd.PSTACK_ON;
-import static scouter.net.RequestCmd.TRIGGER_ACTIVE_SERVICE_LIST;
-import static scouter.net.RequestCmd.TRIGGER_DUMP_REASON;
-import static scouter.net.RequestCmd.TRIGGER_THREAD_DUMP;
-import static scouter.net.RequestCmd.TRIGGER_THREAD_DUMPS_FROM_CONDITIONS;
-import static scouter.net.RequestCmd.TRIGGER_THREAD_LIST;
+import static scouter.net.RequestCmd.*;
public class AgentThread {
@RequestHandler(OBJECT_THREAD_DETAIL)
@@ -211,9 +202,8 @@ public Pack activeThreadList(Pack param) {
ListValue login = rPack.newList("login");
ListValue desc = rPack.newList("desc");
- Enumeration en = TraceContextManager.getContextEnumeration();
- while (en.hasMoreElements()) {
- TraceContext ctx = en.nextElement();
+ for (Map.Entry e : TraceContextManager.getContextEntries()) {
+ TraceContext ctx = e.getValue();
if (ctx == null) {
continue;
}
@@ -248,9 +238,8 @@ public Pack activeThreadList(Pack param) {
desc.add(ctx.desc);
}
- Enumeration enDeferred = TraceContextManager.getDeferredContextEnumeration();
- while (enDeferred.hasMoreElements()) {
- TraceContext ctx = enDeferred.nextElement();
+ for (Map.Entry e : TraceContextManager.getDeferredContextEntries()) {
+ TraceContext ctx = e.getValue();
if (ctx == null) {
continue;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/TraceApiCall.java b/scouter.agent.java/src/main/java/scouter/agent/trace/TraceApiCall.java
index 33080e976..d30900a58 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/TraceApiCall.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/TraceApiCall.java
@@ -336,10 +336,12 @@ public static void endCreateSpringRestTemplateRequest(Object _this, Object oRtn)
httpclient.addHeader(oRtn, conf._trace_interservice_callee_header_key, Hexa32.toString32(ctx.lastApiCallStep.txid));
httpclient.addHeader(oRtn, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash()));
- httpclient.addHeader(oRtn, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
- httpclient.addHeader(oRtn, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
- httpclient.addHeader(oRtn, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(ctx.lastApiCallStep.txid));
- //httpclient.addHeader(oRtn, B3Constant.B3_HEADER_SAMPLED, "1"); omit means defer
+ if (conf.trace_propagete_b3_header) {
+ httpclient.addHeader(oRtn, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
+ httpclient.addHeader(oRtn, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
+ httpclient.addHeader(oRtn, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(ctx.lastApiCallStep.txid));
+ //httpclient.addHeader(oRtn, B3Constant.B3_HEADER_SAMPLED, "1"); omit means defer
+ }
PluginHttpCallTrace.call(ctx, httpclient, oRtn);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/TraceContextManager.java b/scouter.agent.java/src/main/java/scouter/agent/trace/TraceContextManager.java
index fd4c8bf3c..4afa54b9f 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/TraceContextManager.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/TraceContextManager.java
@@ -18,12 +18,12 @@
package scouter.agent.trace;
import scouter.agent.Configure;
+import scouter.agent.util.SimpleLru;
import scouter.util.KeyGen;
-import scouter.util.LongKeyLinkedMap;
-import scouter.util.LongKeyMap;
import scouter.util.LongLongLinkedMap;
-import java.util.Enumeration;
+import java.util.Map;
+import java.util.Set;
import static scouter.agent.trace.TraceContext.GetBy.CoroutineLocal;
import static scouter.agent.trace.TraceContext.GetBy.ThreadLocal;
@@ -33,8 +33,12 @@
public class TraceContextManager {
private static Configure conf = Configure.getInstance();
- private static LongKeyMap entryByThreadId = new LongKeyMap();
- private static LongKeyLinkedMap entryByTxid = new LongKeyLinkedMap().setMax(10000);
+// private static LongKeyMap entryByThreadId = new LongKeyMap();
+// private static LongKeyLinkedMap entryByTxid = new LongKeyLinkedMap().setMax(10000);
+
+ private static SimpleLru entryByThreadId = new SimpleLru(10000);
+ private static SimpleLru entryByTxid = new SimpleLru(10000);
+ private static SimpleLru deferredEntry = new SimpleLru(10000);
private static final ThreadLocal local = new ThreadLocal();
private static final ThreadLocal txidLocal = new ThreadLocal();
@@ -42,10 +46,10 @@ public class TraceContextManager {
private static CoroutineDebuggingLocal coroutineDebuggingLocal = new CoroutineDebuggingLocal();
- private static LongKeyMap deferredEntry = new LongKeyMap();
-
//pass = 1, discard = 2, end-processing-with-path = -1, end-processing-with-path = -2
private static ThreadLocal forceDiscard = new ThreadLocal();
+ private static boolean coroutineEnabled;
+ private static boolean coroutineDebuggingEnabled;
public static int size() {
return entryByTxid.size();
@@ -55,9 +59,8 @@ public static int[] getActiveCount() {
int[] act = new int[3];
try {
long now = System.currentTimeMillis();
- Enumeration en = entryByTxid.values();
- while (en.hasMoreElements()) {
- TraceContext ctx = en.nextElement();
+ for (Map.Entry e : entryByTxid.entrySet()) {
+ TraceContext ctx = e.getValue();
long tm = now - ctx.startTime;
if (tm < conf.trace_activeserivce_yellow_time) {
act[0]++;
@@ -72,19 +75,26 @@ public static int[] getActiveCount() {
return act;
}
- public static Enumeration getContextEnumeration() {
- return entryByTxid.values();
+ public static Set> getContextEntries() {
+ return entryByTxid.entrySet();
}
- public static Enumeration getThreadingContextEnumeration() {
- return entryByThreadId.values();
+ public static Set> getThreadingContextEntries() {
+ return entryByThreadId.entrySet();
}
- public static Enumeration getDeferredContextEnumeration() {
- return deferredEntry.values();
+ public static Set> getDeferredContextEntries() {
+ return deferredEntry.entrySet();
}
public static TraceContext getContext() {
+ return getContext(false);
+ }
+
+ public static TraceContext getContext(boolean force) {
+ if (!force && conf.profile_off) {
+ return null;
+ }
Long txid = txidLocal.get();
TraceContext traceContext = txid == null ? null : entryByTxid.get(txid);
@@ -93,12 +103,14 @@ public static TraceContext getContext() {
return traceContext;
}
- txid = txidByCoroutine.get();
- traceContext = txid == null ? null : entryByTxid.get(txid);
+ if (coroutineEnabled) {
+ txid = txidByCoroutine.get();
+ traceContext = txid == null ? null : entryByTxid.get(txid);
- if (traceContext != null) {
- traceContext.getBy = ThreadLocalTxidByCoroutine;
- return traceContext;
+ if (traceContext != null) {
+ traceContext.getBy = ThreadLocalTxidByCoroutine;
+ return traceContext;
+ }
}
traceContext = local.get();
@@ -107,10 +119,12 @@ public static TraceContext getContext() {
return traceContext;
}
- traceContext = getCoroutineContext();
- if (traceContext != null) {
- traceContext.getBy = CoroutineLocal;
- return traceContext;
+ if (coroutineDebuggingEnabled) {
+ traceContext = getCoroutineContext();
+ if (traceContext != null) {
+ traceContext.getBy = CoroutineLocal;
+ return traceContext;
+ }
}
return null;
@@ -211,6 +225,7 @@ public static void takeoverTxid(TraceContext o, long oldTxid) {
}
public static void startByCoroutine(TraceContext o) {
+ coroutineEnabled = true;
txidByCoroutine.set(o.txid);
}
@@ -221,8 +236,6 @@ public static void end(TraceContext o) {
private static LongLongLinkedMap threadTxidMap = new LongLongLinkedMap().setMax(2000);
private static LongLongLinkedMap txidThreadMap = new LongLongLinkedMap().setMax(2000);
- private static LongKeyMap map = new LongKeyMap();
-
public static void setTxidLocal(Long txid) {
txidLocal.set(txid);
if (txid != null && conf._psts_enabled && conf._psts_progressive_reactor_thread_trace_enabled) {
@@ -251,6 +264,7 @@ public static void asCoroutineDebuggingMode(Long coroutineId, TraceContext o) {
CoroutineDebuggingLocal.setCoroutineDebuggingId(coroutineId);
coroutineDebuggingLocal.put(o);
local.set(null);
+ coroutineDebuggingEnabled = true;
}
public static void toDeferred(TraceContext o) {
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/TraceMain.java b/scouter.agent.java/src/main/java/scouter/agent/trace/TraceMain.java
index b1d428c10..4a698e3e7 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/TraceMain.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/TraceMain.java
@@ -116,7 +116,7 @@ public Stat(TraceContext ctx) {
public static Object startHttpService(Object req, Object res) {
try {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx != null) {
return null;
}
@@ -132,7 +132,7 @@ public static Object startHttpService(Object req, Object res) {
public static Object startHttpFilter(Object req, Object res) {
try {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx != null) {
return null;
}
@@ -165,7 +165,7 @@ public static void startReactiveHttpService(Object exchange) {
}
String serverReqId = reactiveHttp.getRequestId(req);
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx != null && serverReqId != null && ctx.serverReqId == serverReqId) {
return;
}
@@ -186,7 +186,7 @@ public static void startReactiveHttpService(Object exchange) {
}
public static Object startReactiveHttpServiceReturn(Object mono) {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null) {
return mono;
}
@@ -383,7 +383,7 @@ private static void initReactiveSupport(Object obj) {
}
public static void endReactiveHttpService() {
- TraceContext context = TraceContextManager.getContext();
+ TraceContext context = TraceContextManager.getContext(true);
if (context == null) {
return;
}
@@ -559,42 +559,53 @@ public static void endHttpServiceFinal(TraceContext ctx, Object request, Object
ServiceSummary.getInstance().process(thr, pack.error, ctx.serviceHash, ctx.txid, 0, 0);
} else {
- String emsg = thr.toString();
- if (conf.profile_fullstack_service_error_enabled) {
- StringBuffer sb = new StringBuffer();
- sb.append(emsg).append("\n");
- ThreadUtil.getStackTrace(sb, thr, conf.profile_fullstack_max_lines);
- Throwable[] suppressed = thr.getSuppressed();
- if (suppressed != null) {
- for (Throwable sup : suppressed) {
- sb.append("\nSuppressed...\n");
- sb.append(sup.toString()).append("\n");
- ThreadUtil.getStackTrace(sb, sup, conf.profile_fullstack_max_lines);
- }
+ String classHierarchyConcatString = buildClassHierarchyConcatString(thr.getClass());
+ String[] excludes = UserExceptionHandlerASM.exceptionExcludeClasseNames;
+ boolean ignore = false;
+ for (int i = 0; i < excludes.length; i++) {
+ if (classHierarchyConcatString.contains(excludes[i])) {
+ ignore = true;
}
+ }
- Throwable thrCause = thr.getCause();
- if (thrCause != null) {
- thr = thrCause;
- while (thr != null) {
- sb.append("\nCause...\n");
- ThreadUtil.getStackTrace(sb, thr, conf.profile_fullstack_max_lines);
- Throwable[] suppressed2 = thr.getSuppressed();
- if (suppressed2 != null) {
- for (Throwable sup : suppressed2) {
- sb.append("\nSuppressed...\n");
- sb.append(sup.toString()).append("\n");
- ThreadUtil.getStackTrace(sb, sup, conf.profile_fullstack_max_lines);
- }
+ if (!ignore) {
+ String emsg = thr.toString();
+ if (conf.profile_fullstack_service_error_enabled) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(emsg).append("\n");
+ ThreadUtil.getStackTrace(sb, thr, conf.profile_fullstack_max_lines);
+ Throwable[] suppressed = thr.getSuppressed();
+ if (suppressed != null) {
+ for (Throwable sup : suppressed) {
+ sb.append("\nSuppressed...\n");
+ sb.append(sup.toString()).append("\n");
+ ThreadUtil.getStackTrace(sb, sup, conf.profile_fullstack_max_lines);
}
+ }
+
+ Throwable thrCause = thr.getCause();
+ if (thrCause != null) {
+ thr = thrCause;
+ while (thr != null) {
+ sb.append("\nCause...\n");
+ ThreadUtil.getStackTrace(sb, thr, conf.profile_fullstack_max_lines);
+ Throwable[] suppressed2 = thr.getSuppressed();
+ if (suppressed2 != null) {
+ for (Throwable sup : suppressed2) {
+ sb.append("\nSuppressed...\n");
+ sb.append(sup.toString()).append("\n");
+ ThreadUtil.getStackTrace(sb, sup, conf.profile_fullstack_max_lines);
+ }
+ }
- thr = thr.getCause();
+ thr = thr.getCause();
+ }
}
+ emsg = sb.toString();
}
- emsg = sb.toString();
+ pack.error = DataProxy.sendError(emsg);
+ ServiceSummary.getInstance().process(thr, pack.error, ctx.serviceHash, ctx.txid, 0, 0);
}
- pack.error = DataProxy.sendError(emsg);
- ServiceSummary.getInstance().process(thr, pack.error, ctx.serviceHash, ctx.txid, 0, 0);
}
} else if (ctx.userTransaction > 0 && conf.xlog_error_check_user_transaction_enabled) {
pack.error = DataProxy.sendError("UserTransaction missing commit/rollback Error");
@@ -752,7 +763,7 @@ public static boolean isStaticContents(String serviceName) {
public static Object startService(String name, String className, String methodName, String methodDesc, Object _this,
Object[] arg, byte xType) {
try {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx != null) {
return null;
}
@@ -1137,7 +1148,7 @@ public static void endMethod(Object localContext, Throwable thr) {
}
public static void setSpringControllerName(String name) {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null || name == null)
return;
if (!ctx.alreadySetControllerName) {
@@ -1148,7 +1159,7 @@ public static void setSpringControllerName(String name) {
}
public static void startSpringControllerMethod(String className, String methodName, String methodDesc, Object this1, Object[] arg) {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null)
return;
if (conf.profile_spring_controller_method_parameter_enabled) {
@@ -1169,7 +1180,7 @@ public static void startSpringControllerMethod(String className, String methodNa
}
public static void setStatus(int httpStatus) {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null)
return;
ctx.status = httpStatus;
@@ -1225,7 +1236,7 @@ public static void addMessage(String msg) {
}
public static void endRequestAsyncStart(Object asyncContext) {
- TraceContext traceContext = TraceContextManager.getContext();
+ TraceContext traceContext = TraceContextManager.getContext(true);
if (traceContext == null) return;
if (http == null) return;
http.addAsyncContextListener(asyncContext);
@@ -1273,7 +1284,7 @@ public static void selfDispatchAsyncServlet(Object asyncContext) {
public static void asyncPossibleInstanceInitInvoked(Object keyObject) {
try {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null) return;
if (TransferMap.get(System.identityHashCode(keyObject)) != null) {
@@ -1305,7 +1316,7 @@ public static Object startAsyncPossibleService(Object keyObject, String fullName
Object _this, Object[] arg) {
try {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
int objKey = System.identityHashCode(keyObject);
TransferMap.ID id = TransferMap.get(objKey);
TransferMap.remove(objKey);
@@ -1376,7 +1387,7 @@ public static void endAsyncPossibleService(Object oRtn, Object oLocalContext, Th
public static void springAsyncExecutionSubmit(Object _this, Callable callable) {
try {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null) return;
if (TransferMap.get(System.identityHashCode(callable)) != null) {
@@ -1408,7 +1419,7 @@ public static void springAsyncExecutionSubmit(Object _this, Callable callable) {
}
public static void springAsyncDetermineExecutor(Method m) {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null) return;
if (m == null) return;
@@ -1416,7 +1427,7 @@ public static void springAsyncDetermineExecutor(Method m) {
}
public static void executorServiceSubmitted(Object callRunnable) {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null) return;
if (callRunnable == null) return;
if (callRunnable instanceof WrTaskCallable) return;
@@ -1426,7 +1437,7 @@ public static void executorServiceSubmitted(Object callRunnable) {
public static void executorServiceExecuted(Object callRunnable) {
try {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null) return;
if (callRunnable == null) return;
if (callRunnable instanceof WrTaskCallable) return;
@@ -1475,7 +1486,7 @@ public static Runnable executorServiceGetTaskEnd(Runnable task) {
public static Object callRunnableCallInvoked(Object callRunnableObj) {
try {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
int objKey = System.identityHashCode(callRunnableObj);
TransferMap.ID id = TransferMap.get(objKey);
TransferMap.remove(objKey);
@@ -1529,7 +1540,7 @@ public static void callRunnableCallEnd(Object oRtn, Object oLocalContext, Throwa
private static final ConcurrentMap REFLECT_METHODS = new ConcurrentHashMap();
public static void hystrixPrepareInvoked(Object hystrixCommand) {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null) return;
if (TransferMap.get(System.identityHashCode(hystrixCommand)) != null) {
@@ -1567,7 +1578,7 @@ public static void hystrixPrepareInvoked(Object hystrixCommand) {
public static void callRunnableInitInvoked(Object callRunnableObj, boolean addStepToCtx, boolean isIgnoreIfNoThreaded) {
try {
- TraceContext ctx = TraceContextManager.getContext();
+ TraceContext ctx = TraceContextManager.getContext(true);
if (ctx == null) return;
if (TransferMap.get(System.identityHashCode(callRunnableObj)) != null) {
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/TraceReactive.java b/scouter.agent.java/src/main/java/scouter/agent/trace/TraceReactive.java
index 47217055d..1739d5756 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/TraceReactive.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/TraceReactive.java
@@ -24,7 +24,7 @@ public static void threadSetName(Thread thread, String name) {
}
public static void startCoroutineIdUpdateThreadContext(long coroutineId) {
- TraceContext context = TraceContextManager.getContext();
+ TraceContext context = TraceContextManager.getContext(true);
if (context == null) {
context = TraceContextManager.getCoroutineContext(coroutineId);
if (context == null) {
@@ -49,7 +49,7 @@ public static void endCoroutineIdUpdateThreadContext() {
}
public static Object startMonoKtMono(Object coroutineContext) {
- TraceContext context = TraceContextManager.getContext();
+ TraceContext context = TraceContextManager.getContext(true);
if (context == null) {
return coroutineContext;
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/TraceSQL.java b/scouter.agent.java/src/main/java/scouter/agent/trace/TraceSQL.java
index bcd76c680..df05553ab 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/TraceSQL.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/TraceSQL.java
@@ -16,9 +16,6 @@
*/
package scouter.agent.trace;
-import java.lang.reflect.Method;
-import java.util.Properties;
-
import scouter.agent.Configure;
import scouter.agent.Logger;
import scouter.agent.counter.meter.MeterInteraction;
@@ -42,6 +39,9 @@
import scouter.util.SysJMX;
import scouter.util.ThreadUtil;
+import java.lang.reflect.Method;
+import java.util.Properties;
+
/**
* Trace SQL
* @author @author Paul S.J. Kim(sjkim@whatap.io)
@@ -495,7 +495,7 @@ public static Object dbcOpenStart(int hash, String msg, Object pool) {
p.start_cpu = (int) (SysJMX.getCurrentThreadCPU() - ctx.startCpu);
}
DBURL dbUrl = getUrl(ctx, msg, pool);
- if (dbUrl != unknown) {
+ if (dbUrl != unknown && dbUrl.url != null) {
hash = DataProxy.sendMethodName(dbUrl.description);
int urlHash = DataProxy.sendObjName(dbUrl.url);
ctx.lastDbUrl = urlHash;
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/XLogSampler.java b/scouter.agent.java/src/main/java/scouter/agent/trace/XLogSampler.java
index 514e7cec7..52240c427 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/XLogSampler.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/XLogSampler.java
@@ -156,19 +156,19 @@ private XLogDiscard toForce(XLogDiscard discardMode, String serviceName) {
private XLogDiscard sampling4Elapsed(int elapsed, XLogDiscard discardMode) {
if (elapsed < conf.xlog_sampling_step1_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_sampling_step1_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_sampling_rate_precision)) >= conf.xlog_sampling_step1_rate_pct) {
discardMode = conf.xlog_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_sampling_step2_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_sampling_step2_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_sampling_rate_precision)) >= conf.xlog_sampling_step2_rate_pct) {
discardMode = conf.xlog_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_sampling_step3_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_sampling_step3_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_sampling_rate_precision)) >= conf.xlog_sampling_step3_rate_pct) {
discardMode = conf.xlog_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_sampling_over_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_sampling_rate_precision)) >= conf.xlog_sampling_over_rate_pct) {
discardMode = conf.xlog_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
}
@@ -177,19 +177,19 @@ private XLogDiscard sampling4Elapsed(int elapsed, XLogDiscard discardMode) {
private XLogDiscard samplingPatterned5(int elapsed, XLogDiscard discardMode) {
if (elapsed < conf.xlog_patterned5_sampling_step1_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned5_sampling_step1_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned5_sampling_rate_precision)) >= conf.xlog_patterned5_sampling_step1_rate_pct) {
discardMode = conf.xlog_patterned5_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_patterned5_sampling_step2_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned5_sampling_step2_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned5_sampling_rate_precision)) >= conf.xlog_patterned5_sampling_step2_rate_pct) {
discardMode = conf.xlog_patterned5_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_patterned5_sampling_step3_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned5_sampling_step3_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned5_sampling_rate_precision)) >= conf.xlog_patterned5_sampling_step3_rate_pct) {
discardMode = conf.xlog_patterned5_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned5_sampling_over_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned5_sampling_rate_precision)) >= conf.xlog_patterned5_sampling_over_rate_pct) {
discardMode = conf.xlog_patterned5_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
}
@@ -198,19 +198,19 @@ private XLogDiscard samplingPatterned5(int elapsed, XLogDiscard discardMode) {
private XLogDiscard samplingPatterned4(int elapsed, XLogDiscard discardMode) {
if (elapsed < conf.xlog_patterned4_sampling_step1_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned4_sampling_step1_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned4_sampling_rate_precision)) >= conf.xlog_patterned4_sampling_step1_rate_pct) {
discardMode = conf.xlog_patterned4_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_patterned4_sampling_step2_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned4_sampling_step2_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned4_sampling_rate_precision)) >= conf.xlog_patterned4_sampling_step2_rate_pct) {
discardMode = conf.xlog_patterned4_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_patterned4_sampling_step3_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned4_sampling_step3_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned4_sampling_rate_precision)) >= conf.xlog_patterned4_sampling_step3_rate_pct) {
discardMode = conf.xlog_patterned4_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned4_sampling_over_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned4_sampling_rate_precision)) >= conf.xlog_patterned4_sampling_over_rate_pct) {
discardMode = conf.xlog_patterned4_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
}
@@ -219,19 +219,19 @@ private XLogDiscard samplingPatterned4(int elapsed, XLogDiscard discardMode) {
private XLogDiscard samplingPatterned3(int elapsed, XLogDiscard discardMode) {
if (elapsed < conf.xlog_patterned3_sampling_step1_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned3_sampling_step1_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned3_sampling_rate_precision)) >= conf.xlog_patterned3_sampling_step1_rate_pct) {
discardMode = conf.xlog_patterned3_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_patterned3_sampling_step2_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned3_sampling_step2_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned3_sampling_rate_precision)) >= conf.xlog_patterned3_sampling_step2_rate_pct) {
discardMode = conf.xlog_patterned3_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_patterned3_sampling_step3_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned3_sampling_step3_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned3_sampling_rate_precision)) >= conf.xlog_patterned3_sampling_step3_rate_pct) {
discardMode = conf.xlog_patterned3_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned3_sampling_over_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned3_sampling_rate_precision)) >= conf.xlog_patterned3_sampling_over_rate_pct) {
discardMode = conf.xlog_patterned3_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
}
@@ -240,19 +240,19 @@ private XLogDiscard samplingPatterned3(int elapsed, XLogDiscard discardMode) {
private XLogDiscard samplingPatterned2(int elapsed, XLogDiscard discardMode) {
if (elapsed < conf.xlog_patterned2_sampling_step1_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned2_sampling_step1_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned2_sampling_rate_precision)) >= conf.xlog_patterned2_sampling_step1_rate_pct) {
discardMode = conf.xlog_patterned2_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_patterned2_sampling_step2_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned2_sampling_step2_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned2_sampling_rate_precision)) >= conf.xlog_patterned2_sampling_step2_rate_pct) {
discardMode = conf.xlog_patterned2_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_patterned2_sampling_step3_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned2_sampling_step3_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned2_sampling_rate_precision)) >= conf.xlog_patterned2_sampling_step3_rate_pct) {
discardMode = conf.xlog_patterned2_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned2_sampling_over_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned2_sampling_rate_precision)) >= conf.xlog_patterned2_sampling_over_rate_pct) {
discardMode = conf.xlog_patterned2_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
}
@@ -261,19 +261,19 @@ private XLogDiscard samplingPatterned2(int elapsed, XLogDiscard discardMode) {
private XLogDiscard samplingPatterned1(int elapsed, XLogDiscard discardMode) {
if (elapsed < conf.xlog_patterned_sampling_step1_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned_sampling_step1_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned_sampling_rate_precision)) >= conf.xlog_patterned_sampling_step1_rate_pct) {
discardMode = conf.xlog_patterned_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_patterned_sampling_step2_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned_sampling_step2_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned_sampling_rate_precision)) >= conf.xlog_patterned_sampling_step2_rate_pct) {
discardMode = conf.xlog_patterned_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else if (elapsed < conf.xlog_patterned_sampling_step3_ms) {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned_sampling_step3_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned_sampling_rate_precision)) >= conf.xlog_patterned_sampling_step3_rate_pct) {
discardMode = conf.xlog_patterned_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
} else {
- if (Math.abs(KeyGen.next() % 100) >= conf.xlog_patterned_sampling_over_rate_pct) {
+ if (Math.abs(KeyGen.next() % (100 * conf.xlog_patterned_sampling_rate_precision)) >= conf.xlog_patterned_sampling_over_rate_pct) {
discardMode = conf.xlog_patterned_sampling_only_profile ? XLogDiscard.DISCARD_PROFILE : XLogDiscard.DISCARD_ALL;
}
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpClient40.java b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpClient40.java
index 43e9af45b..155482e71 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpClient40.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpClient40.java
@@ -85,10 +85,12 @@ private void transfer(IHttpClient httpclient, TraceContext ctx, Object host, Obj
httpclient.addHeader(req, conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid));
httpclient.addHeader(req, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash()));
- httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
- httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
- httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
- //httpclient.addHeader(oRtn, B3Constant.B3_HEADER_SAMPLED, "1"); omit means defer
+ if (conf.trace_propagete_b3_header) {
+ httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
+ httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
+ httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
+ //httpclient.addHeader(oRtn, B3Constant.B3_HEADER_SAMPLED, "1"); omit means defer
+ }
PluginHttpCallTrace.call(ctx, req);
} catch (Throwable e) {
Logger.println("A001", e);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpClient43.java b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpClient43.java
index 0347264d4..6a64a4bf5 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpClient43.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpClient43.java
@@ -109,9 +109,11 @@ private void transfer(IHttpClient httpclient, TraceContext ctx, Object host, Obj
httpclient.addHeader(req, conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid));
httpclient.addHeader(req, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash()));
- httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
- httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
- httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
+ if (conf.trace_propagete_b3_header) {
+ httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
+ httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
+ httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
+ }
PluginHttpCallTrace.call(ctx, req);
} catch (Exception e) {
Logger.println("A178", e);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpURLConnection.java b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpURLConnection.java
index 7a7b73063..80648f142 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpURLConnection.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForHttpURLConnection.java
@@ -103,9 +103,11 @@ private void transfer(TraceContext ctx, HttpURLConnection urlCon, long calleeTxi
urlCon.setRequestProperty(conf._trace_interservice_caller_header_key, Hexa32.toString32(ctx.txid));
urlCon.setRequestProperty(conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash()));
- urlCon.setRequestProperty(B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
- urlCon.setRequestProperty(B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
- urlCon.setRequestProperty(B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
+ if (conf.trace_propagete_b3_header) {
+ urlCon.setRequestProperty(B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
+ urlCon.setRequestProperty(B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
+ urlCon.setRequestProperty(B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
+ }
PluginHttpCallTrace.call(ctx, urlCon);
} catch (Throwable t) {
}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForJavaNetHttpClient.java b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForJavaNetHttpClient.java
index dd5972416..67e416ef6 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForJavaNetHttpClient.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForJavaNetHttpClient.java
@@ -98,9 +98,11 @@ void transfer(TraceContext ctx, Object requestBuilder) {
httpclient.addHeader(requestBuilder, conf._trace_interservice_callee_header_key, Hexa32.toString32(ctx.lastCalleeId));
httpclient.addHeader(requestBuilder, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash()));
- httpclient.addHeader(requestBuilder, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
- httpclient.addHeader(requestBuilder, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
- httpclient.addHeader(requestBuilder, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(ctx.lastCalleeId));
+ if (conf.trace_propagete_b3_header) {
+ httpclient.addHeader(requestBuilder, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
+ httpclient.addHeader(requestBuilder, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
+ httpclient.addHeader(requestBuilder, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(ctx.lastCalleeId));
+ }
PluginHttpCallTrace.call(ctx, requestBuilder);
} catch (Exception e) {
Logger.println("A178", e);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForNettyHttpRequest.java b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForNettyHttpRequest.java
index 3cc922fb1..b8cc657e5 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForNettyHttpRequest.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForNettyHttpRequest.java
@@ -89,10 +89,11 @@ private void transfer(IHttpClient httpclient, TraceContext ctx, Object req, long
httpclient.addHeader(req, conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid));
httpclient.addHeader(req, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash()));
- httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
- httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
- httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
-
+ if (conf.trace_propagete_b3_header) {
+ httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
+ httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
+ httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
+ }
PluginHttpCallTrace.call(ctx, httpclient, req);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForRibbonLB.java b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForRibbonLB.java
index 2b6b485a2..4ca0cda27 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForRibbonLB.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForRibbonLB.java
@@ -89,9 +89,11 @@ private void transfer(IHttpClient httpclient, TraceContext ctx, Object req, long
httpclient.addHeader(req, conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid));
httpclient.addHeader(req, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash()));
- httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
- httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
- httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
+ if (conf.trace_propagete_b3_header) {
+ httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
+ httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
+ httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
+ }
PluginHttpCallTrace.call(ctx, httpclient, req);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForWebClient.java b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForWebClient.java
index ae4a33ebf..a70b2408f 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForWebClient.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/trace/api/ForWebClient.java
@@ -141,9 +141,11 @@ private void transfer(IHttpClient httpclient, TraceContext ctx, Object req, long
httpclient.addHeader(req, conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid));
httpclient.addHeader(req, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash()));
- httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
- httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
- httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
+ if (conf.trace_propagete_b3_header) {
+ httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid));
+ httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid));
+ httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid));
+ }
PluginHttpCallTrace.call(ctx, req);
} catch (Exception e) {
Logger.println("A178w", e);
diff --git a/scouter.agent.java/src/main/java/scouter/agent/util/DumpUtil.java b/scouter.agent.java/src/main/java/scouter/agent/util/DumpUtil.java
index 3aec4505e..bd397d0c2 100644
--- a/scouter.agent.java/src/main/java/scouter/agent/util/DumpUtil.java
+++ b/scouter.agent.java/src/main/java/scouter/agent/util/DumpUtil.java
@@ -24,7 +24,12 @@
import scouter.lang.pack.MapPack;
import scouter.lang.pack.Pack;
import scouter.lang.value.ListValue;
-import scouter.util.*;
+import scouter.util.CastUtil;
+import scouter.util.DateUtil;
+import scouter.util.FileUtil;
+import scouter.util.Hexa32;
+import scouter.util.SysJMX;
+import scouter.util.ThreadUtil;
import java.io.File;
import java.io.FileWriter;
@@ -32,7 +37,7 @@
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
-import java.util.Enumeration;
+import java.util.Map;
public class DumpUtil extends Thread {
@@ -138,9 +143,9 @@ public static Pack triggerActiveService() {
File file = DumpUtil.getDumpFile("scouter.activeservice");
out = new PrintWriter(new FileWriter(file));
//TODO reactive support
- Enumeration en = TraceContextManager.getContextEnumeration();
- for (int n = 0; en.hasMoreElements(); n++) {
- TraceContext ctx = en.nextElement();
+ int n = 0;
+ for (Map.Entry e : TraceContextManager.getContextEntries()) {
+ TraceContext ctx = e.getValue();
out.print(n + ":");
out.print(ctx.thread.getId() + ":");
out.print(ctx.thread.getName() + ":");
@@ -160,6 +165,8 @@ public static Pack triggerActiveService() {
printStack(out, ctx.thread.getId());
out.println("");
pack.put("name", file.getName());
+
+ n++;
}
} catch (Throwable e) {
e.printStackTrace();
@@ -256,4 +263,4 @@ public static void autoDumpByCpuExceedance() {
}
-}
\ No newline at end of file
+}
diff --git a/scouter.agent.java/src/main/java/scouter/agent/util/SimpleLru.java b/scouter.agent.java/src/main/java/scouter/agent/util/SimpleLru.java
new file mode 100644
index 000000000..e8e8ea3cb
--- /dev/null
+++ b/scouter.agent.java/src/main/java/scouter/agent/util/SimpleLru.java
@@ -0,0 +1,76 @@
+package scouter.agent.util;
+/*
+ * 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.
+ */
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Created by Gun Lee(gunlee01@gmail.com) on 2021/06/09
+ */
+public class SimpleLru {
+ private final Map accessCache;
+ private final Map creationCache;
+
+
+ final int maxSize;
+ public SimpleLru(final int maxSize) {
+ this.maxSize = maxSize;
+ this.accessCache = new ConcurrentHashMap(maxSize);
+ this.creationCache =
+ new LinkedHashMap(maxSize, 0.75f) {
+ @Override
+ protected boolean removeEldestEntry(Map.Entry eldest) {
+ if (size() > maxSize) {
+ accessCache.remove(eldest.getKey());
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+ };
+ }
+
+ public void put(K key, V value) {
+ this.accessCache.put(key, value);
+ synchronized (this.creationCache) {
+ this.creationCache.put(key, value);
+ }
+ }
+
+ public void remove(K key) {
+ this.accessCache.remove(key);
+ synchronized (this.creationCache) {
+ this.creationCache.remove(key);
+ }
+ }
+
+ public V get(K key) {
+ return this.accessCache.get(key);
+ }
+
+ public int size() {
+ return this.accessCache.size();
+ }
+
+ public Set> entrySet() {
+ return this.accessCache.entrySet();
+ }
+}
diff --git a/scouter.client.build/.project b/scouter.client.build/.project
index c75cf249b..0431ff944 100644
--- a/scouter.client.build/.project
+++ b/scouter.client.build/.project
@@ -1,6 +1,6 @@
- scouter.client.build
+ scouter.client.parent
diff --git a/scouter.client.build/pom.xml b/scouter.client.build/pom.xml
index 9aef78243..639bbde79 100644
--- a/scouter.client.build/pom.xml
+++ b/scouter.client.build/pom.xml
@@ -11,26 +11,17 @@
../scouter.client.product
- 1.3.0
+ 2.3.0
UTF-8
-
-
-
-
-
-
- eclipse-simultaneous-2018-09
- p2
- https://download.eclipse.org/releases/2018-09/
-
-
-
-
-
-
+
+ eclipse-simultaneous-2021-09
+ p2
+ https://download.eclipse.org/releases/2021-09/
+
+
@@ -44,13 +35,8 @@
org.eclipse.tycho
target-platform-configuration
${tycho-version}
-
+
-
- win32
- win32
- x86
-
win32
win32
diff --git a/scouter.client.feature/.project b/scouter.client.feature/.project
index d6ef91a7d..c1181ec72 100644
--- a/scouter.client.feature/.project
+++ b/scouter.client.feature/.project
@@ -1,23 +1,23 @@
-
-
- scouter.client.feature
-
-
-
-
-
- org.eclipse.pde.FeatureBuilder
-
-
-
-
- org.eclipse.m2e.core.maven2Builder
-
-
-
-
-
- org.eclipse.m2e.core.maven2Nature
- org.eclipse.pde.FeatureNature
-
-
+
+
+ scouter.client.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+
+
+ org.eclipse.m2e.core.maven2Nature
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/scouter.client.product/.project b/scouter.client.product/.project
index aa4967d48..d98e9cc2c 100644
--- a/scouter.client.product/.project
+++ b/scouter.client.product/.project
@@ -1,23 +1,17 @@
-
-
- scouter.client.product
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.m2e.core.maven2Builder
-
-
-
-
-
- org.eclipse.m2e.core.maven2Nature
- org.eclipse.jdt.core.javanature
-
-
+
+
+ scouter.client.product
+
+
+
+
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+
+
+ org.eclipse.m2e.core.maven2Nature
+
+
diff --git a/scouter.client.product/scouter.client.product b/scouter.client.product/scouter.client.product
index 4be2f6d2e..75f742c6b 100644
--- a/scouter.client.product/scouter.client.product
+++ b/scouter.client.product/scouter.client.product
@@ -42,7 +42,6 @@
-
@@ -60,11 +59,13 @@
+
+
-
+
diff --git a/scouter.client/.classpath b/scouter.client/.classpath
index 1148c4fd1..e4fbbf4b3 100644
--- a/scouter.client/.classpath
+++ b/scouter.client/.classpath
@@ -1,16 +1,16 @@
-
-
-
-
-
+
+
-
+
+
+
+
diff --git a/scouter.client/.project b/scouter.client/.project
index fa49f5a7a..c61c20c69 100644
--- a/scouter.client/.project
+++ b/scouter.client/.project
@@ -1,34 +1,34 @@
-
-
- scouter.client
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
- org.eclipse.m2e.core.maven2Builder
-
-
-
-
-
- org.eclipse.m2e.core.maven2Nature
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
+
+
+ scouter.client
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+
+
+ org.eclipse.m2e.core.maven2Nature
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/scouter.client/META-INF/MANIFEST.MF b/scouter.client/META-INF/MANIFEST.MF
index 6db1f98f6..959dc555b 100644
--- a/scouter.client/META-INF/MANIFEST.MF
+++ b/scouter.client/META-INF/MANIFEST.MF
@@ -6,7 +6,8 @@ Bundle-Version: 1.0.0.qualifier
Bundle-Activator: scouter.client.Activator
Bundle-Localization: message/localization
Bundle-Vendor: Scouter Project
-Require-Bundle: org.eclipse.ui,
+Require-Bundle:
+ org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.console,
org.eclipse.draw2d,
@@ -20,7 +21,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.databinding.observable,
org.eclipse.core.databinding.property,
org.eclipse.jface.databinding,
- com.ibm.icu
+ com.ibm.icu,
+ org.eclipse.swt,
+ org.eclipse.e4.core.commands,
+ org.eclipse.e4.ui.services
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
diff --git a/scouter.client/icons/object/cubridagent.png b/scouter.client/icons/object/cubridagent.png
new file mode 100755
index 000000000..a52cd20b1
Binary files /dev/null and b/scouter.client/icons/object/cubridagent.png differ
diff --git a/scouter.client/icons/object/cubridagent_inact.png b/scouter.client/icons/object/cubridagent_inact.png
new file mode 100755
index 000000000..b5970c5bf
Binary files /dev/null and b/scouter.client/icons/object/cubridagent_inact.png differ
diff --git a/scouter.client/icons/object/golang.png b/scouter.client/icons/object/golang.png
new file mode 100644
index 000000000..1b05a6435
Binary files /dev/null and b/scouter.client/icons/object/golang.png differ
diff --git a/scouter.client/icons/object/golang_inact.png b/scouter.client/icons/object/golang_inact.png
new file mode 100644
index 000000000..365b62f6e
Binary files /dev/null and b/scouter.client/icons/object/golang_inact.png differ
diff --git a/scouter.client/plugin.xml b/scouter.client/plugin.xml
index 601a8c351..db22eb6f1 100644
--- a/scouter.client/plugin.xml
+++ b/scouter.client/plugin.xml
@@ -61,6 +61,12 @@
id="scouter.client.PerspectiveStackAnalyzer"
name="Stack Frequency Analyzer">
+
+
@@ -1055,6 +1061,70 @@
name="Edit counters-site.xml file directly"
restorable="false">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/scouter.client/pom.xml b/scouter.client/pom.xml
index 621f654e3..7830a0409 100644
--- a/scouter.client/pom.xml
+++ b/scouter.client/pom.xml
@@ -7,8 +7,8 @@
org.apache.maven.plugins
maven-compiler-plugin
-
- 1.8
+
+ 11
@@ -21,4 +21,4 @@
scouter.client
eclipse-plugin
-
\ No newline at end of file
+
diff --git a/scouter.client/src/scouter/client/PerspectiveCubrid.java b/scouter.client/src/scouter/client/PerspectiveCubrid.java
new file mode 100755
index 000000000..5ecc66f70
--- /dev/null
+++ b/scouter.client/src/scouter/client/PerspectiveCubrid.java
@@ -0,0 +1,107 @@
+/*
+ * 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.client;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+import org.eclipse.ui.console.IConsoleConstants;
+
+import scouter.util.DateUtil;
+
+import scouter.client.group.view.GroupNavigationView;
+import scouter.client.server.Server;
+import scouter.client.server.ServerManager;
+import scouter.client.views.AlertView;
+import scouter.client.views.ObjectDailyListView;
+import scouter.client.views.ObjectNavigationView;
+import scouter.client.views.WorkspaceExplorer;
+
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.cubrid.views.CubridSingleRealTimeMultiView;
+import scouter.client.cubrid.views.CubridSpaceDbView;
+import scouter.client.cubrid.views.CubridLongTransactionList;
+import scouter.client.cubrid.views.CubridRealtimeDmlView;
+import scouter.client.cubrid.views.CubridServerInfoView;
+
+public class PerspectiveCubrid implements IPerspectiveFactory {
+
+ public static final String ID = PerspectiveCubrid.class.getName();
+
+ public void createInitialLayout(IPageLayout layout) {
+ String editorArea = layout.getEditorArea();
+ layout.setEditorAreaVisible(false);
+
+ Server server = ServerManager.getInstance().getDefaultServer();
+ int serverId = server.getId();;
+
+ IFolderLayout agentLayout = layout.createFolder("perspective.database.objnavigation", IPageLayout.LEFT, 0.3f, editorArea);
+ agentLayout.addPlaceholder(ObjectNavigationView.ID + ":*");
+ agentLayout.addPlaceholder(ObjectDailyListView.ID + ":*");
+ agentLayout.addPlaceholder(WorkspaceExplorer.ID);
+ agentLayout.addPlaceholder(GroupNavigationView.ID);
+ agentLayout.addView(ObjectNavigationView.ID);
+ layout.getViewLayout(ObjectNavigationView.ID).setCloseable(false);
+
+ IFolderLayout consoleLayout = layout.createFolder("perspective.database.console", IPageLayout.BOTTOM, 0.5f, "perspective.database.objnavigation");
+ consoleLayout.addView(IConsoleConstants.ID_CONSOLE_VIEW);
+
+ IFolderLayout alertLayout = layout.createFolder("perspective.database.alert", IPageLayout.TOP, 0.5f, "perspective.database.console");
+ alertLayout.addView(AlertView.ID);
+
+ IFolderLayout layout1 = layout.createFolder("perspective.cubrid.serverinfo", IPageLayout.LEFT, 0.4f, editorArea);
+ layout1.addView(CubridServerInfoView.ID + ":" + serverId);
+ layout.getViewLayout(CubridServerInfoView.ID + ":" + serverId).setCloseable(false);
+
+ IFolderLayout layout3 = layout.createFolder("perspective.cubrid.multiview.xaslplan", IPageLayout.BOTTOM, 0.2f, "perspective.cubrid.serverinfo");
+ layout3.addView(CubridSingleRealTimeMultiView.ID + ":" + serverId + "&" + "default"
+ + "&" + CubridSingleItem.XASL_PLAN_HIT_RATE.ordinal() + "&" + DateUtil.MILLIS_PER_TEN_MINUTE);
+
+ IFolderLayout layout4 = layout.createFolder("perspective.cubrid.multiview.tps", IPageLayout.BOTTOM, 0.3f, "perspective.cubrid.multiview.xaslplan");
+ layout4.addView(CubridSingleRealTimeMultiView.ID + ":" + serverId + "&" + "default"
+ + "&" + CubridSingleItem.TPS.ordinal() + "&" + DateUtil.MILLIS_PER_TEN_MINUTE);
+
+ IFolderLayout layout5 = layout.createFolder("perspective.cubrid.multiview.qps", IPageLayout.BOTTOM, 0.5f, "perspective.cubrid.multiview.tps");
+ layout5.addView(CubridSingleRealTimeMultiView.ID + ":" + serverId + "&" + "default"
+ + "&" + CubridSingleItem.QPS.ordinal() + "&" + DateUtil.MILLIS_PER_TEN_MINUTE);
+
+ IFolderLayout layout6 = layout.createFolder("perspective.cubrid.mutiview.pagefetches", IPageLayout.RIGHT, 0.3f, editorArea);
+ layout6.addView(CubridSingleRealTimeMultiView.ID + ":" + serverId + "&" + "default"
+ + "&" + CubridSingleItem.DATA_PAGE_FETCHES.ordinal() + "&" + DateUtil.MILLIS_PER_TEN_MINUTE);
+
+ IFolderLayout layout7 = layout.createFolder("perspective.cubrid.longtran", IPageLayout.BOTTOM, 0.3f, "perspective.cubrid.mutiview.pagefetches");
+ layout7.addView(CubridLongTransactionList.ID + ":" + serverId + "&" + "default");
+
+ IFolderLayout layout8 = layout.createFolder("perspective.cubrid.mutiview.pageiowrite", IPageLayout.TOP, 0.3f, "perspective.cubrid.longtran");
+ layout8.addView(CubridSingleRealTimeMultiView.ID + ":" + serverId + "&" + "default"
+ + "&" + CubridSingleItem.DATA_PAGE_IO_WRITES.ordinal() + "&" + DateUtil.MILLIS_PER_TEN_MINUTE);
+
+ IFolderLayout layout9 = layout.createFolder("perspective.cubrid.dmlview", IPageLayout.BOTTOM, 0.4f, "perspective.cubrid.longtran");
+ layout9.addView(CubridRealtimeDmlView.ID + ":" + serverId + "&" + "default");
+
+ IFolderLayout layout2 = layout.createFolder("perspective.cubrid.dbspaceinfo", IPageLayout.RIGHT, 0.5f, "perspective.cubrid.serverinfo");
+ layout2.addView(CubridSpaceDbView.ID + ":" + serverId + "&" + "default");
+
+ layout.addPerspectiveShortcut(getId());
+
+ }
+
+ public static String getId() {
+ return ID;
+ }
+}
diff --git a/scouter.client/src/scouter/client/actions/OpenVerticalEQGroupViewAction.java b/scouter.client/src/scouter/client/actions/OpenVerticalEQGroupViewAction.java
index ad0b25a53..cb7eb4899 100644
--- a/scouter.client/src/scouter/client/actions/OpenVerticalEQGroupViewAction.java
+++ b/scouter.client/src/scouter/client/actions/OpenVerticalEQGroupViewAction.java
@@ -1,51 +1,51 @@
-/*
+/*
* 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.client.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-
-import scouter.client.Images;
-import scouter.client.group.view.VerticalEQGroupView;
-
-public class OpenVerticalEQGroupViewAction extends Action {
- public final static String ID = OpenVerticalEQGroupViewAction.class.getName();
-
- private final IWorkbenchWindow window;
- String grpName;
-
- public OpenVerticalEQGroupViewAction(IWorkbenchWindow window, String grpName) {
- this.window = window;
- this.grpName = grpName;
- setText("Active Service Vertical EQ");
- setId(ID);
- setImageDescriptor(Images.XY_YMIN);
- }
-
- public void run() {
- if (window != null) {
- try {
- window.getActivePage().showView(VerticalEQGroupView.ID, grpName, IWorkbenchPage.VIEW_ACTIVATE);
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- }
- }
-}
+ * @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.client.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+import scouter.client.Images;
+import scouter.client.group.view.VerticalEQGroupView;
+
+public class OpenVerticalEQGroupViewAction extends Action {
+ public final static String ID = OpenVerticalEQGroupViewAction.class.getName();
+
+ private final IWorkbenchWindow window;
+ String grpName;
+
+ public OpenVerticalEQGroupViewAction(IWorkbenchWindow window, String grpName) {
+ this.window = window;
+ this.grpName = grpName;
+ setText("Active Service Vertical EQ");
+ setId(ID);
+ setImageDescriptor(Images.XY_YMIN);
+ }
+
+ public void run() {
+ if (window != null) {
+ try {
+ window.getActivePage().showView(VerticalEQGroupView.ID, grpName, IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/scouter.client/src/scouter/client/actions/OpenVerticalEQViewAction.java b/scouter.client/src/scouter/client/actions/OpenVerticalEQViewAction.java
index 9a50643de..bddbdc1b5 100644
--- a/scouter.client/src/scouter/client/actions/OpenVerticalEQViewAction.java
+++ b/scouter.client/src/scouter/client/actions/OpenVerticalEQViewAction.java
@@ -1,53 +1,53 @@
-/*
+/*
* 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.client.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-
-import scouter.client.Images;
-import scouter.client.views.VerticalEQView;
-
-public class OpenVerticalEQViewAction extends Action {
- public final static String ID = OpenVerticalEQViewAction.class.getName();
-
- private final IWorkbenchWindow window;
- int serverId;
- String objType;
-
- public OpenVerticalEQViewAction(IWorkbenchWindow window, int serverId, String objType) {
- this.window = window;
- this.serverId = serverId;
- this.objType = objType;
- setText("Active Service Vertical EQ");
- setId(ID);
- setImageDescriptor(Images.XY_YMIN);
- }
-
- public void run() {
- if (window != null) {
- try {
- window.getActivePage().showView(VerticalEQView.ID, serverId + "&" + objType, IWorkbenchPage.VIEW_ACTIVATE);
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- }
- }
-}
+ * @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.client.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+import scouter.client.Images;
+import scouter.client.views.VerticalEQView;
+
+public class OpenVerticalEQViewAction extends Action {
+ public final static String ID = OpenVerticalEQViewAction.class.getName();
+
+ private final IWorkbenchWindow window;
+ int serverId;
+ String objType;
+
+ public OpenVerticalEQViewAction(IWorkbenchWindow window, int serverId, String objType) {
+ this.window = window;
+ this.serverId = serverId;
+ this.objType = objType;
+ setText("Active Service Vertical EQ");
+ setId(ID);
+ setImageDescriptor(Images.XY_YMIN);
+ }
+
+ public void run() {
+ if (window != null) {
+ try {
+ window.getActivePage().showView(VerticalEQView.ID, serverId + "&" + objType, IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/scouter.client/src/scouter/client/constants/MenuStr.java b/scouter.client/src/scouter/client/constants/MenuStr.java
index 0ee1ce12e..ffec7853e 100644
--- a/scouter.client/src/scouter/client/constants/MenuStr.java
+++ b/scouter.client/src/scouter/client/constants/MenuStr.java
@@ -1,8 +1,8 @@
/*
- * Copyright 2015 the original author or authors.
+ * Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -12,206 +12,216 @@
* 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.
+ * limitations under the License.
*
*/
package scouter.client.constants;
public class MenuStr {
-
+
// @ObjectNavigationView.java - ServerObject
- public static final String TIME_ALL = "Time All";
- public static final String TIME_ALL_ID = "scouter.client.contextmenu.serverobject.timeallcounter";
- public static final String DAILY_ALL = "Daily All";
- public static final String DAILY_ALL_ID = "scouter.client.contextmenu.serverobject.dailyallcounter";
- public static final String TIME_TOTAL = "Time Total";
- public static final String TIME_TOTAL_ID = "scouter.client.contextmenu.serverobject.timetotalcounter";
- public static final String DAILY_TOTAL = "Daily Total";
- public static final String DAILY_TOTAL_ID = "scouter.client.contextmenu.serverobject.dailytotalcounter";
-
- public static final String STATUS_DASHBOARD_REAL = "Status Dashboard";
- public static final String ALERT_REAL = "Alert";
-
- public static final String ACTIVE_SPEED_REAL = "Active Speed";
- public static final String ACTIVE_SPEED_REAL_ID = "scouter.client.actions.counter.activespeed";
-
+ public static final String TIME_ALL = "Time All";
+ public static final String TIME_ALL_ID = "scouter.client.contextmenu.serverobject.timeallcounter";
+ public static final String DAILY_ALL = "Daily All";
+ public static final String DAILY_ALL_ID = "scouter.client.contextmenu.serverobject.dailyallcounter";
+ public static final String TIME_TOTAL = "Time Total";
+ public static final String TIME_TOTAL_ID = "scouter.client.contextmenu.serverobject.timetotalcounter";
+ public static final String DAILY_TOTAL = "Daily Total";
+ public static final String DAILY_TOTAL_ID = "scouter.client.contextmenu.serverobject.dailytotalcounter";
+
+ public static final String STATUS_DASHBOARD_REAL = "Status Dashboard";
+ public static final String ALERT_REAL = "Alert";
+
+ public static final String ACTIVE_SPEED_REAL = "Active Speed";
+ public static final String ACTIVE_SPEED_REAL_ID = "scouter.client.actions.counter.activespeed";
+
public static final String SERVICE_COUNT = "24H Service Count";
- public static final String SERVICE_COUNT_ID = "scouter.client.actions.counter.servicecount";
-
+ public static final String SERVICE_COUNT_ID = "scouter.client.actions.counter.servicecount";
+
public static final String HOURLY_CHART = "Hourly Chart";
- public static final String HOURLY_CHART_ID = "scouter.client.actions.counter.hourlychart";
-
- public static final String TODAY_SERVICE_COUNT = "Today Service Count";
- public static final String TODAY_SERVICE_COUNT_ID = "scouter.client.actions.counter.todayservicecount";
-
+ public static final String HOURLY_CHART_ID = "scouter.client.actions.counter.hourlychart";
+
+ public static final String TODAY_SERVICE_COUNT = "Today Service Count";
+ public static final String TODAY_SERVICE_COUNT_ID = "scouter.client.actions.counter.todayservicecount";
+
public static final String XLOG = "XLog";
- public static final String XLOG_ID = "scouter.client.actions.counter.XLog";
-
+ public static final String XLOG_ID = "scouter.client.actions.counter.XLog";
+
public static final String REALTIME_XLOG = "Realtime XLog";
- public static final String REALTIME_XLOG_ID = "scouter.client.actions.counter.realTimeXLog";
-
- public static final String PASTTIME_XLOG = "Pasttime XLog";
- public static final String PASTTIME_XLOG_ID = "scouter.client.actions.counter.loadTimeXLog";
-
- public static final String DIGITAL_COUNT = "Digital Count";
- public static final String DIGITAL_COUNT_ID = "scouter.client.menu.performance.real.digitalcount";
-
- public static final String LOAD_SERVICE_COUNT = "Load Service Count ";
- public static final String LOAD_SERVICE_COUNT_ID = "scouter.client.actions.counter.loadservicecount";
-
- public static final String OTHER_REAL_PERFORMANCE_VIEWS = "other Real Performance views...";
- public static final String OTHER_REAL_PERFORMANCE_VIEWS_ID = "scouter.client.menu.performance.real.other";
-
- public static final String OTHER_PAST_PERFORMANCE_VIEWS = "other Past Performance views...";
- public static final String OTHER_PAST_PERFORMANCE_VIEWS_ID = "scouter.client.menu.performance.past.other";
-
- public static final String OBJECT_MANAGER = "Object Manager";
- public static final String ALERT_HISTORY = "Alert History";
- public static final String ALERT_HISTORY_ID = "scouter.client.menu.statistics.alert";
-
- public static final String BY_LEVEL = "By Level";
- public static final String BY_TITLE = "By Title";
- public static final String ALERT_DETAIL_LIST = "Alert Detail List";
-
- public static final String SERVER_THREAD_LIST = "Server Thread List";
-
- public static final String CURRENT_LOGIN_LIST = "Current Login List";
-
- public static final String FILE_MANAGEMENT = "File Management";
-
- public static final String STATISTICS = "Statistics";
- public static final String STATISTICS_ID = "scouter.client.statistics";
-
- public static final String REPORT = "Report";
- public static final String REPORT_ID = "scouter.client.report";
-
- public static final String DAILY_STATISTICS = "Daily Statistics";
- public static final String DAILY_STATISTICS_ID = "scouter.client.statistics.daily";
-
- public static final String SERVICE_SUMMARY = "Summary";
- public static final String SERVICE_SUMMARY_ID = "scouter.client.summary.service";
- public static final String HOURLY_SERVICE = "Hourly Service";
- public static final String SHORT_TIME_SERVICE = "Short Time Service";
- public static final String SQL_SUMMARY = "SQL Summary";
- public static final String SQL_SUMMARY_ID = "scouter.client.summary.sql";
- public static final String HOURLY_SQL = "Hourly SQL";
- public static final String HOURLY_APP_SQL = "Hourly Service/SQL";
- public static final String HOURLY_APICALL = "Hourly API Call";
- public static final String HOURLY_APP_APICALL = "Hourly Service/API Call";
- public static final String HOURLY_IP = "Hourly IP";
-
- public static final String COMPARE_OBJECT = "Compare Object";
-
- public static final String EXPORT_TO_WORKSPACE_S = "Export to Workspace";
- public static final String EXPORT_TO_WORKSPACE_S_ID = "scouter.client.statistics.export";
-
- public static final String EXPORT_DAILY_APP_SUMMARY = "Export Daily App Summary";
- public static final String EXPORT_ALERT_HISTORY = "Export Alert History (Max:1000)";
-
- public static final String EXPORT_ALL = "Export all...";
- public static final String EXPORT_ALL_ID = "scouter.client.export.all";
-
- public static final String CONFIGURATIONS = "Configurations";
- public static final String CONFIGURATIONS_ID = "scouter.client.configure";
-
- public static final String MANAGEMENT = "Management";
- public static final String MANAGEMENT_ID = "scouter.client.management";
-
- public static final String SERVER = "Server";
-
- public static final String ALERT_RULE = "Alert Rule";
-
- public static final String COUNTER = "Counter";
-
- public static final String COUNTER_DESIGNER = "Counter Designer";
-
- public static final String ACCOUNT = "Account";
- public static final String ACCOUNT_ID = "scouter.client.account";
-
- public static final String LIVE_CHART = "Live";
- public static final String LOAD_CHART = "Load";
-
-
- public static final String PERFORMANCE_COUNTER = "Performance Counter";
- public static final String PERFORMANCE_COUNTER_ID = "scouter.client.contextmenu.agentobject.performanceCounter";
+ public static final String REALTIME_XLOG_ID = "scouter.client.actions.counter.realTimeXLog";
+
+ public static final String PASTTIME_XLOG = "Pasttime XLog";
+ public static final String PASTTIME_XLOG_ID = "scouter.client.actions.counter.loadTimeXLog";
+
+ public static final String DIGITAL_COUNT = "Digital Count";
+ public static final String DIGITAL_COUNT_ID = "scouter.client.menu.performance.real.digitalcount";
+
+ public static final String LOAD_SERVICE_COUNT = "Load Service Count ";
+ public static final String LOAD_SERVICE_COUNT_ID = "scouter.client.actions.counter.loadservicecount";
+
+ public static final String OTHER_REAL_PERFORMANCE_VIEWS = "other Real Performance views...";
+ public static final String OTHER_REAL_PERFORMANCE_VIEWS_ID = "scouter.client.menu.performance.real.other";
+
+ public static final String OTHER_PAST_PERFORMANCE_VIEWS = "other Past Performance views...";
+ public static final String OTHER_PAST_PERFORMANCE_VIEWS_ID = "scouter.client.menu.performance.past.other";
+
+ public static final String OBJECT_MANAGER = "Object Manager";
+ public static final String ALERT_HISTORY = "Alert History";
+ public static final String ALERT_HISTORY_ID = "scouter.client.menu.statistics.alert";
+
+ public static final String BY_LEVEL = "By Level";
+ public static final String BY_TITLE = "By Title";
+ public static final String ALERT_DETAIL_LIST = "Alert Detail List";
+
+ public static final String SERVER_THREAD_LIST = "Server Thread List";
+
+ public static final String CURRENT_LOGIN_LIST = "Current Login List";
+
+ public static final String FILE_MANAGEMENT = "File Management";
+
+ public static final String STATISTICS = "Statistics";
+ public static final String STATISTICS_ID = "scouter.client.statistics";
+
+ public static final String REPORT = "Report";
+ public static final String REPORT_ID = "scouter.client.report";
+
+ public static final String DAILY_STATISTICS = "Daily Statistics";
+ public static final String DAILY_STATISTICS_ID = "scouter.client.statistics.daily";
+
+ public static final String SERVICE_SUMMARY = "Summary";
+ public static final String SERVICE_SUMMARY_ID = "scouter.client.summary.service";
+ public static final String HOURLY_SERVICE = "Hourly Service";
+ public static final String SHORT_TIME_SERVICE = "Short Time Service";
+ public static final String SQL_SUMMARY = "SQL Summary";
+ public static final String SQL_SUMMARY_ID = "scouter.client.summary.sql";
+ public static final String HOURLY_SQL = "Hourly SQL";
+ public static final String HOURLY_APP_SQL = "Hourly Service/SQL";
+ public static final String HOURLY_APICALL = "Hourly API Call";
+ public static final String HOURLY_APP_APICALL = "Hourly Service/API Call";
+ public static final String HOURLY_IP = "Hourly IP";
+
+ public static final String COMPARE_OBJECT = "Compare Object";
+
+ public static final String EXPORT_TO_WORKSPACE_S = "Export to Workspace";
+ public static final String EXPORT_TO_WORKSPACE_S_ID = "scouter.client.statistics.export";
+
+ public static final String EXPORT_DAILY_APP_SUMMARY = "Export Daily App Summary";
+ public static final String EXPORT_ALERT_HISTORY = "Export Alert History (Max:1000)";
+
+ public static final String EXPORT_ALL = "Export all...";
+ public static final String EXPORT_ALL_ID = "scouter.client.export.all";
+
+ public static final String CONFIGURATIONS = "Configurations";
+ public static final String CONFIGURATIONS_ID = "scouter.client.configure";
+
+ public static final String MANAGEMENT = "Management";
+ public static final String MANAGEMENT_ID = "scouter.client.management";
+
+ public static final String SERVER = "Server";
+
+ public static final String ALERT_RULE = "Alert Rule";
+
+ public static final String COUNTER = "Counter";
+
+ public static final String COUNTER_DESIGNER = "Counter Designer";
+
+ public static final String ACCOUNT = "Account";
+ public static final String ACCOUNT_ID = "scouter.client.account";
+
+ public static final String LIVE_CHART = "Live";
+ public static final String LOAD_CHART = "Load";
+
+
+ public static final String PERFORMANCE_COUNTER = "Performance Counter";
+ public static final String PERFORMANCE_COUNTER_ID = "scouter.client.contextmenu.agentobject.performanceCounter";
public static final String PERFORMANCE_REQUEST = "Object Request";
- public static final String PERFORMANCE_REQUEST_ID = "scouter.client.contextmenu.agentobject.request";
-
-
-
- public static final String TIME_COUNTER = "Time";
- public static final String TIME_COUNTER_ID = "scouter.client.contextmenu.agentobject.timecounter";
- public static final String DAILY_COUNTER = "Daily";
- public static final String DAILY_COUNTER_ID = "scouter.client.contextmenu.agentobject.dailycounter";
-
- public static final String THREAD_LIST = "Thread List";
- public static final String THREAD_LIST_ID = "scouter.client.contextmenu.agentobject.threadlist";
-
- public static final String ACTIVE_SERVICE_LIST = "Active Service List";
- public static final String ACTIVE_SERVICE_LIST_ID = "scouter.client.contextmenu.agentobject.activeservicelist";
-
- public static final String LOADED_CLASS_LIST = "Loaded Class List";
- public static final String LOADED_CLASS_LIST_ID = "scouter.client.contextmenu.agentobject.loadedclasslist";
-
- public static final String HEAP_HISTOGRAM = "Heap Histogram";
- public static final String HEAP_HISTOGRAM_ID = "scouter.client.contextmenu.agentobject.heaphistogram";
-
- public static final String HEAP_DUMP = "Heap Dump";
- public static final String HEAP_DUMP_ID = "scouter.client.contextmenu.agentobject.heapdump";
- public static final String HEAP_DUMP_RUN = "Run Heap Dump";
- public static final String HEAP_DUMP_LIST = "List Heap Dump";
-
- public static final String THREAD_DUMP = "Thread Dump";
- public static final String THREAD_DUMP_ID = "scouter.client.contextmenu.agentobject.threaddump";
-
- public static final String ENV = "Env";
- public static final String ENV_ID = "scouter.client.contextmenu.agentobject.env";
-
- public static final String FILE_SOCKET = "File Socket";
- public static final String FILE_SOCKET_ID = "scouter.client.contextmenu.agentobject.filesocket";
-
- public static final String RESET_CACHE = "Reset Cache";
- public static final String RESET_CACHE_ID = "scouter.client.contextmenu.agentobject.resetcache";
-
- public static final String CONFIGURE = "Configure";
- public static final String CONFIGURE_ID = "scouter.client.contextmenu.agentobject.configure";
+ public static final String PERFORMANCE_REQUEST_ID = "scouter.client.contextmenu.agentobject.request";
- public static final String SERVER_CONFIGURES = "Configures";
- public static final String SERVER_CONFIGURES_ID = "scouter.client.contextmenu.server.configures";
- public static final String TELEGRAF_CONFIGURE = "Telegraf Configure";
- public static final String TELEGRAF_FILE_CONFIGURE = "Edit telegraf file directly";
- public static final String COUNTERS_SITE_FILE_CONFIGURE = "Edit counters.site.xml file";
+ public static final String TIME_COUNTER = "Time";
+ public static final String TIME_COUNTER_ID = "scouter.client.contextmenu.agentobject.timecounter";
+ public static final String DAILY_COUNTER = "Daily";
+ public static final String DAILY_COUNTER_ID = "scouter.client.contextmenu.agentobject.dailycounter";
- public static final String ALERT_SCRIPTING = "Customizable Alert";
- public static final String ALERT_SCRIPTING_ID = "scouter.client.alertScripting";
-
- public static final String PROPERTIES = "Properties";
- public static final String PROPERTIES_ID = "scouter.client.contextmenu.agentobject.properties";
-
- public static final String EXPORT_TO_WORKSPACE = "Export to Workspace";
- public static final String EXPORT_TO_WORKSPACE_ID = "scouter.client.contextmenu.agentobject.exporttoworkspace";
- public static final String EXPORT_TIME_COUNTER = "Export Time Counter";
- public static final String EXPORT_DAILY_COUNTER = "Export Daily Counter";
- public static final String EXPORT_LOADTIME_COUNTER = "Export LoadTime Counter";
- public static final String EXPORT_LOADDATE_COUNTER = "Export LoadDate Counter";
-
- public static final String FILEDUMP = "File Dump";
- public static final String FILEDUMP_ID = "scouter.client.contextmenu.agentobject.filedump";
- public static final String STACK_ANALYZER = "Stack Frequency Analyzer";
- public static final String STACK_ANALYZER_ID = "scouter.client.contextmenu.agentobject.stack";
- public static final String DUMP_ACTIVE_SERVICE_LIST = "Dump Active Service List";
- public static final String DUMP_THREAD_DUMP = "Dump Thread Dump";
- public static final String DUMP_THREAD_LIST = "Dump Thread List";
- public static final String DUMP_HEAPHISTO = "Dump Heaphisto";
- public static final String LIST_DUMP_FILES = "List Dump Files";
- public static final String SYSTEM_GC = "System.GC";
- public static final String TOP = "Top";
- public static final String DISK_USAGE = "Disk Usage";
- public static final String NET_STAT = "Net Stat";
- public static final String WHO = "Who";
- public static final String MEM_INFO = "Mem Info";
+ public static final String THREAD_LIST = "Thread List";
+ public static final String THREAD_LIST_ID = "scouter.client.contextmenu.agentobject.threadlist";
+
+ public static final String ACTIVE_SERVICE_LIST = "Active Service List";
+ public static final String ACTIVE_SERVICE_LIST_ID = "scouter.client.contextmenu.agentobject.activeservicelist";
+
+ public static final String LOADED_CLASS_LIST = "Loaded Class List";
+ public static final String LOADED_CLASS_LIST_ID = "scouter.client.contextmenu.agentobject.loadedclasslist";
+
+ public static final String HEAP_HISTOGRAM = "Heap Histogram";
+ public static final String HEAP_HISTOGRAM_ID = "scouter.client.contextmenu.agentobject.heaphistogram";
+
+ public static final String HEAP_DUMP = "Heap Dump";
+ public static final String BINARY_DUMP = "Binary File Dump";
+ public static final String HEAP_DUMP_ID = "scouter.client.contextmenu.agentobject.heapdump";
+ public static final String HEAP_DUMP_RUN = "Run Heap Dump";
+ public static final String HEAP_DUMP_LIST = "List Heap Dump";
+ public static final String BINARY_DUMP_LIST = "List Binary Dump";
+ public static final String CPU_PROFILE_DUMP_RUN = "Run CPU Profile Dump(Pending 30s)";
+ public static final String BLOCK_PROFILE_DUMP_RUN = "Run Block Profile Dump(Pending 30s)";
+ public static final String MUTEX_PROFILE_DUMP_RUN = "Run Mutex Profile Dump(Pending 30s)";
+
+ public static final String THREAD_DUMP = "Thread Dump";
+ public static final String THREAD_DUMP_ID = "scouter.client.contextmenu.agentobject.threaddump";
+
+ public static final String ENV = "Env";
+ public static final String ENV_ID = "scouter.client.contextmenu.agentobject.env";
+
+ public static final String FILE_SOCKET = "File Socket";
+ public static final String FILE_SOCKET_ID = "scouter.client.contextmenu.agentobject.filesocket";
+
+ public static final String RESET_CACHE = "Reset Cache";
+ public static final String RESET_CACHE_ID = "scouter.client.contextmenu.agentobject.resetcache";
+
+ public static final String CONFIGURE = "Configure";
+ public static final String CONFIGURE_ID = "scouter.client.contextmenu.agentobject.configure";
+
+ public static final String SERVER_CONFIGURES = "Configures";
+ public static final String SERVER_CONFIGURES_ID = "scouter.client.contextmenu.server.configures";
+
+ public static final String TELEGRAF_CONFIGURE = "Telegraf Configure";
+ public static final String TELEGRAF_FILE_CONFIGURE = "Edit telegraf file directly";
+ public static final String COUNTERS_SITE_FILE_CONFIGURE = "Edit counters.site.xml file";
+
+ public static final String ALERT_SCRIPTING = "Customizable Alert";
+ public static final String ALERT_SCRIPTING_ID = "scouter.client.alertScripting";
+
+ public static final String PROPERTIES = "Properties";
+ public static final String PROPERTIES_ID = "scouter.client.contextmenu.agentobject.properties";
+
+ public static final String EXPORT_TO_WORKSPACE = "Export to Workspace";
+ public static final String EXPORT_TO_WORKSPACE_ID = "scouter.client.contextmenu.agentobject.exporttoworkspace";
+ public static final String EXPORT_TIME_COUNTER = "Export Time Counter";
+ public static final String EXPORT_DAILY_COUNTER = "Export Daily Counter";
+ public static final String EXPORT_LOADTIME_COUNTER = "Export LoadTime Counter";
+ public static final String EXPORT_LOADDATE_COUNTER = "Export LoadDate Counter";
+
+ public static final String FILEDUMP = "File Dump";
+ public static final String FILEDUMP_ID = "scouter.client.contextmenu.agentobject.filedump";
+ public static final String STACK_ANALYZER = "Stack Frequency Analyzer";
+ public static final String STACK_ANALYZER_ID = "scouter.client.contextmenu.agentobject.stack";
+ public static final String DUMP_ACTIVE_SERVICE_LIST = "Dump Active Service List";
+ public static final String DUMP_THREAD_DUMP = "Dump Thread Dump";
+ public static final String DUMP_GOROUTINE_DUMP = "Dump Goroutine Dump";
+ public static final String DUMP_BLOCK_PROFILE = "Dump Block Profile";
+ public static final String DUMP_MUTEX_PROFILE = "Dump Mutex Profile";
+ public static final String DUMP_THREAD_LIST = "Dump Thread List";
+ public static final String DUMP_HEAPHISTO = "Dump Heaphisto";
+ public static final String LIST_DUMP_FILES = "List Dump Files";
+ public static final String SYSTEM_GC = "System.GC";
+ public static final String TOP = "Top";
+ public static final String DISK_USAGE = "Disk Usage";
+ public static final String NET_STAT = "Net Stat";
+ public static final String WHO = "Who";
+ public static final String MEM_INFO = "Mem Info";
+
+ public static final String BATCH_HISTORY = "Batch History";
+ public static final String BATCH_ACTIVE_LIST = "Batch Active List";
- public static final String BATCH_HISTORY = "Batch History";
- public static final String BATCH_ACTIVE_LIST = "Batch Active List";
+ public static final String CUBRID_DB_LIST_VIEW = "DB List View";
+ public static final String CUBRID_DB_LIST_VIEW_ID = "scouter.client.contextmenu.agentobject.cubriddblistview";
}
diff --git a/scouter.client/src/scouter/client/context/actions/OpenCxtmenuProfileBlockAction.java b/scouter.client/src/scouter/client/context/actions/OpenCxtmenuProfileBlockAction.java
new file mode 100644
index 000000000..f9e911a1c
--- /dev/null
+++ b/scouter.client/src/scouter/client/context/actions/OpenCxtmenuProfileBlockAction.java
@@ -0,0 +1,63 @@
+/*
+ * 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.client.context.actions;
+
+import org.eclipse.jface.action.Action;
+import scouter.client.net.TcpProxy;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ExUtil;
+import scouter.lang.pack.MapPack;
+import scouter.lang.pack.Pack;
+import scouter.net.RequestCmd;
+import scouter.util.StringUtil;
+
+public class OpenCxtmenuProfileBlockAction extends Action {
+ public final static String ID = OpenCxtmenuProfileBlockAction.class.getName();
+
+ private int objHash;
+ private int serverId;
+ public OpenCxtmenuProfileBlockAction(String label, int objHash, int serverId) {
+ this.objHash = objHash;
+ this.serverId = serverId;
+ setText(label);
+ }
+
+ public void run() {
+ ExUtil.asyncRun(new Runnable() {
+ public void run() {
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ try {
+ MapPack param = new MapPack();
+ param.put("objHash", objHash);
+ Pack p = tcp.getSingle(RequestCmd.TRIGGER_BLOCK_PROFILE, param);
+ if (p != null && p instanceof MapPack) {
+ MapPack m = (MapPack) p;
+ String filename = m.getText("name");
+ if (StringUtil.isNotEmpty(filename)) {
+ ConsoleProxy.infoSafe("Dump complete : " + filename);
+ return;
+ }
+ }
+ ConsoleProxy.errorSafe("Dump failed");
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ }
+ });
+ }
+}
diff --git a/scouter.client/src/scouter/client/context/actions/OpenCxtmenuProfileMutexAction.java b/scouter.client/src/scouter/client/context/actions/OpenCxtmenuProfileMutexAction.java
new file mode 100644
index 000000000..0843afec8
--- /dev/null
+++ b/scouter.client/src/scouter/client/context/actions/OpenCxtmenuProfileMutexAction.java
@@ -0,0 +1,63 @@
+/*
+ * 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.client.context.actions;
+
+import org.eclipse.jface.action.Action;
+import scouter.client.net.TcpProxy;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ExUtil;
+import scouter.lang.pack.MapPack;
+import scouter.lang.pack.Pack;
+import scouter.net.RequestCmd;
+import scouter.util.StringUtil;
+
+public class OpenCxtmenuProfileMutexAction extends Action {
+ public final static String ID = OpenCxtmenuProfileMutexAction.class.getName();
+
+ private int objHash;
+ private int serverId;
+ public OpenCxtmenuProfileMutexAction(String label, int objHash, int serverId) {
+ this.objHash = objHash;
+ this.serverId = serverId;
+ setText(label);
+ }
+
+ public void run() {
+ ExUtil.asyncRun(new Runnable() {
+ public void run() {
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ try {
+ MapPack param = new MapPack();
+ param.put("objHash", objHash);
+ Pack p = tcp.getSingle(RequestCmd.TRIGGER_MUTEX_PROFILE, param);
+ if (p != null && p instanceof MapPack) {
+ MapPack m = (MapPack) p;
+ String filename = m.getText("name");
+ if (StringUtil.isNotEmpty(filename)) {
+ ConsoleProxy.infoSafe("Dump complete : " + filename);
+ return;
+ }
+ }
+ ConsoleProxy.errorSafe("Dump failed");
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ }
+ });
+ }
+}
diff --git a/scouter.client/src/scouter/client/cubrid/ActiveDbInfo.java b/scouter.client/src/scouter/client/cubrid/ActiveDbInfo.java
new file mode 100755
index 000000000..b4016cb13
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/ActiveDbInfo.java
@@ -0,0 +1,103 @@
+/*
+ * 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.client.cubrid;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Set;
+
+import scouter.util.HashUtil;
+
+public class ActiveDbInfo {
+
+ private static ActiveDbInfo instance;
+
+ private static Hashtable dbInfo = new Hashtable<>();
+
+ public synchronized static ActiveDbInfo getInstance() {
+ if (instance == null) {
+ instance = new ActiveDbInfo();
+ }
+ return instance;
+ }
+
+ private ActiveDbInfo() {
+ }
+
+ public ArrayList getDbList() {
+ ArrayList dbList = new ArrayList<>();
+ for (String dbName : dbInfo.keySet()) {
+ dbList.add(dbName);
+ }
+
+ return dbList;
+ }
+
+ public Set keySet() {
+ return dbInfo.keySet();
+ }
+
+ public String getObjectName(String dbname) {
+ return dbInfo.get(dbname);
+ }
+
+ public int getObjectHash(String dbname) {
+ if (dbInfo.get(dbname) != null) {
+ return HashUtil.hash(dbInfo.get(dbname));
+ } else {
+ return -1;
+ }
+ }
+
+ public void setActiveDBInfo(Hashtable info) {
+ dbInfo = info;
+ }
+
+ public boolean isEmpty() {
+ return dbInfo.isEmpty();
+ }
+
+ public int size() {
+ return dbInfo.size();
+ }
+
+ public void clear() {
+ dbInfo.clear();
+ }
+
+ public void put(String dbName, String ObjectName) {
+ dbInfo.put(dbName, ObjectName);
+ }
+
+ public Hashtable getActiveDBInfo() {
+ return dbInfo;
+ }
+
+ public boolean equals(Hashtable other) {
+ if (other == null)
+ return false;
+ if (dbInfo == null)
+ return false;
+
+ if (dbInfo.equals(other)) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/scouter.client/src/scouter/client/cubrid/CubridMenuUtil.java b/scouter.client/src/scouter/client/cubrid/CubridMenuUtil.java
new file mode 100755
index 000000000..0fb458d89
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/CubridMenuUtil.java
@@ -0,0 +1,40 @@
+/*
+ * 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.client.cubrid;
+
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IWorkbenchWindow;
+
+import scouter.client.cubrid.actions.MultiViewDialogAction;
+
+public class CubridMenuUtil {
+
+ public static void createAddViewContextMenu(IWorkbenchWindow window, int serverId, FigureCanvas canvas) {
+ MenuManager manager = new MenuManager();
+
+ manager.add(new MultiViewDialogAction(window, serverId, CubridTypePeriod.REALTIME));
+ manager.add(new MultiViewDialogAction(window, serverId, CubridTypePeriod.PAST_LESS_1DAY));
+ manager.add(new MultiViewDialogAction(window, serverId, CubridTypePeriod.PAST_MORE_1DAY));
+
+ Menu menu = manager.createContextMenu(canvas);
+ canvas.setMenu(menu);
+ }
+
+}
diff --git a/scouter.client/src/scouter/client/cubrid/CubridSingleItem.java b/scouter.client/src/scouter/client/cubrid/CubridSingleItem.java
new file mode 100755
index 000000000..e35fefe2d
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/CubridSingleItem.java
@@ -0,0 +1,137 @@
+/*
+ * 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.client.cubrid;
+
+import org.eclipse.swt.SWT;
+
+import scouter.lang.constants.StatusConstants;
+import scouter.net.RequestCmd;
+import org.csstudio.swt.xygraph.figures.Trace.TraceType;
+
+public enum CubridSingleItem {
+ CPU(InfoType.DB_INFO, "Cpu Usage", RequestCmd.CUBRID_DB_SERVER_INFO, StatusConstants.CUBRID_DB_SERVER_INFO, "cpu_used", SWT.COLOR_DARK_BLUE, TraceType.BAR, 0, false),
+ ACTIVE_SESSION(InfoType.DB_INFO, "Active Sessions", RequestCmd.CUBRID_DB_SERVER_INFO, StatusConstants.CUBRID_DB_SERVER_INFO, "active_session", SWT.COLOR_DARK_BLUE, TraceType.BAR, 1, false),
+ LOCK_WAIT_SESSIONS(InfoType.DB_INFO, "Lock Wait Sessions", RequestCmd.CUBRID_DB_SERVER_INFO, StatusConstants.CUBRID_DB_SERVER_INFO, "lock_wait_sessions", SWT.COLOR_DARK_BLUE, TraceType.SOLID_LINE, 2, false),
+ DATA_PAGE_IO_WRITES(InfoType.DB_INFO, "Data Page_IO Writes", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "num_data_page_iowrites", SWT.COLOR_DARK_BLUE, TraceType.SOLID_LINE, 3, false),
+ DATA_PAGE_IO_READS(InfoType.DB_INFO, "Data Page IO Reads", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "num_data_page_ioreads", SWT.COLOR_DARK_BLUE, TraceType.SOLID_LINE, 4, false),
+ DATA_PAGE_FETCHES(InfoType.DB_INFO, "Data Page Fetches", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "num_data_page_fetches", SWT.COLOR_DARK_BLUE, TraceType.SOLID_LINE, 5, false),
+ DATA_PAGE_DIRTIES(InfoType.DB_INFO, "Data Page Dirties", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "num_data_page_dirties", SWT.COLOR_DARK_BLUE, TraceType.SOLID_LINE, 6, false),
+ DATA_BUFFER_HIT_RATIO(InfoType.DB_INFO, "Data Buffer Hit_Ratio", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "data_page_buffer_hit_ratio", SWT.COLOR_DARK_BLUE, TraceType.SOLID_LINE, 7, false),
+ QUERY_SSCANS(InfoType.DB_INFO, "Query Sscans", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "num_query_sscans", SWT.COLOR_DARK_BLUE, TraceType.SOLID_LINE, 8, false),
+ SORT_IO_PAGE(InfoType.DB_INFO, "Sort IO_Page", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "num_sort_io_pages", SWT.COLOR_DARK_BLUE, TraceType.SOLID_LINE, 9, false),
+ SORT_DATA_PAGE(InfoType.DB_INFO, "Sort Data Page", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "num_sort_data_pages", SWT.COLOR_DARK_BLUE, TraceType.SOLID_LINE, 10, false),
+ XASL_PLAN_HIT_RATE(InfoType.DB_INFO, "XASL Plan Hit Rate (%)", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "xasl_plan_hit_rate", SWT.COLOR_DARK_BLUE, TraceType.AREA, 11, true),
+ FILTER_PLAN_HIT_RATE(InfoType.DB_INFO, "Filter Predicate Hit Rate (%)", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "filter_plan_hit_rate", SWT.COLOR_DARK_BLUE, TraceType.AREA, 12, true),
+ TPS(InfoType.BROKER_INFO, "Transaction Per 5 Second", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "as_num_tran", SWT.COLOR_DARK_CYAN, TraceType.DASH_LINE, 0, false),
+ QPS(InfoType.BROKER_INFO, "Query Per 5 Second", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "as_num_query", SWT.COLOR_DARK_CYAN, TraceType.DASH_LINE, 1, false),
+ ERROR_QUERY(InfoType.BROKER_INFO, "Error Query Per 5 Second", RequestCmd.CUBRID_DB_REALTIME_STATUS, StatusConstants.CUBRID_DB_DUMP_INFO, "as_error_query", SWT.COLOR_DARK_CYAN, TraceType.DASH_LINE, 2, false);
+
+ private InfoType infoType;
+ private String title;
+ private String requestCmd;
+ private String statusConstants;
+ private String counterName;
+ private int color;
+ private TraceType traceType;
+ private int index;
+ private boolean isPercentData;
+
+ CubridSingleItem(InfoType infoType, String title, String requestCmd, String statusConstants, String counterName,
+ int color, TraceType traceType, int index, boolean isPercentData) {
+ this.infoType = infoType;
+ this.title = title;
+ this.requestCmd = requestCmd;
+ this.statusConstants = statusConstants;
+ this.counterName = counterName;
+ this.color = color;
+ this.traceType = traceType;
+ this.index = index;
+ this.isPercentData = isPercentData;
+ }
+
+ public InfoType getInfoType() {
+ return infoType;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public String getRequestCmd() {
+ return requestCmd;
+ }
+
+ public String getStatusConstants() {
+ return statusConstants;
+ }
+
+ public String getCounterName() {
+ return counterName;
+ }
+
+ public int getColor() {
+ return color;
+ }
+
+ public TraceType getTraceType() {
+ return traceType;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public boolean isPercent() {
+ return isPercentData;
+ }
+
+ public static CubridSingleItem fromCounterName(String title) {
+ if (title != null) {
+ for (CubridSingleItem type : CubridSingleItem.values()) {
+ if (title.equalsIgnoreCase(type.title)) {
+ return type;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static InfoType infotypeFromOrdinal(int ordinal) {
+ for (CubridSingleItem type : CubridSingleItem.values()) {
+ if (ordinal == type.ordinal()) {
+ return type.infoType;
+ }
+ }
+ return null;
+ }
+
+ public enum InfoType {
+ DB_INFO("DB_INFO"),
+ BROKER_INFO("BROKER_INFO");
+
+ private String title;
+
+ private InfoType(String title) {
+ this.title = title;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+ }
+}
\ No newline at end of file
diff --git a/scouter.client/src/scouter/client/cubrid/CubridTypePeriod.java b/scouter.client/src/scouter/client/cubrid/CubridTypePeriod.java
new file mode 100755
index 000000000..eb8de0d8e
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/CubridTypePeriod.java
@@ -0,0 +1,34 @@
+/*
+ * 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.client.cubrid;
+
+public enum CubridTypePeriod {
+ REALTIME("RealTime"),
+ PAST_LESS_1DAY("Past (Less than a day)"),
+ PAST_MORE_1DAY("Past (More than a day)");
+
+ private String title;
+
+ CubridTypePeriod(String title) {
+ this.title = title;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+}
diff --git a/scouter.client/src/scouter/client/cubrid/CubridTypeShotPeriod.java b/scouter.client/src/scouter/client/cubrid/CubridTypeShotPeriod.java
new file mode 100755
index 000000000..ec4b7e57d
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/CubridTypeShotPeriod.java
@@ -0,0 +1,63 @@
+/*
+ * 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.client.cubrid;
+
+public enum CubridTypeShotPeriod {
+ FIVE_MIN("5 min", 5 * 60 * 1000),
+ TEN_MIN("10 min", 10 * 60 * 1000),
+ TWT_MIN("20 min", 20 * 60 * 1000),
+ THIRTY_MIN("30 min", 30 * 60 * 1000),
+ ONE_HOUR("1 hour", 60 * 60 * 1000),
+ FOUR_HOURS("4 hours", 4 * 60 * 60 * 1000);
+
+ private String label;
+ private long time;
+
+ private CubridTypeShotPeriod(String label, long time) {
+ this.label = label;
+ this.time = time;
+ }
+
+ public String getLabel() {
+ return this.label;
+ }
+
+ public long getTime() {
+ return this.time;
+ }
+
+ public static CubridTypeShotPeriod fromString(String text) {
+ if (text != null) {
+ for (CubridTypeShotPeriod b : CubridTypeShotPeriod.values()) {
+ if (text.equalsIgnoreCase(b.label)) {
+ return b;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static CubridTypeShotPeriod fromTime(Long time) {
+ for (CubridTypeShotPeriod b : CubridTypeShotPeriod.values()) {
+ if (time == b.time) {
+ return b;
+ }
+ }
+ return null;
+ }
+}
diff --git a/scouter.client/src/scouter/client/cubrid/actions/AddLongPeriodCalendarDialog.java b/scouter.client/src/scouter/client/cubrid/actions/AddLongPeriodCalendarDialog.java
new file mode 100755
index 000000000..3aa2f4b67
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/actions/AddLongPeriodCalendarDialog.java
@@ -0,0 +1,235 @@
+/*
+ * 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.client.cubrid.actions;
+
+import java.awt.Point;
+import java.util.ArrayList;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.DateTime;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+import scouter.client.cubrid.ActiveDbInfo;
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.cubrid.CubridSingleItem.InfoType;
+import scouter.client.util.UIUtil;
+import scouter.util.CastUtil;
+import scouter.util.DateUtil;
+
+public class AddLongPeriodCalendarDialog {
+
+ private final Display display;
+ private final IAddSingleLongPeriodDialog callback;
+
+ Combo dbListCombo;
+ Combo counterCombo;
+
+ public AddLongPeriodCalendarDialog(Display display, IAddSingleLongPeriodDialog callback) {
+ this.display = display;
+ this.callback = callback;
+ }
+
+ public void show(long stime, long etime) {
+ show((int) UIUtil.getMousePosition().getX(), (int) UIUtil.getMousePosition().getY(), DateUtil.yyyymmdd(stime),
+ DateUtil.yyyymmdd(etime));
+ }
+
+ public void show() {
+ show(-1, -1);
+ }
+
+ public void show(Point p) {
+ if (p != null)
+ show((int) p.getX(), (int) p.getY() + 10);
+ }
+
+ public void show(int x, int y) {
+ show("Start Date:", "End Date:", x, y, null, null);
+ }
+
+ public void show(int x, int y, String yyyymmdd1, String yyyymmdd2) {
+ show("Start Date:", "End Date:", x, y, yyyymmdd1, yyyymmdd2);
+ }
+
+ public void show(String label1, String label2, int x, int y) {
+ show(label1, label2, x, y, null, null);
+ }
+
+ public void show(String label1, String label2, int x, int y, String yyyymmdd1, String yyyymmdd2) {
+ final Shell dialog = new Shell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ dialog.setLayout(new GridLayout(4, false));
+ dialog.setText("Date");
+
+ UIUtil.setDialogDefaultFunctions(dialog);
+
+ Label Label = new Label(dialog, SWT.NONE);
+ Label.setText("Counter");
+ counterCombo = new Combo(dialog, SWT.DROP_DOWN | SWT.READ_ONLY);
+ ArrayList multiViewList = new ArrayList();
+ for (CubridSingleItem view : CubridSingleItem.values()) {
+ multiViewList.add(view.getTitle());
+ }
+ counterCombo.setItems(multiViewList.toArray(new String[CubridSingleItem.values().length]));
+ counterCombo.select(0);
+ counterCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
+ counterCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ // TODO Auto-generated method stub
+ if (CubridSingleItem.infotypeFromOrdinal(counterCombo.getSelectionIndex()).equals(InfoType.BROKER_INFO)) {
+ dbListCombo.setEnabled(false);
+ dbListCombo.removeAll();
+ dbListCombo.add("BROKER_INFO");
+ dbListCombo.select(0);
+ } else {
+ dbListCombo.setEnabled(true);
+ dbListCombo.removeAll();
+ dbLoad();
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ Label = new Label(dialog, SWT.NONE);
+ Label.setText("DB");
+ dbListCombo = new Combo(dialog, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbListCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
+ dbLoad();
+
+ Label sDate = new Label(dialog, SWT.NONE);
+ sDate.setText(label1);
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, false, false, 4, 1);
+ sDate.setLayoutData(data);
+
+ final DateTime startCal = new DateTime(dialog, SWT.CALENDAR);
+ data = new GridData(SWT.FILL, SWT.CENTER, false, false, 4, 1);
+ startCal.setLayoutData(data);
+
+ Label eDate = new Label(dialog, SWT.NONE);
+ eDate.setText(label2);
+ data = new GridData(SWT.FILL, SWT.CENTER, false, false, 4, 1);
+ eDate.setLayoutData(data);
+
+ final DateTime endCal = new DateTime(dialog, SWT.CALENDAR);
+ data = new GridData(SWT.FILL, SWT.CENTER, false, false, 4, 1);
+ endCal.setLayoutData(data);
+
+ Button okButton = new Button(dialog, SWT.PUSH);
+ okButton.setText("&OK");
+ okButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true, 3, 1));
+ okButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ try {
+ String sDate = (startCal.getMonth() + 1) + "/" + startCal.getDay() + "/" + startCal.getYear();
+ sDate = DateUtil.format(DateUtil.getTime(sDate, "MM/dd/yyyy"), "yyyyMMdd");
+ String eDate = (endCal.getMonth() + 1) + "/" + endCal.getDay() + "/" + endCal.getYear();
+ eDate = DateUtil.format(DateUtil.getTime(eDate, "MM/dd/yyyy"), "yyyyMMdd");
+
+ if (CastUtil.cint(sDate) > CastUtil.cint(eDate)) {
+ MessageDialog.openError(dialog, "Error", "End Date is later than Start Date");
+ return;
+ }
+
+ String counterTitle = counterCombo.getText();
+ CubridSingleItem type = CubridSingleItem.fromCounterName(counterTitle);
+
+ callback.onPressedOk(dbListCombo.getItem(dbListCombo.getSelectionIndex()), type, sDate, eDate);
+ dialog.close();
+ } catch (Exception e) {
+ MessageDialog.openError(dialog, "Error55", "Date format error:" + e.getMessage());
+ }
+ break;
+ }
+ }
+ });
+
+ Button cancelButton = new Button(dialog, SWT.PUSH);
+ cancelButton.setText("&Cancel");
+ cancelButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+ cancelButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ callback.onPressedCancel();
+ dialog.close();
+ break;
+ }
+ }
+ });
+
+ dialog.setDefaultButton(okButton);
+ dialog.pack();
+
+ if (x > 0 && y > 0) {
+ dialog.setLocation(x, y);
+ }
+
+ if (yyyymmdd1 != null) {
+ int year = Integer.valueOf(yyyymmdd1.substring(0, 4));
+ int month = Integer.valueOf(yyyymmdd1.substring(4, 6)) - 1;
+ int day = Integer.valueOf(yyyymmdd1.substring(6, 8));
+ startCal.setDate(year, month, day);
+ }
+ if (yyyymmdd2 != null) {
+ int year = Integer.valueOf(yyyymmdd2.substring(0, 4));
+ int month = Integer.valueOf(yyyymmdd2.substring(4, 6)) - 1;
+ int day = Integer.valueOf(yyyymmdd2.substring(6, 8));
+ endCal.setDate(year, month, day);
+ }
+
+ dialog.open();
+ }
+
+ public interface IAddSingleLongPeriodDialog {
+ void onPressedOk(String dbName, CubridSingleItem viewType, String sDate, String eDate);
+
+ void onPressedCancel();
+ }
+
+ private void dbLoad() {
+ ActiveDbInfo activeDBList = ActiveDbInfo.getInstance();
+ if (!activeDBList.isEmpty()) {
+ for (String dbName : activeDBList.keySet()) {
+ dbListCombo.add(dbName);
+ }
+ } else {
+ return;
+ }
+ dbListCombo.select(0);
+ }
+
+}
diff --git a/scouter.client/src/scouter/client/cubrid/actions/AddLongTransactionList.java b/scouter.client/src/scouter/client/cubrid/actions/AddLongTransactionList.java
new file mode 100755
index 000000000..fbb9d2147
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/actions/AddLongTransactionList.java
@@ -0,0 +1,137 @@
+/*
+ * 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.client.cubrid.actions;
+
+import java.awt.Point;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+import scouter.client.util.UIUtil;
+import scouter.client.cubrid.ActiveDbInfo;
+
+public class AddLongTransactionList {
+ private final Display display;
+ private final IAddLongTransactionList callback;
+
+ Combo dbListCombo;
+
+ public AddLongTransactionList(Display display, IAddLongTransactionList callback) {
+ this.display = display;
+ this.callback = callback;
+ }
+
+ public void show(Point p) {
+ if (p != null)
+ show((int) p.getX(), (int) p.getY() + 10);
+ }
+
+ public void show() {
+ show(UIUtil.getMousePosition());
+ }
+
+ public void show(int x, int y) {
+ final Shell dialog = new Shell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ dialog.setLayout(new GridLayout(2, true));
+ dialog.setText("Add ListView");
+ UIUtil.setDialogDefaultFunctions(dialog);
+
+ Label Label2 = new Label(dialog, SWT.NONE);
+ Label2.setLayoutData(new GridData(SWT.LEFT));
+ Label2.setText("DB Name:");
+ dbListCombo = new Combo(dialog, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbListCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ dbLoad();
+
+ Button okButton = new Button(dialog, SWT.PUSH);
+ okButton.setText("&OK");
+ okButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ okButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ try {
+ callback.onPressedOk(dbListCombo.getItem(dbListCombo.getSelectionIndex()));
+ dialog.close();
+
+ } catch (Exception e) {
+ MessageDialog.openError(dialog, "Error55", "format error:" + e.getMessage());
+ }
+ break;
+ }
+ }
+ });
+
+ Button cancelButton = new Button(dialog, SWT.PUSH);
+ cancelButton.setText("&Cancel");
+ cancelButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ cancelButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ callback.onPressedCancel();
+ dialog.close();
+ break;
+ }
+ }
+ });
+
+ dialog.addListener(SWT.Close, new Listener() {
+ public void handleEvent(Event event) {
+ callback.onPressedCancel();
+ }
+ });
+
+ dialog.setDefaultButton(okButton);
+ dialog.pack();
+
+ if (x > 0 && y > 0) {
+ dialog.setLocation(x, y);
+ }
+
+ dialog.open();
+ }
+
+ public interface IAddLongTransactionList {
+ void onPressedOk(String dbName);
+
+ void onPressedCancel();
+ }
+
+ private void dbLoad() {
+ ActiveDbInfo activeDBList = ActiveDbInfo.getInstance();
+ if (!activeDBList.isEmpty()) {
+ for (String dbName : activeDBList.keySet()) {
+ dbListCombo.add(dbName);
+ }
+ } else {
+ return;
+ }
+ dbListCombo.select(0);
+ }
+
+}
diff --git a/scouter.client/src/scouter/client/cubrid/actions/AddRealTimeDialog.java b/scouter.client/src/scouter/client/cubrid/actions/AddRealTimeDialog.java
new file mode 100755
index 000000000..3ebdcdcc7
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/actions/AddRealTimeDialog.java
@@ -0,0 +1,202 @@
+/*
+ * 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.client.cubrid.actions;
+
+import java.awt.Point;
+import java.util.ArrayList;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+import scouter.client.util.UIUtil;
+import scouter.client.cubrid.ActiveDbInfo;
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.cubrid.CubridTypeShotPeriod;
+import scouter.client.cubrid.CubridSingleItem.InfoType;
+
+public class AddRealTimeDialog {
+ private final Display display;
+ private final IAddSingleRealTimeDialog callback;
+
+ Combo dbListCombo;
+ Combo counterCombo;
+ Combo timeRangeCombo;
+
+ public AddRealTimeDialog(Display display, IAddSingleRealTimeDialog callback) {
+ this.display = display;
+ this.callback = callback;
+ }
+
+ public void show(Point p) {
+ if (p != null)
+ show((int) p.getX(), (int) p.getY() + 10);
+ }
+
+ public void show() {
+ show(UIUtil.getMousePosition());
+ }
+
+ public void show(int x, int y) {
+ final Shell dialog = new Shell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ dialog.setLayout(new GridLayout(2, true));
+ dialog.setText("Add RealTime View");
+ UIUtil.setDialogDefaultFunctions(dialog);
+
+ Label Label1 = new Label(dialog, SWT.NONE);
+ Label1.setLayoutData(new GridData(SWT.LEFT));
+ Label1.setText("Counter Name:");
+ counterCombo = new Combo(dialog, SWT.DROP_DOWN | SWT.READ_ONLY);
+ ArrayList multiViewList = new ArrayList();
+ for (CubridSingleItem view : CubridSingleItem.values()) {
+ multiViewList.add(view.getTitle());
+ }
+ counterCombo.setItems(multiViewList.toArray(new String[CubridSingleItem.values().length]));
+ counterCombo.select(0);
+ counterCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+
+ counterCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ // TODO Auto-generated method stub
+ if (CubridSingleItem.infotypeFromOrdinal(counterCombo.getSelectionIndex()).equals(InfoType.BROKER_INFO)) {
+ dbListCombo.setEnabled(false);
+ dbListCombo.removeAll();
+ dbListCombo.add("BROKER_INFO");
+ dbListCombo.select(0);
+ } else {
+ dbListCombo.setEnabled(true);
+ dbListCombo.removeAll();
+ dbLoad();
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ Label Label2 = new Label(dialog, SWT.NONE);
+ Label2.setLayoutData(new GridData(SWT.LEFT));
+ Label2.setText("DB Name:");
+ dbListCombo = new Combo(dialog, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbListCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ dbLoad();
+
+ Label Label3 = new Label(dialog, SWT.NONE);
+ Label3.setLayoutData(new GridData(SWT.LEFT));
+ Label3.setText("Time Range:");
+ timeRangeCombo = new Combo(dialog, SWT.DROP_DOWN | SWT.READ_ONLY);
+ ArrayList minuteStrList = new ArrayList();
+ for (CubridTypeShotPeriod minute : CubridTypeShotPeriod.values()) {
+ minuteStrList.add(minute.getLabel());
+ }
+ timeRangeCombo.setItems(minuteStrList.toArray(new String[CubridTypeShotPeriod.values().length]));
+ timeRangeCombo.select(0);
+ timeRangeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+
+ Button okButton = new Button(dialog, SWT.PUSH);
+ okButton.setText("&OK");
+ okButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ okButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ try {
+ String counterTitle = counterCombo.getText();
+ CubridSingleItem type = CubridSingleItem.fromCounterName(counterTitle);
+ String afterMinute = timeRangeCombo.getText();
+ CubridTypeShotPeriod m = CubridTypeShotPeriod.fromString(afterMinute);
+
+ if (type.getInfoType() == InfoType.BROKER_INFO) {
+ callback.onPressedOk(type.getInfoType().getTitle(), type, m.getTime());
+ } else {
+ callback.onPressedOk(dbListCombo.getItem(dbListCombo.getSelectionIndex()), type, m.getTime());
+ }
+ dialog.close();
+
+ } catch (Exception e) {
+ MessageDialog.openError(dialog, "Error55", "format error:" + e.getMessage());
+ }
+ break;
+ }
+ }
+ });
+
+ Button cancelButton = new Button(dialog, SWT.PUSH);
+ cancelButton.setText("&Cancel");
+ cancelButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ cancelButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ callback.onPressedCancel();
+ dialog.close();
+ break;
+ }
+ }
+ });
+
+ dialog.addListener(SWT.Close, new Listener() {
+ public void handleEvent(Event event) {
+ callback.onPressedCancel();
+ }
+ });
+
+ dialog.setDefaultButton(okButton);
+ dialog.pack();
+
+ if (x > 0 && y > 0) {
+ dialog.setLocation(x, y);
+ }
+
+ dialog.open();
+ }
+
+ public interface IAddSingleRealTimeDialog {
+ void onPressedOk(String dbName, CubridSingleItem viewType, long timeRange);
+
+ void onPressedCancel();
+ }
+
+ private void dbLoad() {
+ ActiveDbInfo activeDBList = ActiveDbInfo.getInstance();
+ if (!activeDBList.isEmpty()) {
+ for (String dbName : activeDBList.keySet()) {
+ dbListCombo.add(dbName);
+ }
+ } else {
+ return;
+ }
+ dbListCombo.select(0);
+ }
+
+}
diff --git a/scouter.client/src/scouter/client/cubrid/actions/AddShortPeriodCalendarDialog.java b/scouter.client/src/scouter/client/cubrid/actions/AddShortPeriodCalendarDialog.java
new file mode 100755
index 000000000..e7d7883ec
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/actions/AddShortPeriodCalendarDialog.java
@@ -0,0 +1,381 @@
+/*
+ * 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.client.cubrid.actions;
+
+import java.awt.Point;
+import java.util.ArrayList;
+import java.util.Date;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.DateTime;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+import scouter.client.cubrid.ActiveDbInfo;
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.cubrid.CubridSingleItem.InfoType;
+import scouter.client.popup.CalendarDialog.AfterMinuteUnit;
+import scouter.client.util.UIUtil;
+import scouter.util.CastUtil;
+import scouter.util.DateUtil;
+
+public class AddShortPeriodCalendarDialog {
+ private final Display display;
+ private final IAddSingleShortPeriodDialog callback;
+
+ Combo dbListCombo;
+ Combo counterCombo;
+
+ public AddShortPeriodCalendarDialog(Display display, IAddSingleShortPeriodDialog callback) {
+ this.display = display;
+ this.callback = callback;
+ }
+
+ public void show(Point p, long stime, long etime) {
+ if (p != null)
+ show((int) p.getX(), (int) p.getY() + 10, stime, etime);
+ }
+
+ public void show(Point p, long stime) {
+ if (p != null)
+ showOnlyStartTime((int) p.getX(), (int) p.getY() + 10, stime);
+ }
+
+ public void show(long stime, long etime) {
+ show(UIUtil.getMousePosition(), stime, etime);
+ }
+
+ public void show(long stime) {
+ show(UIUtil.getMousePosition(), stime);
+ }
+
+ public void show(int x, int y, long stime, long etime) {
+ final Shell dialog = new Shell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ dialog.setLayout(new GridLayout(4, false));
+ dialog.setText("Add PeriodView");
+ UIUtil.setDialogDefaultFunctions(dialog);
+
+ Label Label = new Label(dialog, SWT.NONE);
+ Label.setText("Counter");
+ counterCombo = new Combo(dialog, SWT.DROP_DOWN | SWT.READ_ONLY);
+ ArrayList multiViewList = new ArrayList();
+ for (CubridSingleItem view : CubridSingleItem.values()) {
+ multiViewList.add(view.getTitle());
+ }
+ counterCombo.setItems(multiViewList.toArray(new String[CubridSingleItem.values().length]));
+ counterCombo.select(0);
+ counterCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
+ counterCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ // TODO Auto-generated method stub
+ if (CubridSingleItem.infotypeFromOrdinal(counterCombo.getSelectionIndex()).equals(InfoType.BROKER_INFO)) {
+ dbListCombo.setEnabled(false);
+ dbListCombo.removeAll();
+ dbListCombo.add("BROKER_INFO");
+ dbListCombo.select(0);
+ } else {
+ dbListCombo.setEnabled(true);
+ dbListCombo.removeAll();
+ dbLoad();
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ Label = new Label(dialog, SWT.NONE);
+ Label.setText("DB");
+ dbListCombo = new Combo(dialog, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbListCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
+ dbLoad();
+
+ final DateTime calendar = new DateTime(dialog, SWT.CALENDAR);
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, false, false, 4, 1);
+ calendar.setLayoutData(data);
+
+ int year = CastUtil.cint(DateUtil.format(stime, "yyyy"));
+ int month = CastUtil.cint(DateUtil.format(stime, "MM")) - 1;
+ int day = CastUtil.cint(DateUtil.format(stime, "dd"));
+ calendar.setDate(year, month, day);
+ calendar.setDay(day);
+
+ Label = new Label(dialog, SWT.NONE);
+ Label.setText("From");
+ final DateTime startTime = new DateTime(dialog, SWT.TIME | SWT.SHORT);
+ startTime.setHours(DateUtil.getHour(stime));
+ startTime.setMinutes(DateUtil.getMin(stime));
+
+ Label = new Label(dialog, SWT.NONE);
+ Label.setText("To");
+ final DateTime endTime = new DateTime(dialog, SWT.TIME | SWT.SHORT);
+ endTime.setHours(DateUtil.getHour(etime));
+ endTime.setMinutes(DateUtil.getMin(etime));
+
+ Button okButton = new Button(dialog, SWT.PUSH);
+ okButton.setText("&OK");
+ okButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ okButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ try {
+ String counterTitle = counterCombo.getText();
+ CubridSingleItem type = CubridSingleItem.fromCounterName(counterTitle);
+
+ String fromTime = (calendar.getMonth() + 1) + "/" + calendar.getDay() + "/" + calendar.getYear()
+ + " " + (startTime.getHours() < 10 ? "0" : "") + startTime.getHours() + ":"
+ + (startTime.getMinutes() < 10 ? "0" : "") + startTime.getMinutes();
+
+ boolean nextDay0 = false;
+ if (endTime.getHours() == 0 && endTime.getMinutes() == 0) {
+ nextDay0 = true;
+ }
+
+ String toTime = (calendar.getMonth() + 1) + "/" + calendar.getDay() + "/" + calendar.getYear()
+ + " " + (endTime.getHours() < 10 ? "0" : "") + endTime.getHours() + ":"
+ + (endTime.getMinutes() < 10 ? "0" : "") + endTime.getMinutes();
+
+ long startTime = DateUtil.getTime(fromTime, "MM/dd/yyyy HH:mm");
+ long endTime = DateUtil.getTime(toTime, "MM/dd/yyyy HH:mm");
+
+ if (nextDay0) {
+ endTime += DateUtil.MILLIS_PER_DAY - 1000;
+ }
+ if (endTime <= startTime) {
+ MessageDialog.openWarning(dialog, "Warning", "Time range is incorrect");
+ } else {
+ callback.onPressedOk(dbListCombo.getItem(dbListCombo.getSelectionIndex()), type, startTime,
+ endTime);
+ dialog.close();
+ }
+
+ } catch (Exception e) {
+ MessageDialog.openError(dialog, "Error55", "format error:" + e.getMessage());
+ }
+ break;
+ }
+ }
+ });
+
+ Button cancelButton = new Button(dialog, SWT.PUSH);
+ cancelButton.setText("&Cancel");
+ cancelButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ cancelButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ callback.onPressedCancel();
+ dialog.close();
+ break;
+ }
+ }
+ });
+
+ dialog.addListener(SWT.Close, new Listener() {
+ public void handleEvent(Event event) {
+ callback.onPressedCancel();
+ }
+ });
+
+ dialog.setDefaultButton(okButton);
+ dialog.pack();
+
+ if (x > 0 && y > 0) {
+ dialog.setLocation(x, y);
+ }
+
+ dialog.open();
+ }
+
+ public void showOnlyStartTime(int x, int y, long stime) {
+ final Shell dialog = new Shell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ dialog.setLayout(new GridLayout(4, false));
+ dialog.setText("Add PeriodView");
+ UIUtil.setDialogDefaultFunctions(dialog);
+
+ Label Label = new Label(dialog, SWT.NONE);
+ Label.setText("Counter");
+ counterCombo = new Combo(dialog, SWT.DROP_DOWN);
+ ArrayList multiViewList = new ArrayList();
+ for (CubridSingleItem view : CubridSingleItem.values()) {
+ multiViewList.add(view.getTitle());
+ }
+ counterCombo.setItems(multiViewList.toArray(new String[CubridSingleItem.values().length]));
+ counterCombo.select(0);
+ counterCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
+ counterCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ // TODO Auto-generated method stub
+ if (CubridSingleItem.infotypeFromOrdinal(counterCombo.getSelectionIndex()).equals(InfoType.BROKER_INFO)) {
+ dbListCombo.setEnabled(false);
+ dbListCombo.removeAll();
+ dbListCombo.add("BROKER_INFO");
+ dbListCombo.select(0);
+ } else {
+ dbListCombo.setEnabled(true);
+ dbListCombo.removeAll();
+ dbLoad();
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ Label = new Label(dialog, SWT.NONE);
+ Label.setText("DB");
+ dbListCombo = new Combo(dialog, SWT.DROP_DOWN);
+ dbListCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
+ dbLoad();
+
+ final DateTime calendar = new DateTime(dialog, SWT.CALENDAR);
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, false, false, 4, 1);
+ calendar.setLayoutData(data);
+
+ int year = CastUtil.cint(DateUtil.format(stime, "yyyy"));
+ int month = CastUtil.cint(DateUtil.format(stime, "MM")) - 1;
+ int day = CastUtil.cint(DateUtil.format(stime, "dd"));
+ calendar.setDate(year, month, day);
+ calendar.setDay(day);
+
+ Label = new Label(dialog, SWT.NONE);
+ Label.setText("From");
+ final DateTime startTime = new DateTime(dialog, SWT.TIME | SWT.SHORT);
+ startTime.setHours(DateUtil.getHour(stime));
+ startTime.setMinutes(DateUtil.getMin(stime));
+
+ Label = new Label(dialog, SWT.NONE);
+ Label.setText("To");
+ final Combo afterMinutes = new Combo(dialog, SWT.DROP_DOWN | SWT.READ_ONLY);
+ ArrayList minuteStrList = new ArrayList();
+ for (AfterMinuteUnit minute : AfterMinuteUnit.values()) {
+ minuteStrList.add(minute.getLabel());
+ }
+ afterMinutes.setItems(minuteStrList.toArray(new String[AfterMinuteUnit.values().length]));
+ afterMinutes.select(0);
+ afterMinutes.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+
+ Button okButton = new Button(dialog, SWT.PUSH);
+ okButton.setText("&OK");
+ okButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ okButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ try {
+ String counterTitle = counterCombo.getText();
+ CubridSingleItem type = CubridSingleItem.fromCounterName(counterTitle);
+
+ String fromTime = (calendar.getMonth() + 1) + "/" + calendar.getDay() + "/" + calendar.getYear() + " " + startTime.getHours() + ":" + (startTime.getMinutes() < 10 ? "0" : "") + startTime.getMinutes();
+ long startTime = DateUtil.getTime(fromTime, "MM/dd/yyyy HH:mm");
+ long endTime = 0;
+ String afterMinute = afterMinutes.getText();
+ AfterMinuteUnit m = AfterMinuteUnit.fromString(afterMinute);
+ if (m != null) {
+ endTime = startTime + m.getTime();
+ }
+ if (endTime <= startTime) {
+ MessageDialog.openWarning(dialog, "Warning", "Time range is incorrect");
+ } else {
+ if (DateUtil.isSameDay(new Date(startTime), new Date(endTime)) == false) {
+ endTime = DateUtil.getTime((calendar.getMonth() + 1) + "/" + calendar.getDay() + "/" + calendar.getYear() + " 23:59", "MM/dd/yyyy HH:mm");
+ }
+ callback.onPressedOk(dbListCombo.getItem(dbListCombo.getSelectionIndex()), type, startTime,
+ endTime);
+ dialog.close();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ MessageDialog.openError(dialog, "Error", "Date format error:" + e.getMessage());
+ }
+ break;
+ }
+ }
+ });
+
+ Button cancelButton = new Button(dialog, SWT.PUSH);
+ cancelButton.setText("&Cancel");
+ cancelButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ cancelButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ callback.onPressedCancel();
+ dialog.close();
+ break;
+ }
+ }
+ });
+
+ dialog.addListener(SWT.Close, new Listener() {
+ public void handleEvent(Event event) {
+ callback.onPressedCancel();
+ }
+ });
+
+ dialog.setDefaultButton(okButton);
+ dialog.pack();
+
+ if (x > 0 && y > 0) {
+ dialog.setLocation(x, y);
+ }
+
+ dialog.open();
+ }
+
+
+ public interface IAddSingleShortPeriodDialog {
+ void onPressedOk(String dbName, CubridSingleItem viewType, long stime, long etime);
+
+ void onPressedCancel();
+ }
+
+ private void dbLoad() {
+ ActiveDbInfo activeDBList = ActiveDbInfo.getInstance();
+ if (!activeDBList.isEmpty()) {
+ for (String dbName : activeDBList.keySet()) {
+ dbListCombo.add(dbName);
+ }
+ } else {
+ return;
+ }
+ dbListCombo.select(0);
+ }
+
+}
diff --git a/scouter.client/src/scouter/client/cubrid/actions/AlertSettingDialog.java b/scouter.client/src/scouter/client/cubrid/actions/AlertSettingDialog.java
new file mode 100755
index 000000000..5e941caca
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/actions/AlertSettingDialog.java
@@ -0,0 +1,293 @@
+/*
+ * 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.client.cubrid.actions;
+
+import java.awt.Point;
+import java.util.ArrayList;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.model.AgentModelThread;
+import scouter.client.net.TcpProxy;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ExUtil;
+import scouter.client.util.UIUtil;
+import scouter.lang.counters.CounterConstants;
+import scouter.lang.pack.MapPack;
+import scouter.lang.value.ListValue;
+import scouter.lang.value.MapValue;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+
+public class AlertSettingDialog {
+ private final Display display;
+ private final int serverId;
+ private int objhash;
+ private final int counterOrdinal;
+
+ Combo dbListCombo;
+ Combo counterCombo;
+ Text currentValue;
+ Text changeValue;
+
+ String value = "0";
+
+ public AlertSettingDialog(Display display,int serverId,int ordinal) {
+ this.display = display;
+ this.serverId = serverId;
+ this.counterOrdinal = ordinal;
+ }
+
+ public void show(Point p) {
+ if (p != null)
+ show((int) p.getX(), (int) p.getY() + 10);
+ }
+
+ public void show() {
+ show(UIUtil.getMousePosition());
+ }
+
+ public void show(int x, int y) {
+ final Shell dialog = new Shell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ dialog.setLayout(new GridLayout(2, true));
+ dialog.setText("Warning Alert Setting");
+ UIUtil.setDialogDefaultFunctions(dialog);
+
+ AgentModelThread agentThreadA = AgentModelThread.getInstance();
+ String hashString = agentThreadA.getLiveObjectHashStringWithParent(serverId, CounterConstants.CUBRID_AGENT);
+
+ if (hashString == null || hashString.equals("")) {
+ MessageDialog.openError(dialog, "Error55", "Error : " + "Please Check CUBRID-AGENT!!!!");
+ return;
+ } else {
+ objhash = Integer.parseInt(hashString);
+ }
+
+ loadAlertConfig();
+
+ Label Label1 = new Label(dialog, SWT.NONE);
+ Label1.setLayoutData(new GridData(SWT.LEFT));
+ Label1.setText("Counter Name:");
+ counterCombo = new Combo(dialog, SWT.DROP_DOWN | SWT.READ_ONLY);
+ ArrayList multiViewList = new ArrayList();
+ for (CubridSingleItem view : CubridSingleItem.values()) {
+ multiViewList.add(view.getTitle());
+ }
+ counterCombo.setItems(multiViewList.toArray(new String[CubridSingleItem.values().length]));
+ counterCombo.select(counterOrdinal);
+ counterCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ counterCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ value = alertConfigMap.getText(
+ CubridSingleItem.values()[counterCombo.getSelectionIndex()].getCounterName());
+
+ if (value == null) {
+ currentValue.setText("not load Or not Setting");
+ } else {
+ currentValue.setText(value);
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ }
+ });
+
+ Label Label2 = new Label(dialog, SWT.NONE);
+ Label2.setLayoutData(new GridData(SWT.LEFT));
+ Label2.setText("Current Warning Value:");
+ currentValue = new Text(dialog, SWT.NONE);
+ currentValue.setEditable(false);
+ currentValue.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ value = alertConfigMap.getText(CubridSingleItem.values()[counterOrdinal].getCounterName());
+
+ if (value == null) {
+ currentValue.setText("not load Or not Setting");
+ } else {
+ currentValue.setText(value);
+ }
+
+ Label Label3 = new Label(dialog, SWT.NONE);
+ Label3.setLayoutData(new GridData(SWT.LEFT));
+ Label3.setText("Change Warning Value:");
+ changeValue = new Text(dialog, SWT.NONE);
+ changeValue.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ changeValue.setText("");
+
+ Button okButton = new Button(dialog, SWT.PUSH);
+ okButton.setText("&OK");
+ okButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ okButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ try {
+ int ret = saveAlertConfig(
+ CubridSingleItem.values()[counterCombo.getSelectionIndex()].getCounterName(), changeValue.getText());
+
+ if (ret != ErrorEnum.SUCCESS.getCode()) {
+ MessageDialog.openError(dialog, "Error55", "Error : " + ErrorEnum.getErrorMsg(ret));
+ } else {
+ dialog.close();
+ }
+
+ } catch (Exception e) {
+ MessageDialog.openError(dialog, "Error55", "Error : " + e.getMessage());
+ }
+ break;
+ }
+ }
+ });
+
+ Button cancelButton = new Button(dialog, SWT.PUSH);
+ cancelButton.setText("&Cancel");
+ cancelButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ cancelButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ dialog.close();
+ break;
+ }
+ }
+ });
+
+ dialog.setDefaultButton(okButton);
+ dialog.pack();
+
+ if (x > 0 && y > 0) {
+ dialog.setLocation(x, y);
+ }
+
+ dialog.open();
+ }
+
+ MapValue alertConfigMap = new MapValue();
+
+ private void loadAlertConfig() {
+ MapPack param = new MapPack();
+ param.put("objHash", this.objhash);
+ ExUtil.asyncRun(new Runnable() {
+ public void run() {
+ MapPack pack = null;
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ try {
+ pack = (MapPack) tcp.getSingle(RequestCmd.CUBRID_GET_ALERT_CONFIGURE, param);
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ if (pack != null) {
+ final ListValue keyList = pack.getList("key");
+ final ListValue valueList = pack.getList("value");
+ alertConfigMap.clear();
+ for (int i = 0; i < keyList.size(); i++) {
+ String key = CastUtil.cString(keyList.get(i));
+ String value = CastUtil.cString(valueList.get(i));
+ key = key == null ? "" : key;
+ value = value == null ? "" : value;
+ alertConfigMap.put(key, value);
+ }
+ }
+ }
+ });
+ }
+
+ private int saveAlertConfig(String alertKey, String value) {
+ int success = ErrorEnum.SUCCESS.getCode();
+
+ if (value == "") {
+ return ErrorEnum.VALUE_EMPTY.getCode();
+ } else if (Integer.parseInt(value) < 0) {
+ return ErrorEnum.VALUE_ERROR.getCode();
+ }
+
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ try {
+ MapPack param = new MapPack();
+ param.put("key", alertKey);
+ param.put("value", value);
+ param.put("objHash", this.objhash);
+
+ MapPack out = null;
+ out = (MapPack) tcp.getSingle(RequestCmd.CUBRID_SET_ALERT_CONFIGURE, param);
+
+ if (out != null) {
+ String config = out.getText("result");
+ if ("true".equalsIgnoreCase(config)) {
+ success = ErrorEnum.SUCCESS.getCode();
+ } else {
+ success = ErrorEnum.SERVER_ERROR.getCode();
+ }
+ }
+
+ } catch (Throwable throwable) {
+ success = ErrorEnum.THROW_ERROR.getCode();
+ ConsoleProxy.errorSafe(throwable.getMessage() + " : error on save AlertConfig.");
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ return success;
+ }
+
+ enum ErrorEnum {
+ SUCCESS(0,"SUCCESS"),
+ VALUE_EMPTY(1,"Please check, ChangeValue is Empty"),
+ VALUE_ERROR(2,"Please check, ChangeValue is less zero"),
+ SERVER_ERROR(3,"Error Server"),
+ THROW_ERROR(4,"Unkown Error");
+
+ private final int errorCode;
+ private final String errorMsg;
+
+ private ErrorEnum(int errorCode, String errorMsg) {
+ this.errorCode = errorCode;
+ this.errorMsg = errorMsg;
+ }
+
+ public int getCode() {
+ return errorCode;
+ }
+
+ public String getMsg() {
+ return errorMsg;
+ }
+
+ public static String getErrorMsg(int code) {
+ return ErrorEnum.values()[code].getMsg();
+ }
+ }
+}
+
diff --git a/scouter.client/src/scouter/client/cubrid/actions/MultiViewDialogAction.java b/scouter.client/src/scouter/client/cubrid/actions/MultiViewDialogAction.java
new file mode 100755
index 000000000..fa1ea2de8
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/actions/MultiViewDialogAction.java
@@ -0,0 +1,127 @@
+/*
+ * 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.client.cubrid.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+import scouter.client.Images;
+import scouter.client.cubrid.views.CubridSingleDailyPeriodMultiView;
+import scouter.client.cubrid.views.CubridSinglePeriodMultiView;
+import scouter.client.cubrid.views.CubridSingleRealTimeMultiView;
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.cubrid.CubridTypePeriod;
+import scouter.client.util.ImageUtil;
+import scouter.client.util.TimeUtil;
+import scouter.util.DateUtil;
+
+public class MultiViewDialogAction extends Action {
+
+ IWorkbenchWindow window;
+ final private int serverId;
+ final private CubridTypePeriod periodType;
+
+ public MultiViewDialogAction(IWorkbenchWindow window, int serverId, CubridTypePeriod periodType) {
+ this.window = window;
+ this.serverId = serverId;
+ this.periodType = periodType;
+ setText(periodType.getTitle());
+ setImageDescriptor(ImageUtil.getImageDescriptor(Images.add));
+ }
+
+ public void run() {
+
+ if (periodType == CubridTypePeriod.REALTIME) {
+ AddRealTimeDialog dialog = new AddRealTimeDialog(window.getShell().getDisplay(),
+ new AddRealTimeDialog.IAddSingleRealTimeDialog() {
+ @Override
+ public void onPressedOk(String dbName, CubridSingleItem viewType, long timeRange) {
+ System.out.println("MultiViewDialogAction dbName : " + dbName);
+ try {
+ window.getActivePage().showView(CubridSingleRealTimeMultiView.ID,
+ serverId + "&" + dbName + "&" + viewType.ordinal() + "&" + timeRange,
+ IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onPressedCancel() {
+ }
+ });
+
+ dialog.show();
+ } else if (periodType == CubridTypePeriod.PAST_LESS_1DAY) {
+ AddShortPeriodCalendarDialog dialog = new AddShortPeriodCalendarDialog(window.getShell().getDisplay(),
+ new AddShortPeriodCalendarDialog.IAddSingleShortPeriodDialog() {
+
+ @Override
+ public void onPressedOk(String dbName, CubridSingleItem viewType, long stime, long etime) {
+ try {
+ window.getActivePage().showView(CubridSinglePeriodMultiView.ID,
+ serverId + "&" + dbName + "&" + viewType.ordinal() + "&" + stime + "&" + etime,
+ IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onPressedCancel() {
+ }
+ });
+ int hourRange = DateUtil.getHour(TimeUtil.getCurrentTime(serverId));
+ int MiniteRange = DateUtil.getMin(TimeUtil.getCurrentTime(serverId));
+ if (hourRange > 4) {
+ dialog.show(TimeUtil.getCurrentTime(serverId) - DateUtil.MILLIS_PER_HOUR * 4,
+ TimeUtil.getCurrentTime(serverId));
+ } else {
+ dialog.show(TimeUtil.getCurrentTime(serverId) - DateUtil.MILLIS_PER_HOUR * hourRange - DateUtil.MILLIS_PER_MINUTE * MiniteRange,
+ TimeUtil.getCurrentTime(serverId));
+ }
+ } else {
+ AddLongPeriodCalendarDialog dialog = new AddLongPeriodCalendarDialog(window.getShell().getDisplay(),
+ new AddLongPeriodCalendarDialog.IAddSingleLongPeriodDialog() {
+
+ @Override
+ public void onPressedOk(String dbName, CubridSingleItem viewType, String sDate,
+ String eDate) {
+ try {
+ window.getActivePage().showView(CubridSingleDailyPeriodMultiView.ID,
+ serverId + "&" + dbName + "&" + viewType.ordinal() + "&" + sDate + "&" + eDate,
+ IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ @Override
+ public void onPressedCancel() {
+ }
+ });
+ dialog.show(TimeUtil.getCurrentTime(serverId), TimeUtil.getCurrentTime(serverId));
+ }
+ }
+
+}
diff --git a/scouter.client/src/scouter/client/cubrid/actions/OpenMultiViewAction.java b/scouter.client/src/scouter/client/cubrid/actions/OpenMultiViewAction.java
new file mode 100755
index 000000000..cf8b8a115
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/actions/OpenMultiViewAction.java
@@ -0,0 +1,54 @@
+/*
+ * 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.client.cubrid.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+import scouter.client.Images;
+import scouter.client.cubrid.views.CubridSingleRealTimeMultiView;
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ImageUtil;
+import scouter.util.DateUtil;
+
+public class OpenMultiViewAction extends Action {
+
+ final private int serverId;
+ final private int multiViewOrdinal;
+
+ public OpenMultiViewAction(int serverId, int objHash, int multiViewOrdinal) {
+ this.serverId = serverId;
+ this.multiViewOrdinal = multiViewOrdinal;
+ setText(CubridSingleItem.values()[multiViewOrdinal].getTitle());
+ setImageDescriptor(ImageUtil.getImageDescriptor(Images.add));
+ }
+
+ public void run() {
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
+ CubridSingleRealTimeMultiView.ID, serverId + "&" + "default"
+ + "&" + multiViewOrdinal + "&" + DateUtil.MILLIS_PER_TEN_MINUTE, IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ ConsoleProxy.errorSafe(e.toString());
+ }
+ }
+
+}
diff --git a/scouter.client/src/scouter/client/cubrid/actions/OpenOtherViewAction.java b/scouter.client/src/scouter/client/cubrid/actions/OpenOtherViewAction.java
new file mode 100755
index 000000000..0c1f128a6
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/actions/OpenOtherViewAction.java
@@ -0,0 +1,78 @@
+/*
+ * 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.client.cubrid.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+import scouter.client.Images;
+import scouter.client.cubrid.views.CubridLongTransactionList;
+import scouter.client.cubrid.views.CubridRealtimeDmlView;
+import scouter.client.cubrid.views.CubridSpaceDbView;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ImageUtil;
+
+public class OpenOtherViewAction extends Action {
+
+ final private int serverId;
+ final private OtherViewType viewType;
+
+ public OpenOtherViewAction(int serverId, int objHash, OtherViewType viewType) {
+ this.serverId = serverId;
+ this.viewType = viewType;
+ setText(viewType.getTitle());
+ setImageDescriptor(ImageUtil.getImageDescriptor(Images.add));
+ }
+
+ public void run() {
+
+ try {
+ if (viewType.equals(OtherViewType.DB_SPACE_INFO)) {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(CubridSpaceDbView.ID,
+ serverId + "&" + "default", IWorkbenchPage.VIEW_ACTIVATE);
+ } else if (viewType.equals(OtherViewType.LONG_TRANSACTION)) {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(CubridLongTransactionList.ID,
+ serverId + "&" + "default", IWorkbenchPage.VIEW_ACTIVATE);
+ } else if (viewType.equals(OtherViewType.DML_REALTIME)) {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(CubridRealtimeDmlView.ID,
+ serverId + "&" + "default", IWorkbenchPage.VIEW_ACTIVATE);
+ }
+ } catch (PartInitException e) {
+ ConsoleProxy.errorSafe(e.toString());
+ }
+ }
+
+ public enum OtherViewType {
+ DB_SPACE_INFO("DB Space Info"),
+ LONG_TRANSACTION("Long Tranjaction List"),
+ DML_REALTIME("Realtime DML");
+
+ private String title;
+
+ OtherViewType(String title) {
+ this.title = title;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+ }
+
+}
diff --git a/scouter.client/src/scouter/client/cubrid/views/CubridLongTransactionList.java b/scouter.client/src/scouter/client/cubrid/views/CubridLongTransactionList.java
new file mode 100755
index 000000000..0a7636233
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/views/CubridLongTransactionList.java
@@ -0,0 +1,771 @@
+/*
+ * 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.client.cubrid.views;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.layout.TableColumnLayout;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+import scouter.client.Images;
+import scouter.client.cubrid.ActiveDbInfo;
+import scouter.client.cubrid.actions.AddLongTransactionList;
+import scouter.client.model.AgentModelThread;
+import scouter.client.model.RefreshThread;
+import scouter.client.model.RefreshThread.Refreshable;
+import scouter.client.net.TcpProxy;
+import scouter.client.server.Server;
+import scouter.client.server.ServerManager;
+import scouter.client.sorter.ColumnLabelSorter;
+import scouter.client.util.ExUtil;
+import scouter.client.util.TimeUtil;
+import scouter.lang.constants.StatusConstants;
+import scouter.lang.counters.CounterConstants;
+import scouter.lang.pack.MapPack;
+import scouter.lang.pack.Pack;
+import scouter.lang.pack.StatusPack;
+import scouter.lang.value.ListValue;
+import scouter.lang.value.MapValue;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+import scouter.util.DateUtil;
+
+public class CubridLongTransactionList extends ViewPart implements Refreshable {
+
+ public static final String ID = CubridLongTransactionList.class.getName();
+
+ static long TIME_RANGE = DateUtil.MILLIS_PER_FIVE_MINUTE;
+ static int REFRESH_INTERVAL = (int) (DateUtil.MILLIS_PER_SECOND * 5);
+
+ String[] maxListArray = {"10","20","50","100","1000"};
+
+ static int DEFAULT_MAX_LIST = 1000;
+
+ private Combo dbListCombo;
+ private Label MaxLabel;
+ private Combo MaxListCombo;
+ private int MaxListValue = 50;
+
+ private TableViewer viewer;
+ private TableColumnLayout tableColumnLayout;
+
+ private Clipboard clipboard;
+ private int serverId;
+
+ RefreshThread thread;
+
+ String date;
+ long stime, etime;
+
+ Map saveData;
+
+ ArrayList transactionList = new ArrayList<>();
+
+ String selectionDB = "";
+ boolean isDefaultView = false;
+ int lastListIndex = 0;
+ int prvActiveDBHash = -1;
+
+ public void init(IViewSite site) throws PartInitException {
+ super.init(site);
+ String secId = site.getSecondaryId();
+ String ids[] = secId.split("&");
+ serverId = CastUtil.cint(ids[0]);
+ selectionDB = CastUtil.cString(ids[1]);
+
+ if (selectionDB.equals("default")) {
+ isDefaultView = true;
+ }
+
+ saveData = new LinkedHashMap() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected boolean removeEldestEntry(Map.Entry eldest) {
+ return size() > DEFAULT_MAX_LIST;
+ }
+ };
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+ initialLayout(parent);
+ clipboard = new Clipboard(null);
+ }
+
+ private void initialLayout(Composite parent) {
+ Server server = ServerManager.getInstance().getServer(serverId);
+ this.setPartName("Long Transaction List[" + server.getName() + "]");
+ parent.setLayout(new GridLayout(2, true));
+
+ dbListCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+ if (!isDefaultView) {
+ dbListCombo.add(selectionDB);
+ dbListCombo.select(0);
+ dbListCombo.setEnabled(false);
+ }
+
+ dbListCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ ExUtil.exec(parent, new Runnable() {
+ @Override
+ public void run() {
+ selectionDB = dbListCombo.getText();
+ saveData.clear();
+ transactionList.clear();
+ viewer.setInput(transactionList.toArray());
+ thread.interrupt();
+ }
+ });
+
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(2, true));
+ GridData gdata = new GridData();
+ gdata.horizontalAlignment = GridData.END;
+ gdata.verticalAlignment = GridData.CENTER;
+ composite.setLayoutData(gdata);
+
+ MaxLabel = new Label(composite, SWT.NONE);
+ MaxLabel.setText("MaxList : ");
+ MaxLabel.setLayoutData(new GridData(SWT.CENTER, SWT.RIGHT, false, false));
+ MaxListCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
+ ArrayList valueStrList = new ArrayList();
+ for (int i = 0; i < maxListArray.length ; i++) {
+ valueStrList.add(maxListArray[i]);
+ }
+ MaxListCombo.setItems(valueStrList.toArray(new String[maxListArray.length]));
+ MaxListCombo.select(2);
+ MaxListCombo.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, false, false));
+
+ MaxListCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ MaxListValue = Integer.parseInt(maxListArray[MaxListCombo.getSelectionIndex()]);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ Composite tableComposite = new Composite(parent, SWT.NONE);
+ GridData gdataTable = new GridData(GridData.FILL_BOTH);
+ gdataTable.horizontalSpan = 2;
+ tableComposite.setLayoutData(gdataTable);
+ tableComposite.setLayout(new GridLayout(1, true));
+ createTableViewer(tableComposite);
+
+ thread = new RefreshThread(this, REFRESH_INTERVAL);
+ thread.start();
+ }
+
+// private void load() {
+// ExUtil.asyncRun(new Runnable() {
+// public void run() {
+// TcpProxy tcpProxy = TcpProxy.getTcpProxy(serverId);
+// try {
+// MapPack param = new MapPack();
+// param.put("objHash", objHash);
+// MapPack pack = (MapPack) tcpProxy.getSingle(RequestCmd.HOST_TOP, param);
+// if (pack == null) return;
+// String error = pack.getText("error");
+// if (error != null) {
+// ConsoleProxy.errorSafe(error);
+// }
+// ListValue pidLv = pack.getList("PID");
+// ListValue userLv = pack.getList("USER");
+// ListValue cpuLv = pack.getList("CPU");
+// ListValue memLv = pack.getList("MEM");
+// ListValue timeLv = pack.getList("TIME");
+// ListValue nameLv = pack.getList("NAME");
+//
+// transactionList = new TransactionObject[pidLv.size()];
+// for (int i = 0; i < pidLv.size(); i++) {
+// transactionList[lastListIndex] = new TransactionObject();
+// transactionList[lastListIndex].sql_text = (int) pidLv.getLong(i);
+// transactionList[lastListIndex].user = userLv.getString(i);
+// transactionList[lastListIndex].sql_id = (float) cpuLv.getDouble(i);
+// transactionList[lastListIndex].host = memLv.getLong(i);
+// transactionList[lastListIndex].pid = timeLv.getLong(i);
+// transactionList[lastListIndex].program = nameLv.getString(i);
+// transactionList[lastListIndex].tran_time = nameLv.getString(i);
+// transactionList[lastListIndex].query_time = nameLv.getString(i);
+// }
+// ExUtil.exec(viewer.getTable(), new Runnable() {
+// public void run() {
+// viewer.setInput(transactionList);
+// }
+// });
+// } catch (Throwable th){
+// th.printStackTrace();
+// } finally {
+// TcpProxy.putTcpProxy(tcpProxy);
+// }
+// }
+// });
+// }
+
+ private void createTableViewer(Composite composite) {
+ viewer = new TableViewer(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
+ tableColumnLayout = new TableColumnLayout();
+ composite.setLayout(tableColumnLayout);
+ createColumns();
+ final Table table = viewer.getTable();
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ createTableContextMenu();
+// table.addMouseListener(new MouseAdapter() {
+// public void mouseDoubleClick(MouseEvent e) {
+// TableItem[] item = table.getSelection();
+// if (item == null || item.length == 0)
+// return;
+// int pid = CastUtil.cint(item[0].getText(0));
+// IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+// try {
+// ProcessDetailView view = (ProcessDetailView) win.getActivePage().showView(
+// ProcessDetailView.ID, "" + pid + objHash, IWorkbenchPage.VIEW_ACTIVATE);
+// view.setInput(serverId, objHash, pid);
+// } catch (PartInitException e1) {}
+// }
+// });
+ viewer.setContentProvider(new ArrayContentProvider());
+ viewer.setComparator(new ColumnLabelSorter(viewer).setCustomCompare(new ColumnLabelSorter.ICustomCompare() {
+ public int doCompare(TableColumn col, int index, Object o1, Object o2) {
+ if (!(o1 instanceof TransactionObject) || !(o2 instanceof TransactionObject)) {
+ return 0;
+ }
+ TransactionObject p1 = (TransactionObject) o1;
+ TransactionObject p2 = (TransactionObject) o2;
+ Boolean isNumber = (Boolean) col.getData("isNumber");
+ if (isNumber != null && isNumber.booleanValue()) {
+ String v1 = ColumnLabelSorter.numonly(p1.getValueByIndex(index));
+ String v2 = ColumnLabelSorter.numonly(p2.getValueByIndex(index));
+ if (v1 == null) v1 = "0";
+ if (v2 == null) v2 = "0";
+ if (v1.contains(".") || v2.contains(".")) {
+ double d1 = Double.valueOf(v1);
+ double d2 = Double.valueOf(v2);
+ if (d1 > d2) {
+ return 1;
+ } else if (d2 > d1) {
+ return -1;
+ } else {
+ return 0;
+ }
+ } else {
+ long i1 = Long.valueOf(v1);
+ long i2 = Long.valueOf(v2);
+ if (i1 > i2) {
+ return 1;
+ } else if (i2 > i1) {
+ return -1;
+ } else {
+ return 0;
+ }
+ }
+ } else {
+ String v1 = p1.getValueByIndex(index);
+ String v2 = p2.getValueByIndex(index);
+ if (v1 == null) v1 = "";
+ if (v2 == null) v2 = "";
+ return v1.compareTo(v2);
+ }
+ }
+ }));
+ GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
+ viewer.getControl().setLayoutData(gridData);
+ }
+
+ boolean ctrlPressed = false;
+
+ private void createTableContextMenu() {
+ MenuManager manager = new MenuManager();
+ viewer.getControl().setMenu(manager.createContextMenu(viewer.getControl()));
+ manager.add(new Action("&Add LongTransaction ListView", ImageDescriptor.createFromImage(Images.add)) {
+ public void run() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ AddLongTransactionList dialog = new AddLongTransactionList(window.getShell().getDisplay(),
+ new AddLongTransactionList.IAddLongTransactionList() {
+ @Override
+ public void onPressedOk(String dbName) {
+ try {
+ window.getActivePage().showView(CubridLongTransactionList.ID,
+ serverId + "&" + dbName,
+ IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onPressedCancel() {
+ }
+ });
+
+ dialog.show();
+ }
+ });
+ manager.add(new Action("&Copy", ImageDescriptor.createFromImage(Images.copy)) {
+ public void run() {
+ selectionCopyToClipboard();
+ }
+ });
+ viewer.getTable().addListener(SWT.KeyDown, new Listener() {
+ public void handleEvent(Event e) {
+ if (e.keyCode == SWT.CTRL) {
+ ctrlPressed = true;
+ } else if (e.keyCode == 'c' || e.keyCode == 'C') {
+ if (ctrlPressed) {
+ selectionCopyToClipboard();
+ }
+ }
+ }
+ });
+
+ viewer.getTable().addListener(SWT.KeyUp, new Listener() {
+ public void handleEvent(Event e) {
+ if (e.keyCode == SWT.CTRL) {
+ ctrlPressed = false;
+ }
+ }
+ });
+ }
+
+ private void selectionCopyToClipboard() {
+ if (viewer != null) {
+ TableItem[] items = viewer.getTable().getSelection();
+ if (items != null && items.length > 0) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < items.length; i++) {
+ TransactionObject data = (TransactionObject) items[i].getData();
+ sb.append(data.toString());
+ }
+ clipboard.setContents(new Object[] {sb.toString()}, new Transfer[] {TextTransfer.getInstance()});
+ }
+ }
+ }
+
+ private void createColumns() {
+ for (ColumnEnum column : ColumnEnum.values()) {
+ TableViewerColumn c = createTableViewerColumn(column.getTitle(), column.getWidth(), column.getAlignment(), column.isResizable(), column.isMoveable(), column.isNumber());
+ ColumnLabelProvider labelProvider = null;
+ switch (column) {
+ case SQL_TEXT:
+ labelProvider = new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof TransactionObject) {
+ return ((TransactionObject) element).sql_text;
+ }
+ return null;
+ }
+ };
+ break;
+ case USER:
+ labelProvider = new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof TransactionObject) {
+ return ((TransactionObject) element).user;
+ }
+ return null;
+ }
+ };
+ break;
+ case SQL_ID:
+ labelProvider = new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof TransactionObject) {
+ return ((TransactionObject) element).sql_id;
+ }
+ return null;
+ }
+ };
+ break;
+ case HOST:
+ labelProvider = new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof TransactionObject) {
+ return ((TransactionObject) element).host;
+ }
+ return null;
+ }
+ };
+ break;
+ case PID:
+ labelProvider = new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof TransactionObject) {
+ return String.valueOf(((TransactionObject) element).pid);
+ }
+ return null;
+ }
+ };
+ break;
+ case PROGRAM:
+ labelProvider = new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof TransactionObject) {
+ return ((TransactionObject) element).program;
+ }
+ return null;
+ }
+ };
+ break;
+ case TRAN_TIME:
+ labelProvider = new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof TransactionObject) {
+ return String.valueOf(((TransactionObject) element).tran_time);
+ }
+ return null;
+ }
+ };
+ break;
+ case QUERY_TIME:
+ labelProvider = new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof TransactionObject) {
+ return String.valueOf(((TransactionObject) element).query_time);
+ }
+ return null;
+ }
+ };
+ break;
+ }
+
+ if (labelProvider != null) {
+ c.setLabelProvider(labelProvider);
+ }
+ }
+ }
+
+ private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
+ final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
+ final TableColumn column = viewerColumn.getColumn();
+ column.setText(title);
+ column.setAlignment(alignment);
+ column.setMoveable(moveable);
+ tableColumnLayout.setColumnData(column, new ColumnWeightData(30, width, resizable));
+ column.setData("isNumber", isNumber);
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
+ sorter.setColumn(column);
+ }
+ });
+ return viewerColumn;
+ }
+
+ @Override
+ public void setFocus() {
+ }
+
+ class TransactionObject {
+ String sql_text;
+ String user;
+ String sql_id;
+ String host;
+ String pid;
+ String program;
+ float tran_time;
+ float query_time;
+
+ public String getValueByIndex(int index) {
+ switch (index) {
+ case 0:
+ return sql_text;
+ case 1:
+ return user;
+ case 2:
+ return sql_id;
+ case 3:
+ return host;
+ case 4:
+ return pid;
+ case 5:
+ return program;
+ case 6:
+ return String.valueOf(tran_time);
+ case 7:
+ return String.valueOf(query_time);
+ }
+ return null;
+ }
+
+ public String toString() {
+ return sql_text + "\t" + user + "\t" + sql_id + "\t" + host + "\t"
+ + pid + "\t" + program + "\t" + tran_time + "\t" + query_time + "\n";
+ }
+ }
+
+ public enum ColumnEnum {
+ SQL_TEXT("SQL TEXT", 50, SWT.RIGHT, true, true, true),
+ TRAN_TIME("TRAN TIME", 150, SWT.LEFT, true, true, false),
+ QUERY_TIME("QUERY_TIME", 150, SWT.LEFT, true, true, false),
+ HOST("HOST", 50, SWT.RIGHT, true, true, true),
+ PID("PID", 50, SWT.RIGHT, true, true, true),
+ USER("USER", 70, SWT.RIGHT, true, true, false),
+ PROGRAM("PROGRAM", 100, SWT.RIGHT, true, true, true),
+ SQL_ID("SQL_ID", 50, SWT.RIGHT, true, true, true);
+
+ private final String title;
+ private final int width;
+ private final int alignment;
+ private final boolean resizable;
+ private final boolean moveable;
+ private final boolean isNumber;
+
+ private ColumnEnum(String text, int width, int alignment, boolean resizable, boolean moveable, boolean isNumber) {
+ this.title = text;
+ this.width = width;
+ this.alignment = alignment;
+ this.resizable = resizable;
+ this.moveable = moveable;
+ this.isNumber = isNumber;
+ }
+
+ public String getTitle(){
+ return title;
+ }
+
+ public int getAlignment(){
+ return alignment;
+ }
+
+ public boolean isResizable(){
+ return resizable;
+ }
+
+ public boolean isMoveable(){
+ return moveable;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public boolean isNumber() {
+ return this.isNumber;
+ }
+ }
+
+ @Override
+ public void refresh() {
+ ActiveDbInfo activeDBList = ActiveDbInfo.getInstance();
+
+ long now = TimeUtil.getCurrentTime(serverId);
+ date = DateUtil.yyyymmdd(now);
+ stime = now - TIME_RANGE;
+ etime = now;
+
+ if (isDefaultView) {
+ if (selectionDB.equals("") || selectionDB.equals("default")) {
+ checkDBList();
+ return;
+ } else {
+ checkDBList();
+ }
+ }
+
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ Pack p = null;
+
+ try {
+ MapPack param = new MapPack();
+ ListValue objHashLv = AgentModelThread.getInstance().getLiveObjHashLV(serverId,
+ CounterConstants.CUBRID_AGENT);
+ StatusPack sp = null;
+ MapValue mv = null;
+
+ if (objHashLv.size() > 0) {
+ if (activeDBList.isEmpty()) {
+ transactionList.clear();
+ }
+
+ param.put("objHash", objHashLv);
+ param.put("date", date);
+ param.put("stime", stime);
+ param.put("etime", etime);
+ param.put("time", now);
+ param.put("key", StatusConstants.CUBRID_DB_TRANSACTION_INFO + selectionDB);
+ p = tcp.getSingle(RequestCmd.CUBRID_DB_LONG_TRANSACTION_DATA, param);
+ if (p != null) {
+ sp = (StatusPack) p;
+ mv = sp.data;
+ }
+
+ if (mv != null) {
+ String key;
+ TransactionObject tranObj;
+ for (int i=0 ; i < mv.getList("user").size() ; i++) {
+ tranObj = new TransactionObject();
+ tranObj.sql_text = mv.getList("SQL_Text").get(i).toString();
+ tranObj.user = mv.getList("user").get(i).toString();
+ tranObj.sql_id = mv.getList("SQL_ID").get(i).toString();
+ tranObj.host = mv.getList("host").get(i).toString();
+ tranObj.pid = mv.getList("pid").get(i).toString();
+ tranObj.program = mv.getList("program").get(i).toString();
+ tranObj.tran_time = mv.getList("tran_time").getFloat(i);
+ tranObj.query_time = mv.getList("query_time").getFloat(i);
+ key = tranObj.sql_id + tranObj.host + tranObj.pid + tranObj.user + tranObj.program;
+
+ if (saveData.get(key) == null) {
+ saveData.put(key, tranObj);
+ } else {
+ saveData.remove(key);
+ saveData.put(key, tranObj);
+ }
+ }
+ }
+ }
+ } catch (Throwable th) {
+ th.printStackTrace();
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+
+ if (saveData.size() > 0) {
+ updateTableview();
+ }
+ }
+
+ private void updateTableview() {
+ int skipCount = saveData.size() - MaxListValue;
+ transactionList.clear();
+ for(String key : saveData.keySet()) {
+ if (skipCount > 0) {
+ skipCount--;
+ } else {
+ transactionList.add(saveData.get(key));
+ }
+ }
+
+ ExUtil.exec(viewer.getTable(), new Runnable() {
+ public void run() {
+ viewer.setInput(transactionList.toArray());
+ }
+ });
+ }
+
+ public void checkDBList() {
+
+ if (!isDefaultView) {
+ return;
+ }
+
+ if (ActiveDbInfo.getInstance().getActiveDBInfo().hashCode() == prvActiveDBHash) {
+ return;
+ }
+
+ prvActiveDBHash = ActiveDbInfo.getInstance().getActiveDBInfo().hashCode();
+
+ ExUtil.exec(dbListCombo, new Runnable() {
+ public void run() {
+ dbListCombo.removeAll();
+ }
+ });
+
+ if (!ActiveDbInfo.getInstance().isEmpty()) {
+ ExUtil.exec(dbListCombo, new Runnable() {
+ public void run() {
+ for (String dbName : ActiveDbInfo.getInstance().keySet()) {
+ dbListCombo.add(dbName);
+ }
+ dbListCombo.setEnabled(true);
+ }
+ });
+
+ } else {
+ ExUtil.exec(dbListCombo, new Runnable() {
+ public void run() {
+ selectionDB = "";
+ dbListCombo.setEnabled(false);
+ }
+ });
+ }
+
+ ExUtil.exec(dbListCombo, new Runnable() {
+ public void run() {
+ for (int i = 0; i < dbListCombo.getItemCount(); i++) {
+ if (dbListCombo.getItem(i).equals(selectionDB)) {
+ dbListCombo.select(i);
+ return;
+ }
+ }
+
+ if (dbListCombo.getItemCount() != 0) {
+ dbListCombo.select(0);
+ selectionDB = dbListCombo.getItem(dbListCombo.getSelectionIndex());
+ }
+ }
+ });
+ }
+}
+
+
diff --git a/scouter.client/src/scouter/client/cubrid/views/CubridRealtimeDmlView.java b/scouter.client/src/scouter/client/cubrid/views/CubridRealtimeDmlView.java
new file mode 100755
index 000000000..c3b4a8086
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/views/CubridRealtimeDmlView.java
@@ -0,0 +1,549 @@
+/*
+ * 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.client.cubrid.views;
+
+import org.csstudio.swt.xygraph.dataprovider.CircularBufferDataProvider;
+import org.csstudio.swt.xygraph.dataprovider.Sample;
+import org.csstudio.swt.xygraph.figures.Trace;
+import org.csstudio.swt.xygraph.figures.Trace.PointStyle;
+import org.csstudio.swt.xygraph.figures.Trace.TraceType;
+import org.csstudio.swt.xygraph.figures.XYGraph;
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+
+import scouter.client.Images;
+import scouter.client.cubrid.ActiveDbInfo;
+import scouter.client.cubrid.actions.AddLongTransactionList;
+import scouter.client.listeners.RangeMouseListener;
+import scouter.client.model.AgentModelThread;
+import scouter.client.model.RefreshThread;
+import scouter.client.model.RefreshThread.Refreshable;
+import scouter.client.net.TcpProxy;
+import scouter.client.preferences.PManager;
+import scouter.client.preferences.PreferenceConstants;
+import scouter.client.server.Server;
+import scouter.client.server.ServerManager;
+import scouter.client.util.ChartUtil;
+import scouter.client.util.ColorUtil;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ExUtil;
+import scouter.client.util.ImageUtil;
+import scouter.client.util.TimeUtil;
+import scouter.lang.counters.CounterConstants;
+import scouter.lang.pack.MapPack;
+import scouter.lang.value.DecimalValue;
+import scouter.lang.value.ListValue;
+import scouter.lang.value.MapValue;
+import scouter.lang.value.Value;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+import scouter.util.DateUtil;
+import scouter.util.HashUtil;
+import scouter.util.LinkedList;
+import scouter.util.StringUtil;
+import scouter.util.LinkedList.ENTRY;
+
+public class CubridRealtimeDmlView extends ViewPart implements Refreshable {
+
+ public static final String ID = CubridRealtimeDmlView.class.getName();
+
+ int serverId;
+ String selectionDB;
+
+ RefreshThread thread;
+
+ static long TIME_RANGE = DateUtil.MILLIS_PER_FIVE_MINUTE;
+ static int REFRESH_INTERVAL = (int) (DateUtil.MILLIS_PER_SECOND * 5);
+ static int BUFFER_SIZE = (int) (TIME_RANGE / REFRESH_INTERVAL) + 1;
+
+ FigureCanvas canvas;
+ XYGraph xyGraph;
+
+ Combo dbListCombo;
+ boolean isDefaultView = false;
+ int prvActiveDBHash;
+
+ Trace selectTrace;
+ Trace insertTrace;
+ Trace updateTrace;
+ Trace deleteTrace;
+
+ boolean isStackView = true;
+
+ String date;
+ long stime;
+ long etime;
+
+ LinkedList valueLogs = new LinkedList();
+
+ public void init(IViewSite site) throws PartInitException {
+ super.init(site);
+ String secId = site.getSecondaryId();
+ String[] ids = StringUtil.split(secId, "&");
+ serverId = CastUtil.cint(ids[0]);
+ selectionDB = CastUtil.cString(ids[1]);
+
+ if (selectionDB.equals("default")) {
+ isDefaultView = true;
+ }
+ }
+
+ public void createPartControl(Composite parent) {
+ Server server = ServerManager.getInstance().getServer(serverId);
+ this.setPartName("REALTIME DML[" + server.getName() + "]");
+ GridLayout layout = new GridLayout(1, true);
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+
+ dbListCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbListCombo.setLayoutData(new GridData(SWT.FILL));
+
+ if (!isDefaultView) {
+ dbListCombo.add(selectionDB);
+ dbListCombo.select(0);
+ dbListCombo.setEnabled(false);
+ }
+
+ dbListCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ ExUtil.exec(canvas, new Runnable() {
+ @Override
+ public void run() {
+ selectionDB = dbListCombo.getText();
+ CircularBufferDataProvider delProvider = (CircularBufferDataProvider) deleteTrace
+ .getDataProvider();
+ CircularBufferDataProvider upProvider = (CircularBufferDataProvider) updateTrace
+ .getDataProvider();
+ CircularBufferDataProvider inProvider = (CircularBufferDataProvider) insertTrace
+ .getDataProvider();
+ CircularBufferDataProvider selProvider = (CircularBufferDataProvider) selectTrace
+ .getDataProvider();
+ delProvider.clearTrace();
+ upProvider.clearTrace();
+ inProvider.clearTrace();
+ selProvider.clearTrace();
+ thread.interrupt();
+ }
+ });
+
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ parent.setLayout(layout);
+ parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));
+ parent.setBackgroundMode(SWT.INHERIT_FORCE);
+ canvas = new FigureCanvas(parent);
+ canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
+ canvas.setScrollBarVisibility(FigureCanvas.NEVER);
+ canvas.addControlListener(new ControlListener() {
+ public void controlMoved(ControlEvent arg0) {
+ }
+
+ public void controlResized(ControlEvent arg0) {
+ Rectangle r = canvas.getClientArea();
+ xyGraph.setSize(r.width, r.height);
+ }
+ });
+
+ xyGraph = new XYGraph();
+ xyGraph.setShowLegend(true);
+ xyGraph.setShowTitle(false);
+ canvas.setContents(xyGraph);
+
+ xyGraph.primaryXAxis.setDateEnabled(true);
+ xyGraph.primaryXAxis.setShowMajorGrid(true);
+ xyGraph.primaryYAxis.setAutoScale(true);
+ xyGraph.primaryYAxis.setShowMajorGrid(true);
+ xyGraph.primaryXAxis.setFormatPattern("HH:mm:ss");
+ xyGraph.primaryYAxis.setFormatPattern("#,##0");
+
+ xyGraph.primaryXAxis.setTitle("");
+ xyGraph.primaryYAxis.setTitle("");
+
+ xyGraph.primaryYAxis.addMouseListener(new RangeMouseListener(getViewSite().getShell(), xyGraph.primaryYAxis));
+
+ CircularBufferDataProvider selectProvider = new CircularBufferDataProvider(true);
+ selectProvider.setBufferSize(BUFFER_SIZE);
+ selectProvider.setCurrentXDataArray(new double[] {});
+ selectProvider.setCurrentYDataArray(new double[] {});
+ selectTrace = new Trace("Select (SUM)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, selectProvider);
+ selectTrace.setPointStyle(PointStyle.NONE);
+ selectTrace.setTraceType(TraceType.AREA);
+ selectTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ selectTrace.setAreaAlpha(255);
+ selectTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_CYAN));
+ xyGraph.addTrace(selectTrace);
+
+ CircularBufferDataProvider insertProvider = new CircularBufferDataProvider(true);
+ insertProvider.setBufferSize(BUFFER_SIZE);
+ insertProvider.setCurrentXDataArray(new double[] {});
+ insertProvider.setCurrentYDataArray(new double[] {});
+ insertTrace = new Trace("Insert (SUM)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, insertProvider);
+ insertTrace.setPointStyle(PointStyle.NONE);
+ insertTrace.setTraceType(TraceType.AREA);
+ insertTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ insertTrace.setAreaAlpha(255);
+ insertTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_GRAY));
+ xyGraph.addTrace(insertTrace);
+
+ CircularBufferDataProvider updateProvider = new CircularBufferDataProvider(true);
+ updateProvider.setBufferSize(BUFFER_SIZE);
+ updateProvider.setCurrentXDataArray(new double[] {});
+ updateProvider.setCurrentYDataArray(new double[] {});
+ updateTrace = new Trace("Update (SUM)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, updateProvider);
+ updateTrace.setPointStyle(PointStyle.NONE);
+ updateTrace.setTraceType(TraceType.AREA);
+ updateTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ updateTrace.setAreaAlpha(255);
+ updateTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_GREEN));
+ xyGraph.addTrace(updateTrace);
+
+ CircularBufferDataProvider deleteProvider = new CircularBufferDataProvider(true);
+ deleteProvider.setBufferSize(BUFFER_SIZE);
+ deleteProvider.setCurrentXDataArray(new double[] {});
+ deleteProvider.setCurrentYDataArray(new double[] {});
+ deleteTrace = new Trace("Delete (SUM)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, deleteProvider);
+ deleteTrace.setPointStyle(PointStyle.NONE);
+ deleteTrace.setTraceType(TraceType.AREA);
+ deleteTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ deleteTrace.setAreaAlpha(255);
+ deleteTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_MAGENTA));
+ xyGraph.addTrace(deleteTrace);
+
+ IToolBarManager man = getViewSite().getActionBars().getToolBarManager();
+ Action stackViewAct = new Action("Area Mode", IAction.AS_CHECK_BOX) {
+ public void run() {
+ isStackView = isChecked();
+ changeMode();
+ }
+ };
+ stackViewAct.setImageDescriptor(ImageUtil.getImageDescriptor(Images.sum));
+ stackViewAct.setChecked(true);
+ man.add(stackViewAct);
+
+
+ createContextMenu();
+
+ thread = new RefreshThread(this, REFRESH_INTERVAL);
+ thread.start();
+ }
+
+ private void createContextMenu() {
+ MenuManager manager = new MenuManager();
+ canvas.setMenu(manager.createContextMenu(canvas));
+ manager.add(new Action("&Add Realtime DML", ImageDescriptor.createFromImage(Images.add)) {
+ public void run() {
+ IWorkbenchWindow window = getSite().getWorkbenchWindow();
+ AddLongTransactionList dialog = new AddLongTransactionList(getSite().getWorkbenchWindow().getShell().getDisplay(),
+ new AddLongTransactionList.IAddLongTransactionList() {
+ @Override
+ public void onPressedOk(String dbName) {
+ try {
+ window.getActivePage().showView(CubridRealtimeDmlView.ID,
+ serverId + "&" + dbName ,
+ IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onPressedCancel() {
+ }
+ });
+
+ dialog.show();
+ }
+ });
+ }
+
+ public void setFocus() {
+
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ if (this.thread != null) {
+ this.thread.shutdown();
+ }
+ }
+
+ public void refresh() {
+
+ if (isDefaultView) {
+ if (selectionDB.equals("default")) {
+ checkDBList();
+ return;
+ } else {
+ checkDBList();
+ }
+ }
+
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ Value v = null;
+ try {
+ MapPack param = new MapPack();
+
+ if (ActiveDbInfo.getInstance() == null || ActiveDbInfo.getInstance().isEmpty()) {
+ return;
+ }
+
+ if (selectionDB == null) {
+ return;
+ }
+
+ if (ActiveDbInfo.getInstance() == null) {
+ System.out.println("CubridRealtimeDmlView ActiveDbInfo.getInstance() is null");
+ }
+
+ String objectName = ActiveDbInfo.getInstance().getObjectName(selectionDB);
+
+ if (objectName == null) {
+ return;
+ }
+
+ int objHash = HashUtil.hash(objectName);
+ ListValue objHashLv = AgentModelThread.getInstance().getLiveObjHashLV(serverId,
+ CounterConstants.CUBRID_AGENT);
+ objHashLv.add(objHash);
+ if (objHashLv.size() > 0) {
+ long now = TimeUtil.getCurrentTime(serverId);
+ date = DateUtil.yyyymmdd(now);
+ stime = now - TIME_RANGE;
+ etime = now;
+
+ param.put("objHash", objHashLv);
+
+ param.put("date", date);
+ param.put("stime", stime);
+ param.put("etime", etime);
+ param.put("time", now);
+
+ v = tcp.getSingleValue(RequestCmd.CUBRID_DB_REALTIME_DML, param);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ ConsoleProxy.errorSafe(e.toString());
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ if (v == null) {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ setTitleImage(Images.inactive);
+ long now = TimeUtil.getCurrentTime(serverId);
+ long stime = now - TIME_RANGE;
+ xyGraph.primaryXAxis.setRange(stime, now + 1);
+ }
+ });
+ } else {
+ MapValue mv = (MapValue) v;
+ final DecimalValue selectValue = new DecimalValue(mv.getLong("select"));
+ final DecimalValue insertValue = new DecimalValue(mv.getLong("insert"));
+ final DecimalValue updateValue = new DecimalValue(mv.getLong("update"));
+ final DecimalValue deleteValue = new DecimalValue(mv.getLong("delete"));
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ setTitleImage(Images.active);
+ long now = TimeUtil.getCurrentTime(serverId) / REFRESH_INTERVAL * REFRESH_INTERVAL;
+ long stime = now - TIME_RANGE;
+ xyGraph.primaryXAxis.setRange(stime, now + 1);
+ ValueLog valueLog = new ValueLog();
+ valueLog.time = now;
+ valueLog.delete = deleteValue.value;
+ valueLog.update = updateValue.value;
+ valueLog.insert = insertValue.value;
+ valueLog.select = selectValue.value;
+ valueLogs.add(valueLog);
+ if (valueLogs.size() > BUFFER_SIZE) {
+ valueLogs.removeFirst();
+ }
+ if (isStackView) {
+ updateValue.value += deleteValue.value;
+ insertValue.value += updateValue.value;
+ selectValue.value += insertValue.value;
+ }
+ ((CircularBufferDataProvider) selectTrace.getDataProvider())
+ .addSample(new Sample(now, selectValue.value));
+ ((CircularBufferDataProvider) insertTrace.getDataProvider())
+ .addSample(new Sample(now, insertValue.value));
+ ((CircularBufferDataProvider) updateTrace.getDataProvider())
+ .addSample(new Sample(now, updateValue.value));
+ ((CircularBufferDataProvider) deleteTrace.getDataProvider())
+ .addSample(new Sample(now, deleteValue.value));
+ xyGraph.primaryYAxis.setRange(0, getMaxYValue());
+ }
+
+ private double getMaxYValue() {
+ double value = ChartUtil
+ .getMax(((CircularBufferDataProvider) selectTrace.getDataProvider()).iterator());
+ value = Math.max(value,
+ ChartUtil.getMax(((CircularBufferDataProvider) insertTrace.getDataProvider()).iterator()));
+ value = Math.max(value,
+ ChartUtil.getMax(((CircularBufferDataProvider) updateTrace.getDataProvider()).iterator()));
+ value = Math.max(value,
+ ChartUtil.getMax(((CircularBufferDataProvider) deleteTrace.getDataProvider()).iterator()));
+ return value;
+ }
+ });
+ }
+ }
+
+ protected void changeMode() {
+ CircularBufferDataProvider delProvider = (CircularBufferDataProvider) deleteTrace.getDataProvider();
+ CircularBufferDataProvider upProvider = (CircularBufferDataProvider) updateTrace.getDataProvider();
+ CircularBufferDataProvider inProvider = (CircularBufferDataProvider) insertTrace.getDataProvider();
+ CircularBufferDataProvider selProvider = (CircularBufferDataProvider) selectTrace.getDataProvider();
+ delProvider.clearTrace();
+ upProvider.clearTrace();
+ inProvider.clearTrace();
+ selProvider.clearTrace();
+ int size = valueLogs.size();
+ if (size > 0) {
+ ENTRY entry = valueLogs.getFirst();
+ if (isStackView) {
+ do {
+ ValueLog log = entry.item;
+ double x = log.time;
+ double delValue = log.delete;
+ double upValue = delValue + log.update;
+ double inValue = upValue + log.insert;
+ double selValue = inValue + log.select;
+ selProvider.addSample(new Sample(x, selValue));
+ inProvider.addSample(new Sample(x, inValue));
+ upProvider.addSample(new Sample(x, upValue));
+ delProvider.addSample(new Sample(x, delValue));
+ } while ((entry = entry.next) != null);
+ } else {
+ do {
+ ValueLog log = entry.item;
+ double x = log.time;
+ double delValue = log.delete;
+ double upValue = log.update;
+ double inValue = log.insert;
+ double selValue = log.select;
+ selProvider.addSample(new Sample(x, selValue));
+ inProvider.addSample(new Sample(x, inValue));
+ upProvider.addSample(new Sample(x, upValue));
+ delProvider.addSample(new Sample(x, delValue));
+ } while ((entry = entry.next) != null);
+ }
+ }
+ if (isStackView) {
+ deleteTrace.setTraceType(TraceType.AREA);
+ updateTrace.setTraceType(TraceType.AREA);
+ insertTrace.setTraceType(TraceType.AREA);
+ selectTrace.setTraceType(TraceType.AREA);
+ } else {
+ deleteTrace.setTraceType(TraceType.SOLID_LINE);
+ updateTrace.setTraceType(TraceType.SOLID_LINE);
+ insertTrace.setTraceType(TraceType.SOLID_LINE);
+ selectTrace.setTraceType(TraceType.SOLID_LINE);
+ }
+ }
+
+ public void checkDBList() {
+
+ if (!isDefaultView) {
+ return;
+ }
+
+ if (ActiveDbInfo.getInstance().getActiveDBInfo().hashCode() == prvActiveDBHash) {
+ return;
+ }
+
+ prvActiveDBHash = ActiveDbInfo.getInstance().getActiveDBInfo().hashCode();
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ dbListCombo.removeAll();
+ }
+ });
+
+ if (!ActiveDbInfo.getInstance().isEmpty()) {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ for (String dbName : ActiveDbInfo.getInstance().keySet()) {
+ dbListCombo.add(dbName);
+ }
+ dbListCombo.setEnabled(true);
+ }
+ });
+
+ } else {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ dbListCombo.setEnabled(false);
+ }
+ });
+ }
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ for (int i = 0; i < dbListCombo.getItemCount(); i++) {
+ if (dbListCombo.getItem(i).equals(selectionDB)) {
+ dbListCombo.select(i);
+ selectionDB = dbListCombo.getItem(dbListCombo.getSelectionIndex());
+ return;
+ }
+ }
+
+ if (dbListCombo.getItemCount() != 0) {
+ dbListCombo.select(0);
+ selectionDB = dbListCombo.getItem(dbListCombo.getSelectionIndex());
+ }
+ }
+ });
+ }
+
+ private static class ValueLog {
+ long time;
+ double delete;
+ double update;
+ double insert;
+ double select;
+ }
+}
diff --git a/scouter.client/src/scouter/client/cubrid/views/CubridServerInfoView.java b/scouter.client/src/scouter/client/cubrid/views/CubridServerInfoView.java
new file mode 100755
index 000000000..c82f2e2da
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/views/CubridServerInfoView.java
@@ -0,0 +1,415 @@
+/*
+ * 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.client.cubrid.views;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.layout.TableColumnLayout;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+
+import scouter.client.cubrid.ActiveDbInfo;
+import scouter.client.model.AgentModelThread;
+import scouter.client.model.RefreshThread;
+import scouter.client.model.RefreshThread.Refreshable;
+import scouter.client.net.TcpProxy;
+import scouter.client.sorter.TableLabelSorter;
+import scouter.client.util.ExUtil;
+import scouter.client.util.TimeUtil;
+import scouter.lang.constants.StatusConstants;
+import scouter.lang.counters.CounterConstants;
+import scouter.lang.pack.MapPack;
+import scouter.lang.pack.Pack;
+import scouter.lang.pack.StatusPack;
+import scouter.lang.value.ListValue;
+import scouter.lang.value.MapValue;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+import scouter.util.DateUtil;
+
+public class CubridServerInfoView extends ViewPart implements Refreshable {
+ public static final String ID = CubridServerInfoView.class.getName();
+
+ static long TIME_RANGE = DateUtil.MILLIS_PER_FIVE_MINUTE;
+ static int REFRESH_INTERVAL = (int) (DateUtil.MILLIS_PER_SECOND * 5);
+
+ int serverId;
+
+ private ArrayList dataList;
+ private ArrayList responseData;
+ private TableViewer tableViewer;
+ private TableColumnLayout tableColumnLayout;
+
+ RefreshThread thread;
+
+ String date;
+ long stime, etime;
+
+ MapValue prvData;
+
+ @Override
+ public void init(IViewSite site) throws PartInitException {
+ super.init(site);
+ String secId = site.getSecondaryId();
+ serverId = CastUtil.cint(secId);
+ dataList = new ArrayList<>();
+ responseData = new ArrayList<>();
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+ this.setPartName("CUBRID ServerInfo");
+
+ Composite tableComposite = new Composite(parent, SWT.NONE);
+ tableColumnLayout = new TableColumnLayout();
+ tableComposite.setLayout(tableColumnLayout);
+
+ tableViewer = new TableViewer(tableComposite, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
+ tableViewer.setComparator(new TableLabelSorter(tableViewer));
+ tableViewer.setUseHashlookup(true);
+ tableViewer.getTable().setLinesVisible(true);
+ tableViewer.getTable().setHeaderVisible(true);
+
+ createColumns();
+
+ tableViewer.setContentProvider(new ArrayContentProvider());
+ tableViewer.setLabelProvider(new ITableLabelProvider() {
+ @Override
+ public void removeListener(ILabelProviderListener arg0) {
+ }
+
+ @Override
+ public boolean isLabelProperty(Object arg0, String arg1) {
+ return false;
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void addListener(ILabelProviderListener arg0) {
+ }
+
+ @Override
+ public String getColumnText(Object arg0, int arg1) {
+ ServerInfo info = (ServerInfo) arg0;
+ switch (arg1) {
+ case 0:
+ return info.dbName;
+ case 1:
+ return info.ipAddress;
+ case 2:
+ return info.cpuUsed + "%";
+ case 3:
+ return info.activeSession;
+ case 4:
+ return info.lockWaitSession;
+ }
+ return "";
+ }
+
+ @Override
+ public Image getColumnImage(Object arg0, int arg1) {
+ return null;
+ }
+
+ });
+
+ createTableContextMenu();
+
+ thread = new RefreshThread(this, REFRESH_INTERVAL);
+ thread.start();
+ }
+
+ private void createTableContextMenu() {
+ /*
+ * MenuManager manager = new MenuManager();
+ * tableViewer.getControl().setMenu(manager.createContextMenu(
+ * tableViewer.getControl())); manager.add(new
+ * AddRealTimeMultiViewAction(serverId, MultiViewType.DATABASE_IO,
+ * "Add View"));
+ */
+ }
+
+ private void createColumns() {
+ for (ColumnEnum column : ColumnEnum.values()) {
+ createTableViewerColumn(column.getTitle(), column.getWidth(), column.getAlignment(), column.isResizable(),
+ column.isMoveable(), column.isNumber());
+ }
+ }
+
+ private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable,
+ boolean moveable, final boolean isNumber) {
+ final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
+ final TableColumn column = viewerColumn.getColumn();
+ column.setText(title);
+ column.setAlignment(alignment);
+ column.setMoveable(moveable);
+ tableColumnLayout.setColumnData(column, new ColumnWeightData(width, width, resizable));
+ column.setData("isNumber", isNumber);
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ TableLabelSorter sorter = (TableLabelSorter) tableViewer.getComparator();
+ TableColumn selectedColumn = (TableColumn) e.widget;
+ sorter.setColumn(selectedColumn);
+ }
+ });
+ return viewerColumn;
+ }
+
+ private class ServerInfo {
+
+ String dbName;
+ String ipAddress;
+ String cpuUsed;
+ String activeSession;
+ String lockWaitSession;
+
+ public ServerInfo(String dbName, String ip, String cpu, String active, String lockWait) {
+ super();
+ this.dbName = dbName;
+ this.ipAddress = ip;
+ this.cpuUsed = cpu;
+ this.activeSession = active;
+ this.lockWaitSession = lockWait;
+ }
+ }
+
+ @Override
+ public void refresh() {
+
+ ActiveDbInfo activeDBList = ActiveDbInfo.getInstance();
+
+ long now = TimeUtil.getCurrentTime(serverId);
+ date = DateUtil.yyyymmdd(now);
+ stime = now - TIME_RANGE;
+ etime = now;
+
+ if (!getDBList()) {
+ dataList.clear();
+ ExUtil.exec(tableViewer.getTable(), new Runnable() {
+ public void run() {
+ if (tableViewer != null) {
+ tableViewer.setInput(dataList);
+ }
+ }
+ });
+ return;
+ }
+
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ Pack p = null;
+
+ try {
+ responseData.clear();
+ MapPack param = new MapPack();
+ ListValue objHashLv = AgentModelThread.getInstance().getLiveObjHashLV(serverId,
+ CounterConstants.CUBRID_AGENT);
+ StatusPack sp = null;
+ MapValue mv = null;
+
+ if (objHashLv.size() > 0) {
+ if (activeDBList.isEmpty()) {
+ dataList.clear();
+ }
+
+ for (String dbName : activeDBList.keySet()) {
+ param.put("objHash", objHashLv);
+ param.put("date", date);
+ param.put("stime", stime);
+ param.put("etime", etime);
+ param.put("time", now);
+ param.put("key", StatusConstants.CUBRID_DB_SERVER_INFO + dbName);
+ p = tcp.getSingle(RequestCmd.CUBRID_DB_SERVER_INFO, param);
+ if (p != null) {
+ sp = (StatusPack) p;
+ mv = sp.data;
+ responseData.add(mv);
+ }
+ }
+ }
+ } catch (Throwable th) {
+ th.printStackTrace();
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+
+ String dbName;
+ String ipAddress;
+ String cpuUsed;
+ String activeSession;
+ String lockWaitSession;
+ boolean isSearched = false;
+
+ for (int i = 0; i < responseData.size(); i++) {
+ isSearched = false;
+ dbName = responseData.get(i).getText("db_name");
+ ipAddress = responseData.get(i).getText("ip_address");
+ cpuUsed = responseData.get(i).getText("cpu_used");
+ activeSession = responseData.get(i).getText("active_session");
+ lockWaitSession = responseData.get(i).getText("lock_wait_sessions");
+ for (int j = 0; j < dataList.size(); j++) {
+ if (dataList.get(j).dbName.equals(dbName)) {
+ dataList.get(j).ipAddress = ipAddress;
+ dataList.get(j).cpuUsed = cpuUsed;
+ dataList.get(j).activeSession = activeSession;
+ dataList.get(j).lockWaitSession = lockWaitSession;
+ isSearched = true;
+ break;
+ }
+ }
+ if (!isSearched) {
+ dataList.add(new ServerInfo(responseData.get(i).getText("db_name"),
+ responseData.get(i).getText("ip_address"),
+ responseData.get(i).getText("cpu_used"),
+ responseData.get(i).getText("active_session"),
+ responseData.get(i).getText("lock_wait_sessions")));
+ }
+ }
+
+ ExUtil.exec(tableViewer.getTable(), new Runnable() {
+ public void run() {
+ if (tableViewer != null) {
+ tableViewer.setInput(dataList);
+ }
+ }
+ });
+ }
+
+ private boolean getDBList() {
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ Pack p = null;
+ ActiveDbInfo activeDBList = ActiveDbInfo.getInstance();
+ try {
+ MapPack param = new MapPack();
+ ListValue objHashLv = AgentModelThread.getInstance().getLiveObjHashLV(serverId,
+ CounterConstants.CUBRID_AGENT);
+ if (objHashLv.size() > 0) {
+ param.put("objHash", objHashLv);
+ param.put("key", StatusConstants.CUBRID_ACTIVE_DB_LIST);
+ param.put("date", date);
+ param.put("time", stime);
+ p = tcp.getSingle(RequestCmd.CUBRID_ACTIVE_DB_LIST, param);
+ }
+
+ if (p != null) {
+ StatusPack sp = (StatusPack) p;
+ MapValue mv = (MapValue) sp.data;
+
+ if (mv == null || mv.isEmpty()) {
+ if (prvData != null) {
+ prvData.clear();
+ }
+ return false;
+ }
+
+ if (prvData != null && prvData.equals(mv)) {
+ return true;
+ }
+
+ prvData = mv;
+ activeDBList.clear();
+ for (String key : mv.keySet()) {
+ activeDBList.put(key, String.valueOf(mv.get(key)));
+ }
+ } else {
+
+ if (prvData != null)
+ prvData.clear();
+
+ activeDBList.clear();
+ return false;
+ }
+
+ } catch (Throwable th) {
+ th.printStackTrace();
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ return true;
+ }
+
+ enum ColumnEnum {
+ DB_NAME("DB NAME", 25, SWT.CENTER, true, true, false),
+ IP_ADDRESS("IP ADDRESS", 40, SWT.CENTER, true, true, false),
+ CPU_USED("CPU", 20, SWT.CENTER, true, true, true),
+ ACTIVE_SESSION("ACTIVE SESSION", 40, SWT.CENTER, true, true, true),
+ LOCK_WAIT_SESSION("LOCK WAIT SESSIONS", 45, SWT.CENTER, true, true, true);
+
+ private final String title;
+ private final int width;
+ private final int alignment;
+ private final boolean resizable;
+ private final boolean moveable;
+ private final boolean isNumber;
+
+ private ColumnEnum(String text, int width, int alignment, boolean resizable, boolean moveable,
+ boolean isNumber) {
+ this.title = text;
+ this.width = width;
+ this.alignment = alignment;
+ this.resizable = resizable;
+ this.moveable = moveable;
+ this.isNumber = isNumber;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public int getAlignment() {
+ return alignment;
+ }
+
+ public boolean isResizable() {
+ return resizable;
+ }
+
+ public boolean isMoveable() {
+ return moveable;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public boolean isNumber() {
+ return this.isNumber;
+ }
+ }
+
+ @Override
+ public void setFocus() {
+
+ }
+
+}
\ No newline at end of file
diff --git a/scouter.client/src/scouter/client/cubrid/views/CubridSingleDailyPeriodMultiView.java b/scouter.client/src/scouter/client/cubrid/views/CubridSingleDailyPeriodMultiView.java
new file mode 100755
index 000000000..eb2da5b44
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/views/CubridSingleDailyPeriodMultiView.java
@@ -0,0 +1,796 @@
+/*
+ * 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.client.cubrid.views;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.csstudio.swt.xygraph.dataprovider.CircularBufferDataProvider;
+import org.csstudio.swt.xygraph.dataprovider.ISample;
+import org.csstudio.swt.xygraph.dataprovider.Sample;
+import org.csstudio.swt.xygraph.figures.Trace;
+import org.csstudio.swt.xygraph.figures.Trace.PointStyle;
+import org.csstudio.swt.xygraph.figures.XYGraph;
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.window.DefaultToolTip;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+
+import scouter.client.Images;
+import scouter.client.cubrid.ActiveDbInfo;
+import scouter.client.cubrid.CubridMenuUtil;
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.cubrid.CubridSingleItem.InfoType;
+import scouter.client.listeners.RangeMouseListener;
+import scouter.client.model.RefreshThread;
+import scouter.client.model.RefreshThread.Refreshable;
+import scouter.client.net.INetReader;
+import scouter.client.net.TcpProxy;
+import scouter.client.popup.DualCalendarDialog;
+import scouter.client.popup.DualCalendarDialog.ILoadDualCounterDialog;
+import scouter.client.preferences.PManager;
+import scouter.client.preferences.PreferenceConstants;
+import scouter.client.server.Server;
+import scouter.client.server.ServerManager;
+import scouter.client.util.ChartUtil;
+import scouter.client.util.ColorUtil;
+import scouter.client.util.ExUtil;
+import scouter.client.util.ImageUtil;
+import scouter.client.util.ScouterUtil;
+import scouter.client.util.TimeUtil;
+import scouter.client.util.UIUtil;
+import scouter.io.DataInputX;
+import scouter.lang.pack.MapPack;
+import scouter.lang.value.ListValue;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+import scouter.util.DateUtil;
+import scouter.util.FormatUtil;
+import scouter.util.StringUtil;
+
+public class CubridSingleDailyPeriodMultiView extends ViewPart implements Refreshable {
+
+ public static final String ID = CubridSingleDailyPeriodMultiView.class.getName();
+
+ int serverId;
+ CubridSingleItem viewType;
+
+ long TIME_RANGE;
+
+ FigureCanvas canvas;
+ XYGraph xyGraph;
+
+ Combo dbListCombo;
+ Combo dbCounterCombo;
+ Menu contextMenu;
+ String selectionDB;
+ boolean isDefaultView = false;
+
+ Trace nearestTrace;
+ ArrayList traces = new ArrayList<>();
+ protected Map datas = new HashMap();
+
+ long pastStime, pastEtime;
+ String pastSdate, pastEdate;
+
+ RefreshThread thread;
+
+ Label serverText, sDateText, eDateText;
+ DualCalendarDialog calDialog;
+ Combo periodCombo;
+ Composite headerComp;
+ Button applyBtn;
+
+ int prvActiveDBHash;
+
+ public void init(IViewSite site) throws PartInitException {
+ super.init(site);
+ String secId = site.getSecondaryId();
+ String[] ids = StringUtil.split(secId, "&");
+ serverId = CastUtil.cint(ids[0]);
+ selectionDB = CastUtil.cString(ids[1]);
+ int ordinal = CastUtil.cint(ids[2]);
+ pastSdate = CastUtil.cString(ids[3]);
+ pastEdate = CastUtil.cString(ids[4]);
+
+ viewType = CubridSingleItem.values()[ordinal];
+ pastStime = DateUtil.getTime(pastSdate, "yyyyMMdd");
+ pastEtime = DateUtil.getTime(pastEdate, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY;
+ TIME_RANGE = pastEtime - pastStime;
+
+ if (selectionDB.equals("default")) {
+ isDefaultView = true;
+ }
+
+ }
+
+ public void createPartControl(Composite parent) {
+ Server server = ServerManager.getInstance().getServer(serverId);
+ this.setPartName("Daily Period - " + viewType.getTitle() + " [" + server.getName() + "]");
+
+ // FormLayout layout = new FormLayout();
+ GridLayout layout = new GridLayout(4, false);
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+
+ dbCounterCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbCounterCombo.setLayoutData(new GridData(SWT.LEFT | SWT.FILL));
+ for (CubridSingleItem counterName : CubridSingleItem.values()) {
+ dbCounterCombo.add(counterName.getTitle());
+ if (counterName.ordinal() == viewType.ordinal()) {
+ dbCounterCombo.select(viewType.ordinal());
+ }
+ }
+
+ if (!isDefaultView) {
+ dbCounterCombo.setEnabled(false);
+ }
+
+ dbCounterCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ ExUtil.syncExec(new Runnable() {
+ public void run() {
+ viewType = CubridSingleItem.values()[dbCounterCombo.getSelectionIndex()];
+ applyBtn.setEnabled(true);
+ if (viewType.getInfoType() == InfoType.BROKER_INFO) {
+ dbListCombo.setEnabled(false);
+ dbListCombo.removeAll();
+ dbListCombo.add("BROKER_INFO");
+ dbListCombo.select(0);
+ if (ActiveDbInfo.getInstance().getDbList().isEmpty()) {
+ selectionDB = ActiveDbInfo.getInstance().getDbList().get(0);
+ }
+ } else {
+ dbListCombo.removeAll();
+ if (isDefaultView) {
+ dbListCombo.setEnabled(true);
+ }
+ prvActiveDBHash = -1;
+ checkDBList();
+ }
+ }
+ });
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ dbListCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbListCombo.setLayoutData(new GridData(SWT.LEFT | SWT.FILL));
+
+ if (!isDefaultView) {
+ dbListCombo.add(selectionDB);
+ dbListCombo.select(0);
+ dbListCombo.setEnabled(false);
+ }
+
+ if (viewType.getInfoType() == InfoType.BROKER_INFO) {
+ dbListCombo.setEnabled(false);
+ dbListCombo.removeAll();
+ dbListCombo.add(InfoType.BROKER_INFO.getTitle());
+ dbListCombo.select(0);
+ }
+
+ dbListCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ ExUtil.syncExec(new Runnable() {
+ public void run() {
+ applyBtn.setEnabled(true);
+ selectionDB = dbListCombo.getText();
+ }
+ });
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ Button dbRefresh = new Button(parent, SWT.PUSH);
+ dbRefresh.setLayoutData(new GridData(SWT.LEFT));
+ dbRefresh.setImage(Images.refresh);
+ dbRefresh.setToolTipText("refresh DB List");
+ dbRefresh.setVisible(false);
+ dbRefresh.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ if (viewType.getInfoType() != InfoType.BROKER_INFO) {
+ checkDBList();
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(layout);
+ GridData gdata = new GridData();
+ gdata.horizontalAlignment = GridData.END;
+ composite.setLayoutData(gdata);
+ createUpperMenu(composite);
+
+ parent.setLayout(layout);
+ parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));
+ parent.setBackgroundMode(SWT.INHERIT_FORCE);
+ canvas = new FigureCanvas(parent);
+ GridData gdataXyGraph = new GridData(GridData.FILL_BOTH);
+ gdataXyGraph.horizontalSpan = 4;
+ canvas.setLayoutData(gdataXyGraph);
+ canvas.setScrollBarVisibility(FigureCanvas.NEVER);
+ canvas.addControlListener(new ControlListener() {
+ public void controlMoved(ControlEvent arg0) {
+ }
+
+ public void controlResized(ControlEvent arg0) {
+ Rectangle r = canvas.getClientArea();
+ xyGraph.setSize(r.width, r.height);
+ }
+ });
+
+ xyGraph = new XYGraph();
+ xyGraph.setShowLegend(true);
+ xyGraph.setShowTitle(false);
+ canvas.setContents(xyGraph);
+
+ xyGraph.primaryXAxis.setDateEnabled(true);
+ xyGraph.primaryXAxis.setShowMajorGrid(true);
+ xyGraph.primaryYAxis.setAutoScale(true);
+ xyGraph.primaryYAxis.setShowMajorGrid(true);
+
+ if (viewType.isPercent()) {
+ xyGraph.primaryYAxis.setRange(0, 100);
+ }
+
+ xyGraph.primaryXAxis.setFormatPattern("yyyy-MM-dd\n HH:mm:ss");
+ xyGraph.primaryYAxis.setFormatPattern("#,##0");
+
+ xyGraph.primaryXAxis.setTitle("");
+ xyGraph.primaryYAxis.setTitle("");
+
+ xyGraph.primaryYAxis.addMouseListener(new RangeMouseListener(getViewSite().getShell(), xyGraph.primaryYAxis));
+
+ // CircularBufferDataProvider provider = new
+ // CircularBufferDataProvider(true);
+ // int bufferSize = (int)(TIME_RANGE / REFRESH_INTERVAL) + 1;
+ // System.out.println("bufferSize : " + bufferSize);
+ // provider.setBufferSize(bufferSize);
+ // provider.setCurrentXDataArray(new double[] {});
+ // provider.setCurrentYDataArray(new double[] {});
+ // final Trace trace = new Trace("", xyGraph.primaryXAxis,
+ // xyGraph.primaryYAxis, provider);
+ // trace.setName(viewType.getTitle());
+ // trace.setPointStyle(PointStyle.NONE);
+ // trace.setTraceType(TraceType.SOLID_LINE);
+ // trace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ // trace.setAreaAlpha(255);
+ // trace.setTraceColor(ColorUtil.getInstance().getColor(viewType.getColor()));
+ // xyGraph.addTrace(trace);
+ // traces.add(trace);
+
+ final DefaultToolTip toolTip = new DefaultToolTip(canvas, DefaultToolTip.RECREATE, true);
+ toolTip.setFont(new Font(null, "Arial", 10, SWT.BOLD));
+ toolTip.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+
+ canvas.addMouseMoveListener(new MouseMoveListener() {
+
+ @Override
+ public void mouseMove(MouseEvent arg0) {
+
+ }
+ });
+
+ canvas.addMouseListener(new MouseListener() {
+ public void mouseUp(MouseEvent e) {
+ if (nearestTrace != null) {
+ nearestTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ nearestTrace = null;
+ }
+ toolTip.hide();
+ }
+
+ public void mouseDown(MouseEvent e) {
+ double x = xyGraph.primaryXAxis.getPositionValue(e.x, false);
+ double y = xyGraph.primaryYAxis.getPositionValue(e.y, false);
+ if (x < 0 || y < 0) {
+ return;
+ }
+ double minDistance = 30.0d;
+ long time = 0;
+ double value = 0;
+
+ for (Trace t : traces) {
+ ISample s = ScouterUtil.getNearestPoint(t.getDataProvider(), x);
+ if (s != null) {
+ int x2 = xyGraph.primaryXAxis.getValuePosition(s.getXValue(), false);
+ int y2 = xyGraph.primaryYAxis.getValuePosition(s.getYValue(), false);
+ double distance = ScouterUtil.getPointDistance(e.x, e.y, x2, y2);
+ if (minDistance > distance) {
+ minDistance = distance;
+ nearestTrace = t;
+ time = (long) s.getXValue();
+ value = s.getYValue();
+ }
+ }
+ }
+
+ if (nearestTrace != null) {
+ int width = PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH);
+ nearestTrace.setLineWidth(width + 2);
+ toolTip.setText(nearestTrace.getName() + "\nTime : " + DateUtil.format(time, "HH:mm:ss")
+ + "\nValue : " + FormatUtil.print(value, "#,###.##"));
+ toolTip.show(new Point(e.x, e.y));
+ }
+ }
+
+ public void mouseDoubleClick(MouseEvent e) {
+ }
+ });
+
+ CubridMenuUtil.createAddViewContextMenu(getSite().getWorkbenchWindow(), serverId, canvas);
+
+ IToolBarManager man = getViewSite().getActionBars().getToolBarManager();
+ man.add(new Action("refresh", ImageUtil.getImageDescriptor(Images.refresh)) {
+ public void run() {
+ ExUtil.asyncRun(new Runnable() {
+ public void run() {
+ longPastLoad();
+ }
+ });
+ }
+ });
+
+ thread = new RefreshThread(this, (int) DateUtil.MILLIS_PER_SECOND);
+ thread.start();
+ }
+
+ private void createUpperMenu(Composite composite) {
+ headerComp = new Composite(composite, SWT.NONE);
+ headerComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ headerComp.setLayout(UIUtil.formLayout(0, 0));
+
+ applyBtn = new Button(headerComp, SWT.PUSH);
+ applyBtn.setLayoutData(UIUtil.formData(null, -1, 0, 2, 100, -5, null, -1));
+ applyBtn.setText("Apply");
+ applyBtn.setEnabled(false);
+ applyBtn.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ ((Button) event.widget).setEnabled(false);
+ try {
+ modifyData();
+ longPastLoad();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ break;
+ }
+ }
+ });
+
+ Button manualBtn = new Button(headerComp, SWT.PUSH);
+ manualBtn.setImage(Images.CTXMENU_RDC);
+ manualBtn.setText("Manual");
+ manualBtn.setLayoutData(UIUtil.formData(null, -1, 0, 2, applyBtn, -5, null, -1));
+ manualBtn.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ Display display = Display.getCurrent();
+ if (display == null) {
+ display = Display.getDefault();
+ }
+
+ calDialog = new DualCalendarDialog(display, new ILoadDualCounterDialog() {
+
+ @Override
+ public void onPressedOk(String sDate, String eDate) {
+ ExUtil.syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ applyBtn.setEnabled(true);
+ pastSdate = sDate;
+ pastEdate = eDate;
+ pastStime = DateUtil.getTime(pastSdate, "yyyyMMdd");
+ pastEtime = DateUtil.getTime(pastEdate, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY;
+ TIME_RANGE = pastEtime - pastStime;
+ sDateText.setText(DateUtil.format(pastStime, "yyyy-MM-dd"));
+ eDateText.setText(DateUtil.format(pastEtime, "yyyy-MM-dd"));
+ }
+ });
+
+ }
+
+ @Override
+ public void onPressedOk(long startTime, long endTime) {
+ }
+
+ @Override
+ public void onPressedCancel() {
+ }
+ });
+ calDialog.show(UIUtil.getMousePosition());
+
+ break;
+ }
+ }
+ });
+
+ periodCombo = new Combo(headerComp, SWT.VERTICAL | SWT.BORDER | SWT.READ_ONLY);
+ periodCombo.setLayoutData(UIUtil.formData(null, -1, 0, 3, manualBtn, -5, null, -1));
+ ArrayList periodStrList = new ArrayList();
+ for (DatePeriodUnit minute : DatePeriodUnit.values()) {
+ periodStrList.add(minute.getLabel());
+ }
+ periodCombo.setItems(periodStrList.toArray(new String[DatePeriodUnit.values().length]));
+ periodCombo.select(2);
+ periodCombo.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ applyBtn.setEnabled(true);
+ if (((Combo) e.widget).getSelectionIndex() == 0) {
+ setStartEndDate(30);
+ } else if (((Combo) e.widget).getSelectionIndex() == 1) {
+ setStartEndDate(7);
+ } else {
+ setStartEndDate(1);
+ }
+ }
+
+ private void setStartEndDate(int i) {
+ long yesterday = TimeUtil.getCurrentTime(serverId) - DatePeriodUnit.A_DAY.getTime();
+ long startDate = TimeUtil.getCurrentTime(serverId) - (DatePeriodUnit.A_DAY.getTime() * i);
+ sDateText.setText(DateUtil.format(startDate, "yyyy-MM-dd"));
+ eDateText.setText(DateUtil.format(yesterday, "yyyy-MM-dd"));
+
+ pastSdate = DateUtil.format(startDate, "yyyyMMdd");
+ pastEdate = DateUtil.format(yesterday, "yyyyMMdd");
+
+ pastStime = DateUtil.getTime(pastSdate, "yyyyMMdd");
+ pastEtime = DateUtil.getTime(pastEdate, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY;
+ }
+
+ });
+
+ eDateText = new Label(headerComp, SWT.NONE);
+ eDateText.setLayoutData(UIUtil.formData(null, -1, 0, 7, periodCombo, -5, null, -1));
+ eDateText.setText(DateUtil.format(pastEtime, "yyyy-MM-dd"));
+
+ Label windbarLabel = new Label(headerComp, SWT.NONE);
+ windbarLabel.setLayoutData(UIUtil.formData(null, -1, 0, 7, eDateText, -5, null, -1));
+ windbarLabel.setText("~");
+
+ sDateText = new Label(headerComp, SWT.NONE);
+ sDateText.setLayoutData(UIUtil.formData(null, -1, 0, 7, windbarLabel, -5, null, -1));
+ sDateText.setText(DateUtil.format(pastStime, "yyyy-MM-dd"));
+ }
+
+ public void setFocus() {
+
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ }
+
+ private CircularBufferDataProvider getDataProvider(int serverId) {
+ CircularBufferDataProvider data = datas.get(serverId);
+ if (data == null) {
+ data = new CircularBufferDataProvider(true);
+ datas.put(serverId, data);
+ int bufferSize;
+ bufferSize = (int) (TIME_RANGE / (int) DateUtil.MILLIS_PER_FIVE_MINUTE) + 1;
+ data.setBufferSize(bufferSize);
+ data.setCurrentXDataArray(new double[] {});
+ data.setCurrentYDataArray(new double[] {});
+ final Trace trace = new Trace(viewType.getTitle(), xyGraph.primaryXAxis, xyGraph.primaryYAxis, data);
+ trace.setPointStyle(PointStyle.NONE);
+ trace.setAreaAlpha(255);
+ trace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ trace.setTraceType(viewType.getTraceType());
+ trace.setTraceColor(ColorUtil.getInstance().getColor(viewType.getColor()));
+
+ xyGraph.addTrace(trace);
+ traces.add(trace);
+ }
+ return data;
+ }
+
+ public void checkDBList() {
+
+ if (!isDefaultView) {
+ return;
+ }
+
+ if (ActiveDbInfo.getInstance().getActiveDBInfo().hashCode() == prvActiveDBHash) {
+ return;
+ }
+
+ prvActiveDBHash = ActiveDbInfo.getInstance().getActiveDBInfo().hashCode();
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ dbListCombo.removeAll();
+ }
+ });
+
+ if (!ActiveDbInfo.getInstance().isEmpty()) {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ for (String dbName : ActiveDbInfo.getInstance().keySet()) {
+ dbListCombo.add(dbName);
+ }
+ dbListCombo.setEnabled(true);
+ }
+ });
+
+ } else {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ dbListCombo.setEnabled(false);
+ }
+ });
+ }
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ for (int i = 0; i < dbListCombo.getItemCount(); i++) {
+ if (dbListCombo.getItem(i).equals(selectionDB)) {
+ dbListCombo.select(i);
+ return;
+ }
+ }
+
+ if (dbListCombo.getItemCount() != 0) {
+ dbListCombo.select(0);
+ selectionDB = dbListCombo.getItem(dbListCombo.getSelectionIndex());
+ }
+ }
+ });
+ }
+
+ public void redraw() {
+ if (canvas != null && canvas.isDisposed() == false) {
+ canvas.redraw();
+ xyGraph.repaint();
+ }
+ }
+
+ private void longPastLoad() {
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ final ArrayList values = new ArrayList();
+
+ if (ActiveDbInfo.getInstance() == null) {
+ return;
+ }
+
+ if (viewType.getInfoType() == InfoType.BROKER_INFO) {
+ if (!ActiveDbInfo.getInstance().getDbList().isEmpty()) {
+ selectionDB = ActiveDbInfo.getInstance().getDbList().get(0);
+ } else {
+ return;
+ }
+ } else if (selectionDB.equals("default")) {
+ checkDBList();
+ return;
+ } else {
+ checkDBList();
+ }
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ selectionDB = dbListCombo.getText();
+ if (selectionDB == "") {
+ return;
+ }
+ }
+ });
+
+ try {
+ MapPack param = new MapPack();
+ ListValue objHashLv = new ListValue();
+ objHashLv.add(ActiveDbInfo.getInstance().getObjectHash(selectionDB));
+ param.put("objHash", objHashLv);
+ param.put("counter", viewType.getCounterName());
+ param.put("sDate", pastSdate);
+ param.put("eDate", pastEdate);
+
+ tcp.process(RequestCmd.CUBRID_DB_LONG_PERIOD_MULTI_DATA, param, new INetReader() {
+ public void process(DataInputX in) throws IOException {
+ MapPack mpack = (MapPack) in.readPack();
+ values.add(mpack);
+ };
+ });
+
+ } catch (Throwable th) {
+ th.printStackTrace();
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+
+ ExUtil.exec(this.canvas, new Runnable() {
+ public void run() {
+ xyGraph.primaryXAxis.setRange(pastStime, pastEtime);
+
+ for (MapPack mpack : values) {
+ //int objHash = mpack.getInt("objHash");
+ ListValue time = mpack.getList("time");
+ ListValue value = mpack.getList("value");
+ if (time == null || time.size() < 1) {
+ continue;
+ }
+
+ CircularBufferDataProvider provider = getDataProvider(serverId);
+ provider.clearTrace();
+
+ for (int i = 0; time != null && i < time.size(); i++) {
+ setTitleImage(Images.active);
+ long x = time.getLong(i);
+ if (value.getString(i) != null) {
+ long y = Long.parseLong(value.getString(i));
+ long prevY = 0;
+ if (i != 0) {
+ if (value.getString(i - 1) != null) {
+ prevY = Long.parseLong(value.getString(i - 1));
+ }
+ }
+
+ if (y < 0 || prevY < 0) { // temp code : Read issue //WorkAround
+ //System.out.println("CUBRID_DB_LONG_PERIOD_MULTI_DATA skip data y : " + y + " prevY : " + prevY);
+ } else {
+ provider.addSample(new Sample(x, y));
+ }
+ }
+ }
+
+ if (viewType.isPercent()) {
+ xyGraph.primaryYAxis.setRange(0, 100);
+ } else {
+ double max = ChartUtil.getMax(provider.iterator());
+ xyGraph.primaryYAxis.setRange(0, max);
+ }
+ }
+ }
+ });
+
+ return;
+ }
+
+ @Override
+ public void refresh() {
+ if (ActiveDbInfo.getInstance() == null) {
+ return;
+ }
+
+ if (viewType.getInfoType() == InfoType.BROKER_INFO) {
+ if (!ActiveDbInfo.getInstance().getDbList().isEmpty()) {
+ selectionDB = ActiveDbInfo.getInstance().getDbList().get(0);
+ } else {
+ return;
+ }
+ } else if (selectionDB.equals("default")) {
+ checkDBList();
+ return;
+ } else {
+ checkDBList();
+ }
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ if (dbListCombo != null && dbListCombo.getItemCount() != 0 && dbListCombo.getSelection() != null) {
+ selectionDB = dbListCombo.getText();
+ if (selectionDB == "") {
+ return;
+ }
+ }
+ }
+ });
+
+ if (ActiveDbInfo.getInstance().isEmpty()) {
+ return;
+ }
+
+ longPastLoad();
+
+ this.thread.shutdown();
+ }
+
+ public enum DatePeriodUnit {
+ A_MONTH ("1 Month", 30 * 24 * 60 * 60 * 1000),
+ A_WEEK ("1 Week", 7 * 24 * 60 * 60 * 1000),
+ A_DAY ("1 Day", 24 * 60 * 60 * 1000);
+
+ private String label;
+ private long time;
+
+ private DatePeriodUnit(String label, long time) {
+ this.label = label;
+ this.time = time;
+ }
+
+ public String getLabel() {
+ return this.label;
+ }
+
+ public long getTime() {
+ return this.time;
+ }
+
+ public static DatePeriodUnit fromString(String text) {
+ if (text != null) {
+ for (DatePeriodUnit b : DatePeriodUnit.values()) {
+ if (text.equalsIgnoreCase(b.label)) {
+ return b;
+ }
+ }
+ }
+ return null;
+ }
+ }
+
+ private void modifyData() {
+ redraw();
+ getDataProvider(serverId).clearTrace();
+ Trace trace = traces.get(0);
+ trace.setName(viewType.getTitle());
+ trace.setTraceColor(ColorUtil.getInstance().getColor(viewType.getColor()));
+ int bufferSize;
+ bufferSize = (int) (TIME_RANGE / (int) DateUtil.MILLIS_PER_FIVE_MINUTE) + 1;
+ getDataProvider(serverId).setBufferSize(bufferSize);
+ }
+}
+
diff --git a/scouter.client/src/scouter/client/cubrid/views/CubridSinglePeriodMultiView.java b/scouter.client/src/scouter/client/cubrid/views/CubridSinglePeriodMultiView.java
new file mode 100755
index 000000000..3bef7dd90
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/views/CubridSinglePeriodMultiView.java
@@ -0,0 +1,751 @@
+/*
+ * 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.client.cubrid.views;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.csstudio.swt.xygraph.dataprovider.CircularBufferDataProvider;
+import org.csstudio.swt.xygraph.dataprovider.ISample;
+import org.csstudio.swt.xygraph.dataprovider.Sample;
+import org.csstudio.swt.xygraph.figures.Trace;
+import org.csstudio.swt.xygraph.figures.Trace.PointStyle;
+import org.csstudio.swt.xygraph.figures.XYGraph;
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.window.DefaultToolTip;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+
+import scouter.client.Images;
+import scouter.client.cubrid.ActiveDbInfo;
+import scouter.client.cubrid.CubridMenuUtil;
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.cubrid.CubridSingleItem.InfoType;
+import scouter.client.listeners.RangeMouseListener;
+import scouter.client.model.RefreshThread;
+import scouter.client.model.RefreshThread.Refreshable;
+import scouter.client.net.INetReader;
+import scouter.client.net.TcpProxy;
+import scouter.client.popup.CalendarDialog;
+import scouter.client.popup.CalendarDialog.ILoadCalendarDialog;
+import scouter.client.preferences.PManager;
+import scouter.client.preferences.PreferenceConstants;
+import scouter.client.server.Server;
+import scouter.client.server.ServerManager;
+import scouter.client.util.ChartUtil;
+import scouter.client.util.ColorUtil;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ExUtil;
+import scouter.client.util.ImageUtil;
+import scouter.client.util.ScouterUtil;
+import scouter.client.util.TimeUtil;
+import scouter.client.util.UIUtil;
+import scouter.io.DataInputX;
+import scouter.lang.pack.MapPack;
+import scouter.lang.value.ListValue;
+import scouter.lang.value.MapValue;
+import scouter.lang.value.Value;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+import scouter.util.DateUtil;
+import scouter.util.FormatUtil;
+import scouter.util.StringUtil;
+
+public class CubridSinglePeriodMultiView extends ViewPart implements Refreshable {
+
+ public static final String ID = CubridSinglePeriodMultiView.class.getName();
+
+ int serverId;
+ CubridSingleItem viewType;
+
+ RefreshThread thread;
+
+ long TIME_RANGE = DateUtil.MILLIS_PER_TEN_MINUTE;
+ static int REFRESH_INTERVAL = (int) (DateUtil.MILLIS_PER_SECOND * 5);
+ static long CHECK_ACTIVE_REALTIME = DateUtil.MILLIS_PER_TEN_MINUTE;
+
+ FigureCanvas canvas;
+ XYGraph xyGraph;
+
+ Combo dbListCombo;
+ Combo dbCounterCombo;
+ Menu contextMenu;
+ String selectionDB;
+ boolean isDefaultView = false;
+
+ Trace nearestTrace;
+ ArrayList traces = new ArrayList<>();
+ protected Map datas = new HashMap();
+
+ String date;
+ long stime, etime;
+
+ long pastStime, pastEtime;
+
+ boolean manulRefresh = true;
+
+ Label serverText, sDateText, sTimeText, eTimeText;
+ Composite headerComp;
+ CalendarDialog calDialog;
+ Button applyBtn;
+
+ int prvActiveDBHash;
+
+ public void init(IViewSite site) throws PartInitException {
+ super.init(site);
+ String secId = site.getSecondaryId();
+ String[] ids = StringUtil.split(secId, "&");
+ serverId = CastUtil.cint(ids[0]);
+ selectionDB = CastUtil.cString(ids[1]);
+ int ordinal = CastUtil.cint(ids[2]);
+ viewType = CubridSingleItem.values()[ordinal];
+ pastStime = CastUtil.cLong(ids[3]);
+ pastEtime = CastUtil.cLong(ids[4]);
+
+ TIME_RANGE = pastEtime - pastStime;
+
+ if (selectionDB == "default") {
+ isDefaultView = true;
+ }
+
+ }
+
+ public void createPartControl(Composite parent) {
+ Server server = ServerManager.getInstance().getServer(serverId);
+ this.setPartName("ShortPeriod - " + viewType.getTitle() + "[" + server.getName() + "]");
+
+ GridLayout layout = new GridLayout(4, false);
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+
+ dbCounterCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbCounterCombo.setLayoutData(new GridData(SWT.LEFT | SWT.FILL));
+
+ for (CubridSingleItem counterName : CubridSingleItem.values()) {
+ dbCounterCombo.add(counterName.getTitle());
+ if (counterName.ordinal() == viewType.ordinal()) {
+ dbCounterCombo.select(viewType.ordinal());
+ }
+ }
+
+ if (!isDefaultView) {
+ dbCounterCombo.setEnabled(false);
+ }
+
+ dbCounterCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ ExUtil.syncExec(new Runnable() {
+ public void run() {
+ viewType = CubridSingleItem.values()[dbCounterCombo.getSelectionIndex()];
+ applyBtn.setEnabled(true);
+ if (viewType.getInfoType() == InfoType.BROKER_INFO) {
+ dbListCombo.setEnabled(false);
+ dbListCombo.removeAll();
+ dbListCombo.add("BROKER_INFO");
+ dbListCombo.select(0);
+ } else {
+ if (isDefaultView) {
+ dbListCombo.setEnabled(true);
+ }
+ dbListCombo.removeAll();
+ prvActiveDBHash = -1;
+ checkDBList();
+ }
+ }
+ });
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ }
+ });
+
+ dbListCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbListCombo.setLayoutData(new GridData(SWT.LEFT | SWT.FILL));
+
+ if (!isDefaultView) {
+ dbListCombo.add(selectionDB);
+ dbListCombo.select(0);
+ dbListCombo.setEnabled(false);
+ }
+
+ if (viewType.getInfoType() == InfoType.BROKER_INFO) {
+ dbListCombo.setEnabled(false);
+ dbListCombo.removeAll();
+ dbListCombo.add(InfoType.BROKER_INFO.getTitle());
+ dbListCombo.select(0);
+ }
+
+ dbListCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ selectionDB = dbListCombo.getItem(dbListCombo.getSelectionIndex());
+ applyBtn.setEnabled(true);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ Button dbRefresh = new Button(parent, SWT.PUSH);
+ dbRefresh.setLayoutData(new GridData(SWT.LEFT));
+ dbRefresh.setImage(Images.refresh);
+ dbRefresh.setToolTipText("refresh DB List");
+ dbRefresh.setVisible(false);
+ dbRefresh.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ if (viewType.getInfoType() != InfoType.BROKER_INFO) {
+ checkDBList();
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(layout);
+ GridData gdata = new GridData();
+ gdata.horizontalAlignment = GridData.END;
+ composite.setLayoutData(gdata);
+
+ createUpperMenu(composite);
+
+ parent.setLayout(layout);
+ parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));
+ parent.setBackgroundMode(SWT.INHERIT_FORCE);
+ canvas = new FigureCanvas(parent);
+ GridData gdataXyGraph = new GridData(GridData.FILL_BOTH);
+ gdataXyGraph.horizontalSpan = 4;
+ canvas.setLayoutData(gdataXyGraph);
+ canvas.setScrollBarVisibility(FigureCanvas.NEVER);
+ canvas.addControlListener(new ControlListener() {
+ public void controlMoved(ControlEvent arg0) {
+ }
+
+ public void controlResized(ControlEvent arg0) {
+ Rectangle r = canvas.getClientArea();
+ xyGraph.setSize(r.width, r.height);
+ }
+ });
+
+ xyGraph = new XYGraph();
+ xyGraph.setShowLegend(true);
+ xyGraph.setShowTitle(false);
+ canvas.setContents(xyGraph);
+
+ xyGraph.primaryXAxis.setDateEnabled(true);
+ xyGraph.primaryXAxis.setShowMajorGrid(true);
+ xyGraph.primaryYAxis.setAutoScale(true);
+ xyGraph.primaryYAxis.setShowMajorGrid(true);
+
+ if (viewType.isPercent()) {
+ xyGraph.primaryYAxis.setRange(0, 100);
+ }
+
+ xyGraph.primaryXAxis.setFormatPattern("HH:mm:ss");
+ xyGraph.primaryYAxis.setFormatPattern("#,##0");
+
+ xyGraph.primaryXAxis.setTitle("");
+ xyGraph.primaryYAxis.setTitle("");
+
+ xyGraph.primaryYAxis.addMouseListener(new RangeMouseListener(getViewSite().getShell(), xyGraph.primaryYAxis));
+
+ // CircularBufferDataProvider provider = new
+ // CircularBufferDataProvider(true);
+ // int bufferSize = (int)(TIME_RANGE / REFRESH_INTERVAL) + 1;
+ // System.out.println("bufferSize : " + bufferSize);
+ // provider.setBufferSize(bufferSize);
+ // provider.setCurrentXDataArray(new double[] {});
+ // provider.setCurrentYDataArray(new double[] {});
+ // final Trace trace = new Trace("", xyGraph.primaryXAxis,
+ // xyGraph.primaryYAxis, provider);
+ // trace.setName(viewType.getTitle());
+ // trace.setPointStyle(PointStyle.NONE);
+ // trace.setTraceType(TraceType.SOLID_LINE);
+ // trace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ // trace.setAreaAlpha(255);
+ // trace.setTraceColor(ColorUtil.getInstance().getColor(viewType.getColor()));
+ // xyGraph.addTrace(trace);
+ // traces.add(trace);
+
+ final DefaultToolTip toolTip = new DefaultToolTip(canvas, DefaultToolTip.RECREATE, true);
+ toolTip.setFont(new Font(null, "Arial", 10, SWT.BOLD));
+ toolTip.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+
+ canvas.addMouseMoveListener(new MouseMoveListener() {
+
+ @Override
+ public void mouseMove(MouseEvent arg0) {
+
+ }
+ });
+
+ canvas.addMouseListener(new MouseListener() {
+ public void mouseUp(MouseEvent e) {
+ if (nearestTrace != null) {
+ nearestTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ nearestTrace = null;
+ }
+ toolTip.hide();
+ }
+
+ public void mouseDown(MouseEvent e) {
+ double x = xyGraph.primaryXAxis.getPositionValue(e.x, false);
+ double y = xyGraph.primaryYAxis.getPositionValue(e.y, false);
+ if (x < 0 || y < 0) {
+ return;
+ }
+ double minDistance = 30.0d;
+ long time = 0;
+ double value = 0;
+
+ for (Trace t : traces) {
+ ISample s = ScouterUtil.getNearestPoint(t.getDataProvider(), x);
+ if (s != null) {
+ int x2 = xyGraph.primaryXAxis.getValuePosition(s.getXValue(), false);
+ int y2 = xyGraph.primaryYAxis.getValuePosition(s.getYValue(), false);
+ double distance = ScouterUtil.getPointDistance(e.x, e.y, x2, y2);
+ if (minDistance > distance) {
+ minDistance = distance;
+ nearestTrace = t;
+ time = (long) s.getXValue();
+ value = s.getYValue();
+ }
+ }
+ }
+
+ if (nearestTrace != null) {
+ int width = PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH);
+ nearestTrace.setLineWidth(width + 2);
+ toolTip.setText(nearestTrace.getName() + "\nTime : " + DateUtil.format(time, "HH:mm:ss")
+ + "\nValue : " + FormatUtil.print(value, "#,###.##"));
+ toolTip.show(new Point(e.x, e.y));
+ }
+ }
+
+ public void mouseDoubleClick(MouseEvent e) {
+ }
+ });
+
+ CubridMenuUtil.createAddViewContextMenu(getSite().getWorkbenchWindow(), serverId, canvas);
+
+ IToolBarManager man = getViewSite().getActionBars().getToolBarManager();
+ man.add(new Action("refresh", ImageUtil.getImageDescriptor(Images.refresh)) {
+ public void run() {
+ manulRefresh = true;
+ thread.interrupt();
+ }
+ });
+
+ thread = new RefreshThread(this, REFRESH_INTERVAL);
+ thread.start();
+ }
+
+ private void createUpperMenu(Composite composite) {
+ headerComp = new Composite(composite, SWT.NONE);
+ headerComp.setLayoutData(new GridData(SWT.RIGHT));
+ headerComp.setLayout(UIUtil.formLayout(0, 0));
+
+ applyBtn = new Button(headerComp, SWT.PUSH);
+ applyBtn.setLayoutData(UIUtil.formData(null, -1, 0, 2, 100, -5, null, -1));
+ applyBtn.setText("Apply");
+ applyBtn.setEnabled(false);
+ applyBtn.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ ((Button) event.widget).setEnabled(false);
+ try {
+ modifyData();
+ manulRefresh = true;
+ thread.interrupt();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ break;
+ }
+ }
+ });
+
+ Button manualBtn = new Button(headerComp, SWT.PUSH);
+ manualBtn.setImage(Images.CTXMENU_RDC);
+ manualBtn.setText("Manual");
+ manualBtn.setLayoutData(UIUtil.formData(null, -1, 0, 2, applyBtn, -5, null, -1));
+ manualBtn.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ Display display = Display.getCurrent();
+ if (display == null) {
+ display = Display.getDefault();
+ }
+
+ calDialog = new CalendarDialog(display, new ILoadCalendarDialog() {
+ @Override
+ public void onPressedOk(String date) {
+ }
+
+ @Override
+ public void onPressedOk(long startTime, long endTime) {
+ ExUtil.syncExec(new Runnable() {
+ public void run() {
+ pastStime = startTime;
+ pastEtime = endTime;
+ applyBtn.setEnabled(true);
+ TIME_RANGE = pastEtime - pastStime;
+ eTimeText.setText(DateUtil.format(pastEtime, "hh:mm a", Locale.ENGLISH));
+ sTimeText.setText(DateUtil.format(pastStime, "hh:mm a", Locale.ENGLISH));
+ sDateText.setText(DateUtil.format(pastStime, "yyyy-MM-dd"));
+ }
+ });
+
+ }
+
+ @Override
+ public void onPressedCancel() {
+ }
+ });
+ int hourRange = DateUtil.getHour(TimeUtil.getCurrentTime(serverId));
+ int MiniteRange = DateUtil.getMin(TimeUtil.getCurrentTime(serverId));
+ if (hourRange > 4) {
+ calDialog.showWithEndTime(UIUtil.getMousePosition(),
+ TimeUtil.getCurrentTime(serverId) - DateUtil.MILLIS_PER_HOUR * 4,
+ TimeUtil.getCurrentTime(serverId));
+ } else {
+ calDialog.showWithEndTime(UIUtil.getMousePosition(),
+ TimeUtil.getCurrentTime(serverId) - DateUtil.MILLIS_PER_HOUR * hourRange - DateUtil.MILLIS_PER_MINUTE * MiniteRange,
+ TimeUtil.getCurrentTime(serverId));
+ }
+ break;
+ }
+ }
+ });
+
+ eTimeText = new Label(headerComp, SWT.NONE);
+ eTimeText.setLayoutData(UIUtil.labelFormData(manualBtn));
+ eTimeText.setText(DateUtil.format(pastEtime, "hh:mm a", Locale.ENGLISH));
+
+ Label label = new Label(headerComp, SWT.NONE);
+ label.setLayoutData(UIUtil.labelFormData(eTimeText));
+ label.setText("~");
+
+ sTimeText = new Label(headerComp, SWT.NONE);
+ sTimeText.setLayoutData(UIUtil.labelFormData(label));
+ sTimeText.setText(DateUtil.format(pastStime, "hh:mm a", Locale.ENGLISH));
+
+ sDateText = new Label(headerComp, SWT.NONE);
+ sDateText.setLayoutData(UIUtil.labelFormData(sTimeText));
+ sDateText.setText(DateUtil.format(pastStime, "yyyy-MM-dd"));
+ }
+
+ public void setFocus() {
+
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ if (this.thread != null) {
+ this.thread.shutdown();
+ }
+ }
+
+ public void refresh() {
+ if (ActiveDbInfo.getInstance() == null) {
+ return;
+ }
+
+ if (viewType.getInfoType() == InfoType.BROKER_INFO) {
+ if (!ActiveDbInfo.getInstance().getDbList().isEmpty()) {
+ selectionDB = ActiveDbInfo.getInstance().getDbList().get(0);
+ } else {
+ return;
+ }
+ } else if (selectionDB.equals("default")) {
+ checkDBList();
+ return;
+ } else {
+ checkDBList();
+ }
+
+ if (manulRefresh) {
+ manulRefresh = false;
+ if (TimeUtil.getCurrentTime(serverId) - pastEtime <= CHECK_ACTIVE_REALTIME) {
+ pastEtime = TimeUtil.getCurrentTime(serverId);
+ pastLoad();
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ eTimeText.setText("RealTime");
+ }
+ });
+ } else {
+ pastLoad();
+ return;
+ }
+ } else {
+ if (TimeUtil.getCurrentTime(serverId) - pastEtime > CHECK_ACTIVE_REALTIME) {
+ return;
+ }
+ }
+
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ Value v = null;
+
+ try {
+ MapPack param = new MapPack();
+ ListValue objHashLv = new ListValue();
+ objHashLv.add(ActiveDbInfo.getInstance().getObjectHash(selectionDB));
+ param.put("objHash", objHashLv);
+ param.put("counter", viewType.getCounterName());
+ v = tcp.getSingleValue(RequestCmd.CUBRID_DB_REALTIME_MULTI_DATA, param);
+ } catch (Exception e) {
+ ConsoleProxy.errorSafe(e.toString());
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ if (v == null) {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ setTitleImage(Images.inactive);
+ long now = TimeUtil.getCurrentTime(serverId);
+ long stime = now - TIME_RANGE;
+ xyGraph.primaryXAxis.setRange(stime, now + 1);
+ }
+ });
+ } else {
+ MapValue value = (MapValue) v;
+ final long data = value.getLong(viewType.getCounterName());
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ setTitleImage(Images.active);
+ long now = TimeUtil.getCurrentTime(serverId);
+ long stime = now - TIME_RANGE;
+ xyGraph.primaryXAxis.setRange(stime, now + 1);
+
+ getDataProvider(serverId).addSample(new Sample(now, data));
+ double max = ChartUtil.getMax(getDataProvider(serverId).iterator());
+ if (viewType.isPercent()) {
+ xyGraph.primaryYAxis.setRange(0, 100);
+ } else {
+ xyGraph.primaryYAxis.setRange(0, max);
+ }
+ }
+ });
+ }
+ }
+
+ private CircularBufferDataProvider getDataProvider(int serverId) {
+ CircularBufferDataProvider data = datas.get(serverId);
+ if (data == null) {
+ data = new CircularBufferDataProvider(true);
+ datas.put(serverId, data);
+ int bufferSize;
+ bufferSize = (int) (TIME_RANGE / REFRESH_INTERVAL) + 1;
+ data.setBufferSize(bufferSize);
+ data.setCurrentXDataArray(new double[] {});
+ data.setCurrentYDataArray(new double[] {});
+ final Trace trace = new Trace(viewType.getTitle(), xyGraph.primaryXAxis, xyGraph.primaryYAxis, data);
+ trace.setPointStyle(PointStyle.NONE);
+ trace.setAreaAlpha(255);
+ trace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ trace.setTraceType(viewType.getTraceType());
+ trace.setTraceColor(ColorUtil.getInstance().getColor(viewType.getColor()));
+
+ xyGraph.addTrace(trace);
+ traces.add(trace);
+ }
+ return data;
+ }
+
+ public void checkDBList() {
+
+ if (!isDefaultView) {
+ return;
+ }
+
+ if (ActiveDbInfo.getInstance().getActiveDBInfo().hashCode() == prvActiveDBHash) {
+ return;
+ }
+
+ prvActiveDBHash = ActiveDbInfo.getInstance().getActiveDBInfo().hashCode();
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ dbListCombo.removeAll();
+ }
+ });
+
+ if (!ActiveDbInfo.getInstance().isEmpty()) {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ for (String dbName : ActiveDbInfo.getInstance().keySet()) {
+ dbListCombo.add(dbName);
+ }
+ dbListCombo.setEnabled(true);
+ }
+ });
+
+ } else {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ dbListCombo.setEnabled(false);
+ }
+ });
+ }
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ for (int i = 0; i < dbListCombo.getItemCount(); i++) {
+ if (dbListCombo.getItem(i).equals(selectionDB)) {
+ dbListCombo.select(i);
+ return;
+ }
+ }
+
+ if (dbListCombo.getItemCount() != 0) {
+ dbListCombo.select(0);
+ selectionDB = dbListCombo.getItem(dbListCombo.getSelectionIndex());
+ }
+ }
+ });
+ }
+
+ public void redraw() {
+ if (canvas != null && canvas.isDisposed() == false) {
+ canvas.redraw();
+ xyGraph.repaint();
+ }
+ }
+
+ private void pastLoad() {
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ final ArrayList values = new ArrayList();
+
+ try {
+ MapPack param = new MapPack();
+ ListValue objHashLv = new ListValue();
+ objHashLv.add(ActiveDbInfo.getInstance().getObjectHash(selectionDB));
+ param.put("objHash", objHashLv);
+ param.put("counter", viewType.getCounterName());
+ param.put("stime", pastStime);
+ param.put("etime", pastEtime);
+ param.put("objName", ActiveDbInfo.getInstance().getObjectName(selectionDB));
+
+ tcp.process(RequestCmd.CUBRID_DB_PERIOD_MULTI_DATA, param, new INetReader() {
+ public void process(DataInputX in) throws IOException {
+ MapPack mpack = (MapPack) in.readPack();
+ values.add(mpack);
+ };
+ });
+
+ } catch (Throwable th) {
+ th.printStackTrace();
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+
+ ExUtil.exec(this.canvas, new Runnable() {
+ public void run() {
+ xyGraph.primaryXAxis.setRange(pastStime, pastEtime);
+
+ for (MapPack mpack : values) {
+ //int objHash = mpack.getInt("objHash");
+ ListValue time = mpack.getList("time");
+ ListValue value = mpack.getList("value");
+ if (time == null || time.size() < 1) {
+ continue;
+ }
+
+ CircularBufferDataProvider provider = getDataProvider(serverId);
+ provider.clearTrace();
+
+ for (int i = 0; time != null && i < time.size(); i++) {
+ setTitleImage(Images.active);
+ long x = time.getLong(i);
+ long y = Long.parseLong(value.getString(i));
+ long prevY = 0;
+ if (i != 0) {
+ prevY = Long.parseLong(value.getString(i - 1));
+ }
+
+ if (y < 0 || prevY < 0) { //temp code : Read issue WorkAround
+ //System.out.println("CUBRID_DB_LONG_PERIOD_MULTI_DATA skip data y : " + y + " prevY : " + prevY);
+ } else {
+ provider.addSample(new Sample(x, y));
+ }
+ }
+ double max = ChartUtil.getMax(provider.iterator());
+ if (viewType.isPercent()) {
+ xyGraph.primaryYAxis.setRange(0, 100);
+ } else {
+ xyGraph.primaryYAxis.setRange(0, max);
+ }
+ }
+ }
+ });
+
+ return;
+ }
+
+ private void modifyData() {
+ redraw();
+ getDataProvider(serverId).clearTrace();
+ Trace trace = traces.get(0);
+ trace.setName(viewType.getTitle());
+ trace.setTraceColor(ColorUtil.getInstance().getColor(viewType.getColor()));
+ int bufferSize;
+ bufferSize = (int) (TIME_RANGE / REFRESH_INTERVAL) + 1;
+ getDataProvider(serverId).setBufferSize(bufferSize);
+ }
+}
diff --git a/scouter.client/src/scouter/client/cubrid/views/CubridSingleRealTimeMultiView.java b/scouter.client/src/scouter/client/cubrid/views/CubridSingleRealTimeMultiView.java
new file mode 100755
index 000000000..b4efc7a64
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/views/CubridSingleRealTimeMultiView.java
@@ -0,0 +1,541 @@
+/*
+ * 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.client.cubrid.views;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.csstudio.swt.xygraph.dataprovider.CircularBufferDataProvider;
+import org.csstudio.swt.xygraph.dataprovider.ISample;
+import org.csstudio.swt.xygraph.dataprovider.Sample;
+import org.csstudio.swt.xygraph.figures.Trace;
+import org.csstudio.swt.xygraph.figures.Trace.PointStyle;
+import org.csstudio.swt.xygraph.figures.XYGraph;
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.window.DefaultToolTip;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+
+import scouter.client.Images;
+import scouter.client.cubrid.ActiveDbInfo;
+import scouter.client.cubrid.CubridMenuUtil;
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.cubrid.CubridTypeShotPeriod;
+import scouter.client.cubrid.CubridSingleItem.InfoType;
+import scouter.client.cubrid.actions.AlertSettingDialog;
+import scouter.client.listeners.RangeMouseListener;
+import scouter.client.model.RefreshThread;
+import scouter.client.model.RefreshThread.Refreshable;
+import scouter.client.net.TcpProxy;
+import scouter.client.preferences.PManager;
+import scouter.client.preferences.PreferenceConstants;
+import scouter.client.server.Server;
+import scouter.client.server.ServerManager;
+import scouter.client.util.ChartUtil;
+import scouter.client.util.ColorUtil;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ExUtil;
+import scouter.client.util.ImageUtil;
+import scouter.client.util.ScouterUtil;
+import scouter.client.util.TimeUtil;
+import scouter.lang.pack.MapPack;
+import scouter.lang.value.ListValue;
+import scouter.lang.value.MapValue;
+import scouter.lang.value.Value;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+import scouter.util.DateUtil;
+import scouter.util.FormatUtil;
+import scouter.util.StringUtil;
+
+public class CubridSingleRealTimeMultiView extends ViewPart implements Refreshable {
+
+ public static final String ID = CubridSingleRealTimeMultiView.class.getName();
+
+ int serverId;
+ int objhash;
+ CubridSingleItem viewType;
+
+ RefreshThread thread;
+
+ static int REFRESH_INTERVAL = (int) (DateUtil.MILLIS_PER_SECOND * 5);
+
+ FigureCanvas canvas;
+ XYGraph xyGraph;
+
+ Combo dbListCombo;
+ Combo dbCounterCombo;
+ Combo timeRangeCombo;
+
+ Menu contextMenu;
+ String selectionDB;
+ boolean isDefaultView = false;
+
+ Trace nearestTrace;
+ ArrayList traces = new ArrayList<>();
+ protected Map datas = new HashMap();
+
+ String date;
+ long stime, etime;
+ long timeRange;
+ long pastStime, pastEtime;
+
+ int prvActiveDBHash;
+
+ public void init(IViewSite site) throws PartInitException {
+ super.init(site);
+ String secId = site.getSecondaryId();
+ String[] ids = StringUtil.split(secId, "&");
+ serverId = CastUtil.cint(ids[0]);
+ selectionDB = CastUtil.cString(ids[1]);
+ int ordinal = CastUtil.cint(ids[2]);
+ timeRange = CastUtil.clong(ids[3]);
+ viewType = CubridSingleItem.values()[ordinal];
+
+ if (selectionDB.equals("default")) {
+ isDefaultView = true;
+ }
+ }
+
+ public void createPartControl(Composite parent) {
+ Server server = ServerManager.getInstance().getServer(serverId);
+ this.setPartName("SingleRealTimeMultiView " + viewType.getTitle() + " [" + server.getName() + "]");
+ IWorkbenchWindow window = getSite().getWorkbenchWindow();
+
+ IToolBarManager man = getViewSite().getActionBars().getToolBarManager();
+ man.add(new Action("Warning Alert Setting", ImageUtil.getImageDescriptor(Images.preference)) {
+ public void run() {
+ AlertSettingDialog dialog = new AlertSettingDialog(
+ window.getShell().getDisplay(), serverId,
+ dbCounterCombo.getSelectionIndex());
+ dialog.show();
+ }
+ });
+
+ GridLayout layout = new GridLayout(3, false);
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+ dbCounterCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbCounterCombo.setLayoutData(new GridData(SWT.FILL));
+
+ if (!isDefaultView) {
+ dbCounterCombo.setEnabled(false);
+ }
+
+ for (CubridSingleItem counterName : CubridSingleItem.values()) {
+ dbCounterCombo.add(counterName.getTitle());
+ if (counterName.ordinal() == viewType.ordinal()) {
+ dbCounterCombo.select(viewType.ordinal());
+ }
+ }
+
+ dbCounterCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ ExUtil.exec(canvas, new Runnable() {
+ @Override
+ public void run() {
+ viewType = CubridSingleItem.values()[dbCounterCombo.getSelectionIndex()];
+ modifyData(true);
+ if (viewType.getInfoType() == InfoType.BROKER_INFO) {
+ dbListCombo.setEnabled(false);
+ dbListCombo.removeAll();
+ dbListCombo.add(InfoType.BROKER_INFO.getTitle());
+ dbListCombo.select(0);
+ } else {
+ if (isDefaultView) {
+ dbListCombo.setEnabled(true);
+ }
+ dbListCombo.removeAll();
+ prvActiveDBHash = -1;
+ checkDBList();
+ }
+ }
+ });
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ dbListCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+ dbListCombo.setLayoutData(new GridData(SWT.RIGHT));
+
+ if (!isDefaultView) {
+ dbListCombo.add(selectionDB);
+ dbListCombo.select(0);
+ dbListCombo.setEnabled(false);
+ }
+
+ if (viewType.getInfoType() == InfoType.BROKER_INFO) {
+ dbListCombo.setEnabled(false);
+ dbListCombo.removeAll();
+ dbListCombo.add("BROKER_INFO");
+ dbListCombo.select(0);
+ }
+
+ dbListCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ ExUtil.exec(canvas, new Runnable() {
+ @Override
+ public void run() {
+ selectionDB = dbListCombo.getText();
+ modifyData(true);
+ thread.interrupt();
+ }
+ });
+
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ timeRangeCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+ ArrayList minuteStrList = new ArrayList();
+ for (CubridTypeShotPeriod minute : CubridTypeShotPeriod.values()) {
+ minuteStrList.add(minute.getLabel());
+ }
+ timeRangeCombo.setItems(minuteStrList.toArray(new String[CubridTypeShotPeriod.values().length]));
+ CubridTypeShotPeriod m = CubridTypeShotPeriod.fromTime(timeRange);
+ timeRangeCombo.select(m.ordinal());
+ timeRangeCombo.setLayoutData(new GridData(SWT.LEFT));
+ timeRangeCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ timeRange = CubridTypeShotPeriod.values()[timeRangeCombo.getSelectionIndex()].getTime();
+ modifyData(false);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ parent.setLayout(layout);
+ parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));
+ parent.setBackgroundMode(SWT.INHERIT_FORCE);
+ canvas = new FigureCanvas(parent);
+ GridData gdataXyGraph = new GridData(GridData.FILL_BOTH);
+ gdataXyGraph.horizontalSpan = 3;
+ canvas.setLayoutData(gdataXyGraph);
+ canvas.setScrollBarVisibility(FigureCanvas.NEVER);
+ canvas.addControlListener(new ControlListener() {
+ public void controlMoved(ControlEvent arg0) {
+ }
+
+ public void controlResized(ControlEvent arg0) {
+ Rectangle r = canvas.getClientArea();
+ xyGraph.setSize(r.width, r.height);
+ }
+ });
+
+ xyGraph = new XYGraph();
+ xyGraph.setShowLegend(true);
+ xyGraph.setShowTitle(false);
+ canvas.setContents(xyGraph);
+
+ xyGraph.primaryXAxis.setDateEnabled(true);
+ xyGraph.primaryXAxis.setShowMajorGrid(true);
+ xyGraph.primaryYAxis.setAutoScale(true);
+ xyGraph.primaryYAxis.setShowMajorGrid(true);
+
+ xyGraph.primaryXAxis.setFormatPattern("HH:mm:ss");
+ if (viewType.isPercent()) {
+ xyGraph.primaryYAxis.setRange(0, 100);
+ }
+
+ xyGraph.primaryYAxis.setFormatPattern("#,##0");
+
+ xyGraph.primaryXAxis.setTitle("");
+ xyGraph.primaryYAxis.setTitle("");
+
+ xyGraph.primaryYAxis.addMouseListener(new RangeMouseListener(getViewSite().getShell(), xyGraph.primaryYAxis));
+
+ final DefaultToolTip toolTip = new DefaultToolTip(canvas, DefaultToolTip.RECREATE, true);
+ toolTip.setFont(new Font(null, "Arial", 10, SWT.BOLD));
+ toolTip.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+
+ canvas.addMouseMoveListener(new MouseMoveListener() {
+
+ @Override
+ public void mouseMove(MouseEvent arg0) {
+
+ }
+ });
+
+ canvas.addMouseListener(new MouseListener() {
+ public void mouseUp(MouseEvent e) {
+ if (nearestTrace != null) {
+ nearestTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ nearestTrace = null;
+ }
+ toolTip.hide();
+ }
+
+ public void mouseDown(MouseEvent e) {
+ double x = xyGraph.primaryXAxis.getPositionValue(e.x, false);
+ double y = xyGraph.primaryYAxis.getPositionValue(e.y, false);
+ if (x < 0 || y < 0) {
+ return;
+ }
+ double minDistance = 30.0d;
+ long time = 0;
+ double value = 0;
+
+ for (Trace t : traces) {
+ ISample s = ScouterUtil.getNearestPoint(t.getDataProvider(), x);
+ if (s != null) {
+ int x2 = xyGraph.primaryXAxis.getValuePosition(s.getXValue(), false);
+ int y2 = xyGraph.primaryYAxis.getValuePosition(s.getYValue(), false);
+ double distance = ScouterUtil.getPointDistance(e.x, e.y, x2, y2);
+ if (minDistance > distance) {
+ minDistance = distance;
+ nearestTrace = t;
+ time = (long) s.getXValue();
+ value = s.getYValue();
+ }
+ }
+ }
+
+ if (nearestTrace != null) {
+ int width = PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH);
+ nearestTrace.setLineWidth(width + 2);
+ toolTip.setText(nearestTrace.getName() + "\nTime : " + DateUtil.format(time, "HH:mm:ss")
+ + "\nValue : " + FormatUtil.print(value, "#,###.##"));
+ toolTip.show(new Point(e.x, e.y));
+ }
+ }
+
+ public void mouseDoubleClick(MouseEvent e) {
+ }
+ });
+
+ CubridMenuUtil.createAddViewContextMenu(getSite().getWorkbenchWindow(), serverId, canvas);
+
+ thread = new RefreshThread(this, REFRESH_INTERVAL);
+ thread.start();
+ }
+
+ public void setFocus() {
+
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ if (this.thread != null) {
+ this.thread.shutdown();
+ }
+ }
+
+ public void refresh() {
+
+ if (ActiveDbInfo.getInstance() == null) {
+ return;
+ }
+
+ if (viewType.getInfoType() == InfoType.BROKER_INFO) {
+ if (!ActiveDbInfo.getInstance().getDbList().isEmpty()) {
+ selectionDB = ActiveDbInfo.getInstance().getDbList().get(0);
+ } else {
+ return;
+ }
+ } else if (selectionDB.equals("default")) {
+ checkDBList();
+ return;
+ } else {
+ checkDBList();
+ }
+
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ Value v = null;
+
+ try {
+ MapPack param = new MapPack();
+ ListValue objHashLv = new ListValue();
+ objHashLv.add(ActiveDbInfo.getInstance().getObjectHash(selectionDB));
+ param.put("objHash", objHashLv);
+ param.put("counter", viewType.getCounterName());
+ v = tcp.getSingleValue(RequestCmd.CUBRID_DB_REALTIME_MULTI_DATA, param);
+ } catch (Exception e) {
+ e.printStackTrace();
+ ConsoleProxy.errorSafe(e.toString());
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ if (v == null) {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ setTitleImage(Images.inactive);
+ long now = TimeUtil.getCurrentTime(serverId);
+ long stime = now - timeRange;
+ xyGraph.primaryXAxis.setRange(stime, now + 1);
+ }
+ });
+ } else {
+ MapValue value = (MapValue) v;
+ final long data = value.getLong(viewType.getCounterName());
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ setTitleImage(Images.active);
+ long now = TimeUtil.getCurrentTime(serverId);
+ long stime = now - timeRange;
+ xyGraph.primaryXAxis.setRange(stime, now + 1);
+
+ getDataProvider(serverId).addSample(new Sample(now, data));
+ if (viewType.isPercent()) {
+ xyGraph.primaryYAxis.setRange(0, 100);
+ } else {
+ double max = ChartUtil.getMax(getDataProvider(serverId).iterator());
+ xyGraph.primaryYAxis.setRange(0, max);
+ }
+ }
+ });
+ }
+ }
+
+ private CircularBufferDataProvider getDataProvider(int serverId) {
+ CircularBufferDataProvider data = datas.get(serverId);
+ if (data == null) {
+ data = new CircularBufferDataProvider(true);
+ datas.put(serverId, data);
+ int bufferSize;
+ bufferSize = (int) (timeRange / REFRESH_INTERVAL) + 1;
+ data.setBufferSize(bufferSize);
+ data.setCurrentXDataArray(new double[] {});
+ data.setCurrentYDataArray(new double[] {});
+
+ final Trace trace = new Trace(viewType.getTitle(), xyGraph.primaryXAxis, xyGraph.primaryYAxis, data);
+ trace.setPointStyle(PointStyle.NONE);
+ trace.setAreaAlpha(90);
+ trace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));
+ trace.setTraceType(viewType.getTraceType());
+ trace.setTraceColor(ColorUtil.getInstance().getColor(viewType.getColor()));
+ xyGraph.addTrace(trace);
+ traces.add(trace);
+ }
+ return data;
+ }
+
+ public void checkDBList() {
+
+ if (!isDefaultView) {
+ return;
+ }
+
+ if (ActiveDbInfo.getInstance().getActiveDBInfo().hashCode() == prvActiveDBHash) {
+ return;
+ }
+
+ prvActiveDBHash = ActiveDbInfo.getInstance().getActiveDBInfo().hashCode();
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ dbListCombo.removeAll();
+ }
+ });
+
+ if (!ActiveDbInfo.getInstance().isEmpty()) {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ for (String dbName : ActiveDbInfo.getInstance().keySet()) {
+ dbListCombo.add(dbName);
+ }
+ dbListCombo.setEnabled(true);
+ }
+ });
+
+ } else {
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ dbListCombo.setEnabled(false);
+ }
+ });
+ }
+
+ ExUtil.exec(canvas, new Runnable() {
+ public void run() {
+ for (int i = 0; i < dbListCombo.getItemCount(); i++) {
+ if (dbListCombo.getItem(i).equals(selectionDB)) {
+ dbListCombo.select(i);
+ return;
+ }
+ }
+
+ if (dbListCombo.getItemCount() != 0) {
+ dbListCombo.select(0);
+ selectionDB = dbListCombo.getItem(dbListCombo.getSelectionIndex());
+ }
+ }
+ });
+ }
+
+ public void redraw() {
+ if (canvas != null && canvas.isDisposed() == false) {
+ canvas.redraw();
+ xyGraph.repaint();
+ }
+ }
+
+ private void modifyData(boolean clean) {
+ redraw();
+ if (clean) {
+ getDataProvider(serverId).clearTrace();
+ }
+ Trace trace = traces.get(0);
+ trace.setName(viewType.getTitle());
+ trace.setTraceType(viewType.getTraceType());
+ trace.setTraceColor(ColorUtil.getInstance().getColor(viewType.getColor()));
+ int bufferSize;
+ bufferSize = (int) (timeRange / REFRESH_INTERVAL) + 1;
+ getDataProvider(serverId).setBufferSize(bufferSize);
+ }
+
+}
diff --git a/scouter.client/src/scouter/client/cubrid/views/CubridSpaceDbView.java b/scouter.client/src/scouter/client/cubrid/views/CubridSpaceDbView.java
new file mode 100755
index 000000000..c910baf24
--- /dev/null
+++ b/scouter.client/src/scouter/client/cubrid/views/CubridSpaceDbView.java
@@ -0,0 +1,503 @@
+/*
+ * 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.client.cubrid.views;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+import scouter.client.Images;
+import scouter.client.cubrid.ActiveDbInfo;
+import scouter.client.cubrid.actions.AddLongTransactionList;
+import scouter.client.model.AgentModelThread;
+import scouter.client.model.RefreshThread;
+import scouter.client.model.RefreshThread.Refreshable;
+import scouter.client.net.TcpProxy;
+import scouter.client.util.ExUtil;
+import scouter.client.util.TimeUtil;
+import scouter.lang.constants.StatusConstants;
+import scouter.lang.counters.CounterConstants;
+import scouter.lang.pack.MapPack;
+import scouter.lang.pack.Pack;
+import scouter.lang.pack.StatusPack;
+import scouter.lang.value.ListValue;
+import scouter.lang.value.MapValue;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+import scouter.util.DateUtil;
+
+public class CubridSpaceDbView extends ViewPart implements Refreshable {
+ public static final String ID = CubridSpaceDbView.class.getName();
+
+ static long TIME_RANGE = DateUtil.MILLIS_PER_FIVE_MINUTE;
+ static int REFRESH_INTERVAL = (int) (DateUtil.MILLIS_PER_SECOND * 5);
+
+ int serverId;
+
+ private Composite tableComposite;
+ private Table table;
+ private TableItem tableItem;
+
+ private ArrayList dbSpaceData = new ArrayList<>();
+ private Composite composite;
+
+ Combo dbListCombo;
+ boolean isDefaultView = false;
+
+ RefreshThread thread;
+
+ String date;
+ long stime, etime;
+
+ MapValue prvData;
+
+ String selectionDB;
+ int prvActiveDBHash;
+
+ private static final String DBSPACE_PERM_AND_PERM_TOTAL = "perm_and_perm_total";
+ private static final String DBSPACE_PERM_AND_PERM_USED = "perm_and_perm_used";
+ private static final String DBSPACE_PERM_AND_TEMP_TOTAL = "perm_and_temp_total";
+ private static final String DBSPACE_PERM_AND_TEMP_USED = "perm_and_temp_used";
+ private static final String DBSPACE_TEMP_AND_TEMP_TOTAL = "temp_and_temp_total";
+ private static final String DBSPACE_TEMP_AND_TEMP_USED = "temp_and_temp_used";
+
+ @Override
+ public void init(IViewSite site) throws PartInitException {
+ super.init(site);
+ String secId = site.getSecondaryId();
+ String ids[] = secId.split("&");
+ serverId = CastUtil.cint(ids[0]);
+ selectionDB = CastUtil.cString(ids[1]);
+
+ if (selectionDB.equals("default")) {
+ isDefaultView = true;
+ }
+
+ makeDbSpaceData();
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+ this.setPartName("CUBRID DBSpaceInfo");
+ composite = parent;
+ GridLayout layout = new GridLayout(3, true);
+ parent.setLayout(layout);
+ dbListCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
+
+ if (!isDefaultView) {
+ dbListCombo.add(selectionDB);
+ dbListCombo.select(0);
+ dbListCombo.setEnabled(false);
+ }
+
+ dbListCombo.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ ExUtil.exec(composite, new Runnable() {
+ @Override
+ public void run() {
+ selectionDB = dbListCombo.getItem(dbListCombo.getSelectionIndex());
+ thread.interrupt();
+ }
+ });
+
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+ });
+
+ tableComposite = new Composite(composite, SWT.NONE);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.horizontalSpan = 3;
+ data.verticalSpan = 3;
+ tableComposite.setLayoutData(data);
+ tableComposite.setLayout(new FillLayout());
+
+ table = new Table(tableComposite, SWT.BORDER);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(false);
+ createContextMenu();
+
+ for (int i = 0; i < ColumnEnum.values().length; i++) {
+ new TableColumn(table, SWT.NONE);
+ table.getColumn(i).setText(ColumnEnum.values()[i].getTitle());
+ }
+
+ tableItem = new TableItem(table, SWT.NONE);
+ tableItem.setText(ListTypeEnum.TYPE1.getTypeArray());
+ tableItem = new TableItem(table, SWT.NONE);
+ tableItem.setText(ListTypeEnum.TYPE2.getTypeArray());
+ tableItem = new TableItem(table, SWT.NONE);
+ tableItem.setText(ListTypeEnum.TYPE3.getTypeArray());
+
+ table.addListener(SWT.PaintItem, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ if (event.index == 2) {
+ //System.out.println("handleEvent : " + event);
+ GC gc = event.gc;
+ int percent = 0;
+ int total = 0;
+ int used = 0;
+ TableItem item = (TableItem)event.item;
+ //System.out.println("dbSpaceData.size() : " + dbSpaceData.size());
+ for (int i=0; i < dbSpaceData.size(); i++) {
+ //System.out.println("dbSpaceData.get(i) : " + dbSpaceData.get(i).total);
+ //System.out.println("dbSpaceData.get(i) : " + dbSpaceData.get(i).used);
+ if (item.getText(0).equals(dbSpaceData.get(i).listType.getPurpose())
+ && item.getText(1).equals(dbSpaceData.get(i).listType.getType())) {
+ percent = dbSpaceData.get(i).getPercent();
+ total = dbSpaceData.get(i).getTotal();
+ used = dbSpaceData.get(i).getUsed();
+ }
+ }
+ Color foreground = gc.getForeground();
+ Color background = gc.getBackground();
+ if (percent < 90) {
+ gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN));
+ gc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GREEN));
+ } else {
+ gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_RED));
+ gc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+ int width = (table.getColumn(event.index).getWidth() - 1) * percent / 100;
+ gc.fillGradientRectangle(event.x, event.y, width, event.height, true);
+ Rectangle rect2 = new Rectangle(event.x, event.y, width-1, event.height-1);
+ gc.drawRectangle(rect2);
+ gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND));
+ String text = percent+"%" + " ( " + used + "MB" + " / " + total + "MB )";
+ Point size = event.gc.textExtent(text);
+ int offset = Math.max(0, (event.height - size.y) / 2);
+ gc.drawText(text, event.x+5, event.y+offset, true);
+ gc.setForeground(background);
+ gc.setBackground(foreground);
+ }
+ }
+ });
+
+// table.addListener(SWT.Resize, new Listener() {
+//
+// @Override
+// public void handleEvent(Event event) {
+//
+// }
+// });
+
+ for (int i = 0; i < ColumnEnum.values().length; i++) {
+ table.getColumn(i).pack();
+ table.getColumn(i).setToolTipText("aaaa");
+ table.getColumn(2).setWidth(table.getBounds().width -
+ table.getColumn(0).getWidth() - table.getColumn(1).getWidth() - 2);
+ }
+
+ thread = new RefreshThread(this, REFRESH_INTERVAL);
+ thread.start();
+ }
+
+ private void createContextMenu() {
+ MenuManager manager = new MenuManager();
+ table.setMenu(manager.createContextMenu(table));
+ manager.add(new Action("&Add DBSpaceInfo", ImageDescriptor.createFromImage(Images.add)) {
+ public void run() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ AddLongTransactionList dialog = new AddLongTransactionList(window.getShell().getDisplay(),
+ new AddLongTransactionList.IAddLongTransactionList() {
+ @Override
+ public void onPressedOk(String dbName) {
+ try {
+ window.getActivePage().showView(CubridSpaceDbView.ID,
+ serverId + "&" + dbName,
+ IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onPressedCancel() {
+ }
+ });
+
+ dialog.show();
+ }
+ });
+ }
+
+ @Override
+ public void refresh() {
+
+ ExUtil.exec(table, new Runnable() {
+ public void run() {
+ }
+ });
+
+ long now = TimeUtil.getCurrentTime(serverId);
+ date = DateUtil.yyyymmdd(now);
+ stime = now - TIME_RANGE;
+ etime = now;
+
+ if (isDefaultView) {
+ checkDBList();
+ }
+
+ if (selectionDB == null || selectionDB.isEmpty()) {
+ return;
+ }
+
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ Pack p = null;
+
+ try {
+ MapPack param = new MapPack();
+ ListValue objHashLv = AgentModelThread.getInstance().getLiveObjHashLV(serverId,
+ CounterConstants.CUBRID_AGENT);
+ StatusPack sp = null;
+ MapValue mv = null;
+
+ if (objHashLv.size() > 0) {
+ param.put("objHash", objHashLv);
+ param.put("date", date);
+ param.put("stime", stime);
+ param.put("etime", etime);
+ param.put("time", now);
+ param.put("key", StatusConstants.CUBRID_DB_SERVER_INFO + selectionDB);
+ p = tcp.getSingle(RequestCmd.CUBRID_DB_SERVER_INFO, param);
+ if (p != null) {
+ sp = (StatusPack) p;
+ mv = sp.data;
+ }
+
+ if (mv != null) {
+ dbSpaceData.get(ListTypeEnum.TYPE1.ordinal()).total = Integer.parseInt(mv.getText(DBSPACE_PERM_AND_PERM_TOTAL));
+ dbSpaceData.get(ListTypeEnum.TYPE1.ordinal()).used = Integer.parseInt(mv.getText(DBSPACE_PERM_AND_PERM_USED));
+ dbSpaceData.get(ListTypeEnum.TYPE2.ordinal()).total = Integer.parseInt(mv.getText(DBSPACE_PERM_AND_TEMP_TOTAL));
+ dbSpaceData.get(ListTypeEnum.TYPE2.ordinal()).used = Integer.parseInt(mv.getText(DBSPACE_PERM_AND_TEMP_USED));
+ dbSpaceData.get(ListTypeEnum.TYPE3.ordinal()).total = Integer.parseInt(mv.getText(DBSPACE_TEMP_AND_TEMP_TOTAL));
+ dbSpaceData.get(ListTypeEnum.TYPE3.ordinal()).used = Integer.parseInt(mv.getText(DBSPACE_TEMP_AND_TEMP_USED));
+ }
+ }
+ } catch (Throwable th) {
+ th.printStackTrace();
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+
+ //table update
+ ExUtil.exec(table, new Runnable() {
+ public void run() {
+ table.setSize(table.getSize().x, table.getSize().y + 1);
+ table.setSize(table.getSize().x, table.getSize().y - 1);
+ table.getColumn(2).setWidth(table.getBounds().width -
+ table.getColumn(0).getWidth() - table.getColumn(1).getWidth() - 4);
+ }
+ });
+
+ }
+
+ public void checkDBList() {
+
+ if (ActiveDbInfo.getInstance().getActiveDBInfo().hashCode() == prvActiveDBHash) {
+ return;
+ }
+
+ prvActiveDBHash = ActiveDbInfo.getInstance().getActiveDBInfo().hashCode();
+
+ ExUtil.exec(composite, new Runnable() {
+ public void run() {
+ dbListCombo.removeAll();
+ }
+ });
+
+ if (!ActiveDbInfo.getInstance().isEmpty()) {
+ ExUtil.exec(composite, new Runnable() {
+ public void run() {
+ for (String dbName : ActiveDbInfo.getInstance().keySet()) {
+ dbListCombo.add(dbName);
+ }
+ dbListCombo.setEnabled(true);
+ }
+ });
+
+ } else {
+ ExUtil.exec(composite, new Runnable() {
+ public void run() {
+ dbListCombo.setEnabled(false);
+ }
+ });
+ }
+
+ ExUtil.exec(composite, new Runnable() {
+ public void run() {
+ for (int i = 0; i < dbListCombo.getItemCount(); i++) {
+ if (dbListCombo.getItem(i).equals(selectionDB)) {
+ dbListCombo.select(i);
+ return;
+ }
+ }
+
+ if (dbListCombo.getItemCount() != 0) {
+ dbListCombo.select(0);
+ selectionDB = dbListCombo.getItem(dbListCombo.getSelectionIndex());
+ }
+ }
+ });
+ }
+
+ enum ColumnEnum {
+ PURPOSE("Purpose"),
+ TYPE("Type"),
+ FREE_PERCENTAGE("Free");
+
+ private final String title;
+
+ private ColumnEnum(String text) {
+ this.title = text;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+ }
+
+ enum ListTypeEnum {
+ TYPE1("PEMANENT", "PEMANENT"),
+ TYPE2("PEMANENT", "TEMPORARY"),
+ TYPE3("TEMPORARY", "TEMPORARY");
+
+ private final String purpose;
+ private final String type;
+
+ private ListTypeEnum(String purpose, String type) {
+ this.purpose = purpose;
+ this.type = type;
+ }
+
+ public String getPurpose() {
+ return purpose;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public String[] getTypeArray() {
+ return new String[] {purpose, type};
+ }
+
+ }
+
+ class DbSpace {
+ ListTypeEnum listType;
+ int total;
+ int used;
+
+ public DbSpace(ListTypeEnum listType, int total, int used) {
+ this.listType = listType;
+ this.total = total;
+ this.used = used;
+
+ }
+
+ public String getPurpose() {
+ return listType.getPurpose();
+ }
+
+ public String getType() {
+ return listType.getType();
+ }
+
+ public int getTotal() {
+ return total;
+ }
+
+ public int getUsed() {
+ return used;
+ }
+
+ public void setTotal(int value) {
+ this.total = value;
+ }
+
+ public void setUsed(int value) {
+ this.used = value;
+ }
+
+ public int getPercent() {
+ if (used != 0 && total != 0) {
+ return (int) ((float)used / total * 100);
+ }
+ return 0;
+ }
+
+ public String getString() {
+ return "listType purpose : " + listType.getPurpose()
+ + " type : " + listType.getType()
+ + " total : " + Integer.toString(total)
+ + " used : " + Integer.toString(used)
+ + " percent : " + getPercent();
+ }
+
+ }
+
+ private void makeDbSpaceData() {
+ DbSpace type1 = new DbSpace(ListTypeEnum.TYPE1, 0, 0);
+ DbSpace type2 = new DbSpace(ListTypeEnum.TYPE2, 0, 0);
+ DbSpace type3 = new DbSpace(ListTypeEnum.TYPE3, 0, 0);
+ dbSpaceData.add(type1);
+ dbSpaceData.add(type2);
+ dbSpaceData.add(type3);
+ }
+
+ @Override
+ public void setFocus() {
+
+ }
+
+}
+
+
diff --git a/scouter.client/src/scouter/client/group/view/GroupNavigationView.java b/scouter.client/src/scouter/client/group/view/GroupNavigationView.java
index b065a6b7f..6a740c691 100644
--- a/scouter.client/src/scouter/client/group/view/GroupNavigationView.java
+++ b/scouter.client/src/scouter/client/group/view/GroupNavigationView.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 the original author or authors.
+ * Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,12 +17,6 @@
*/
package scouter.client.group.view;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -55,7 +49,6 @@
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
-
import scouter.client.Images;
import scouter.client.actions.OpenAddGroupAction;
import scouter.client.actions.OpenEQGroupViewAction;
@@ -104,6 +97,12 @@
import scouter.util.FormatUtil;
import scouter.util.LinkedMap;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
public class GroupNavigationView extends ViewPart implements RefreshThread.Refreshable, IAddGroup, IManageGroup, IGroupAssign {
public static final String ID = GroupNavigationView.class.getName();
@@ -223,7 +222,15 @@ public void menuAboutToShow(IMenuManager manager){
manager.add(serviceGroupMgr);
serviceGroupMgr.add(new OpenServiceGroupTPSGroupAction(win, grpName));
serviceGroupMgr.add(new OpenServiceGroupElapsedGroupAction(win, grpName));
- }
+
+ } else if (isChildOf(objType, CounterConstants.FAMILY_GOLANG)) {
+ manager.add(new OpenEQGroupViewAction(win, grpObj.getName()));
+ manager.add(new OpenVerticalEQGroupViewAction(win, grpObj.getName()));
+ MenuManager xLogMenu = new MenuManager(MenuStr.XLOG, ImageUtil.getImageDescriptor(Images.transrealtime), MenuStr.XLOG_ID);
+ manager.add(xLogMenu);
+ xLogMenu.add(new OpenRealTimeTranXGroupViewAction(win, MenuStr.REALTIME_XLOG, grpObj));
+ xLogMenu.add(new OpenPastTimeTranXGroupViewAction(win, MenuStr.PASTTIME_XLOG, grpObj));
+ }
}
} else if (selObject instanceof AgentObject) {
AgentObject agent = (AgentObject) selObject;
diff --git a/scouter.client/src/scouter/client/heapdump/actions/BlockProfileAction.java b/scouter.client/src/scouter/client/heapdump/actions/BlockProfileAction.java
new file mode 100644
index 000000000..5dcdea7a3
--- /dev/null
+++ b/scouter.client/src/scouter/client/heapdump/actions/BlockProfileAction.java
@@ -0,0 +1,92 @@
+/*
+ * 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.client.heapdump.actions;
+
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IWorkbenchWindow;
+import scouter.client.net.TcpProxy;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ExUtil;
+import scouter.client.util.ImageUtil;
+import scouter.lang.pack.MapPack;
+import scouter.lang.value.BooleanValue;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+
+public class BlockProfileAction extends Action {
+ public final static String ID = BlockProfileAction.class.getName();
+
+ private final IWorkbenchWindow window;
+ @SuppressWarnings("unused")
+ private String key;
+ private int objHash;
+ private String objName;
+ private String fName;
+ private long time;
+ private int serverId;
+
+ public BlockProfileAction(IWorkbenchWindow window, String label, String key, int objHash, String fName, long time, Image image, int serverId) {
+ this.window = window;
+ this.key = key;
+ this.objHash = objHash;
+ this.objName = fName;
+ this.fName = fName + "_block";
+ this.time = time;
+ this.serverId = serverId;
+
+ setText(label);
+ setId(ID);
+ setImageDescriptor(ImageUtil.getImageDescriptor(image));
+
+ }
+
+ public void run() {
+ ExUtil.asyncRun(new Runnable() {
+ public void run() {
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ try {
+ MapPack param = new MapPack();
+ param.put("objHash", objHash);
+ param.put("fName", fName);
+ param.put("time", time);
+ MapPack out = (MapPack) tcp.getSingle(RequestCmd.OBJECT_CALL_BLOCK_PROFILE, param);
+
+ if(out != null){
+ if(!CastUtil.cboolean((BooleanValue)out.get("success"))){
+ ConsoleProxy.infoSafe(out.getText("msg"));
+ }
+ }
+// ExUtil.exec(window.getShell().getDisplay(), new Runnable(){
+// public void run() {
+// try{
+// Action act = new HeapDumpListAction(window, "Dumps", objName, objHash, Images.heap, serverId);
+// act.run();
+// }catch(Exception e){
+// e.printStackTrace();
+// }
+// }
+// });
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ }
+ });
+ }
+}
diff --git a/scouter.client/src/scouter/client/heapdump/actions/CpuProfileAction.java b/scouter.client/src/scouter/client/heapdump/actions/CpuProfileAction.java
new file mode 100644
index 000000000..f2f4afc41
--- /dev/null
+++ b/scouter.client/src/scouter/client/heapdump/actions/CpuProfileAction.java
@@ -0,0 +1,92 @@
+/*
+ * 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.client.heapdump.actions;
+
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IWorkbenchWindow;
+import scouter.client.net.TcpProxy;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ExUtil;
+import scouter.client.util.ImageUtil;
+import scouter.lang.pack.MapPack;
+import scouter.lang.value.BooleanValue;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+
+public class CpuProfileAction extends Action {
+ public final static String ID = CpuProfileAction.class.getName();
+
+ private final IWorkbenchWindow window;
+ @SuppressWarnings("unused")
+ private String key;
+ private int objHash;
+ private String objName;
+ private String fName;
+ private long time;
+ private int serverId;
+
+ public CpuProfileAction(IWorkbenchWindow window, String label, String key, int objHash, String fName, long time, Image image, int serverId) {
+ this.window = window;
+ this.key = key;
+ this.objHash = objHash;
+ this.objName = fName;
+ this.fName = fName + "_block";
+ this.time = time;
+ this.serverId = serverId;
+
+ setText(label);
+ setId(ID);
+ setImageDescriptor(ImageUtil.getImageDescriptor(image));
+
+ }
+
+ public void run() {
+ ExUtil.asyncRun(new Runnable() {
+ public void run() {
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ try {
+ MapPack param = new MapPack();
+ param.put("objHash", objHash);
+ param.put("fName", fName);
+ param.put("time", time);
+ MapPack out = (MapPack) tcp.getSingle(RequestCmd.OBJECT_CALL_CPU_PROFILE, param);
+
+ if(out != null){
+ if(!CastUtil.cboolean((BooleanValue)out.get("success"))){
+ ConsoleProxy.infoSafe(out.getText("msg"));
+ }
+ }
+// ExUtil.exec(window.getShell().getDisplay(), new Runnable(){
+// public void run() {
+// try{
+// Action act = new HeapDumpListAction(window, "Dumps", objName, objHash, Images.heap, serverId);
+// act.run();
+// }catch(Exception e){
+// e.printStackTrace();
+// }
+// }
+// });
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ }
+ });
+ }
+}
diff --git a/scouter.client/src/scouter/client/heapdump/actions/HeapDumpAction.java b/scouter.client/src/scouter/client/heapdump/actions/HeapDumpAction.java
index 01cc4d7f9..6c6ea4824 100644
--- a/scouter.client/src/scouter/client/heapdump/actions/HeapDumpAction.java
+++ b/scouter.client/src/scouter/client/heapdump/actions/HeapDumpAction.java
@@ -78,7 +78,7 @@ public void run() {
ExUtil.exec(window.getShell().getDisplay(), new Runnable(){
public void run() {
try{
- Action act = new HeapDumpListAction(window, "Heap Dump", objName, objHash, Images.heap, serverId);
+ Action act = new HeapDumpListAction(window, "Dumps", objName, objHash, Images.heap, serverId);
act.run();
}catch(Exception e){
e.printStackTrace();
diff --git a/scouter.client/src/scouter/client/heapdump/actions/MutexProfileAction.java b/scouter.client/src/scouter/client/heapdump/actions/MutexProfileAction.java
new file mode 100644
index 000000000..2d20d2605
--- /dev/null
+++ b/scouter.client/src/scouter/client/heapdump/actions/MutexProfileAction.java
@@ -0,0 +1,92 @@
+/*
+ * 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.client.heapdump.actions;
+
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IWorkbenchWindow;
+import scouter.client.net.TcpProxy;
+import scouter.client.util.ConsoleProxy;
+import scouter.client.util.ExUtil;
+import scouter.client.util.ImageUtil;
+import scouter.lang.pack.MapPack;
+import scouter.lang.value.BooleanValue;
+import scouter.net.RequestCmd;
+import scouter.util.CastUtil;
+
+public class MutexProfileAction extends Action {
+ public final static String ID = MutexProfileAction.class.getName();
+
+ private final IWorkbenchWindow window;
+ @SuppressWarnings("unused")
+ private String key;
+ private int objHash;
+ private String objName;
+ private String fName;
+ private long time;
+ private int serverId;
+
+ public MutexProfileAction(IWorkbenchWindow window, String label, String key, int objHash, String fName, long time, Image image, int serverId) {
+ this.window = window;
+ this.key = key;
+ this.objHash = objHash;
+ this.objName = fName;
+ this.fName = fName + "_block";
+ this.time = time;
+ this.serverId = serverId;
+
+ setText(label);
+ setId(ID);
+ setImageDescriptor(ImageUtil.getImageDescriptor(image));
+
+ }
+
+ public void run() {
+ ExUtil.asyncRun(new Runnable() {
+ public void run() {
+ TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
+ try {
+ MapPack param = new MapPack();
+ param.put("objHash", objHash);
+ param.put("fName", fName);
+ param.put("time", time);
+ MapPack out = (MapPack) tcp.getSingle(RequestCmd.OBJECT_CALL_MUTEX_PROFILE, param);
+
+ if(out != null){
+ if(!CastUtil.cboolean((BooleanValue)out.get("success"))){
+ ConsoleProxy.infoSafe(out.getText("msg"));
+ }
+ }
+// ExUtil.exec(window.getShell().getDisplay(), new Runnable(){
+// public void run() {
+// try{
+// Action act = new HeapDumpListAction(window, "Dumps", objName, objHash, Images.heap, serverId);
+// act.run();
+// }catch(Exception e){
+// e.printStackTrace();
+// }
+// }
+// });
+ } finally {
+ TcpProxy.putTcpProxy(tcp);
+ }
+ }
+ });
+ }
+}
diff --git a/scouter.client/src/scouter/client/heapdump/views/HeapDumpListView.java b/scouter.client/src/scouter/client/heapdump/views/HeapDumpListView.java
index 21f85bb06..492c28f66 100644
--- a/scouter.client/src/scouter/client/heapdump/views/HeapDumpListView.java
+++ b/scouter.client/src/scouter/client/heapdump/views/HeapDumpListView.java
@@ -41,7 +41,6 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
-
import scouter.client.Images;
import scouter.client.heapdump.actions.HeapDumpDeleteAction;
import scouter.client.heapdump.actions.HeapDumpDownloadAction;
@@ -52,7 +51,6 @@
import scouter.client.util.ConsoleProxy;
import scouter.client.util.ExUtil;
import scouter.client.util.ImageUtil;
-import scouter.client.util.ScouterUtil;
import scouter.client.util.SortUtil;
import scouter.client.util.TableControlAdapter;
import scouter.client.util.UIUtil;
@@ -118,7 +116,7 @@ public void mouseDown(MouseEvent event) {
downloadItem.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- Action act = new HeapDumpDownloadAction(window, "Download Heap Dump", fileName, objName, objHash, Images.heap, serverId);
+ Action act = new HeapDumpDownloadAction(window, "Download Binary Dump", fileName, objName, objHash, Images.heap, serverId);
act.run();
}
});
@@ -129,7 +127,7 @@ public void handleEvent(Event event) {
deleteItem.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- Action act = new HeapDumpDeleteAction(window, "Delete HeapDump", fileName, objHash, fileName, Images.heap, serverId);
+ Action act = new HeapDumpDeleteAction(window, "Delete Binary Dump", fileName, objHash, fileName, Images.heap, serverId);
act.run();
reload();
}
@@ -294,4 +292,4 @@ private void restoreState() {
-}
\ No newline at end of file
+}
diff --git a/scouter.client/src/scouter/client/model/AgentModelThread.java b/scouter.client/src/scouter/client/model/AgentModelThread.java
index bf4e63653..c409df8d4 100644
--- a/scouter.client/src/scouter/client/model/AgentModelThread.java
+++ b/scouter.client/src/scouter/client/model/AgentModelThread.java
@@ -17,6 +17,15 @@
*/
package scouter.client.model;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
import scouter.client.net.INetReader;
import scouter.client.net.TcpProxy;
import scouter.client.server.ServerManager;
@@ -27,15 +36,6 @@
import scouter.net.RequestCmd;
import scouter.util.ThreadUtil;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
public class AgentModelThread extends Thread {
private static AgentModelThread instance = null;
diff --git a/scouter.client/src/scouter/client/popup/CalendarDialog.java b/scouter.client/src/scouter/client/popup/CalendarDialog.java
index 52b8628bc..d0253857d 100644
--- a/scouter.client/src/scouter/client/popup/CalendarDialog.java
+++ b/scouter.client/src/scouter/client/popup/CalendarDialog.java
@@ -237,6 +237,11 @@ public void showWithEndTime() {
showWithEndTime(stime, etime);
}
+ public void showWithEndTime(Point p, long stime, long etime) {
+ if (p != null)
+ showWithEndTime((int) p.getX(), (int) p.getY() + 10, stime, etime);
+ }
+
public void showWithEndTime(long stime, long etime) {
final Shell dialog = new Shell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
dialog.setLayout(new GridLayout(4, false));
@@ -328,6 +333,102 @@ public void handleEvent(Event event) {
dialog.open();
}
+ public void showWithEndTime(int x, int y, long stime, long etime) {
+ final Shell dialog = new Shell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ dialog.setLayout(new GridLayout(4, false));
+ dialog.setText("Date/Time");
+
+ final DateTime calendar = new DateTime(dialog, SWT.CALENDAR);
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, false, false, 4, 1);
+ calendar.setLayoutData(data);
+
+ int year = CastUtil.cint(DateUtil.format(stime, "yyyy"));
+ int month = CastUtil.cint(DateUtil.format(stime, "MM")) - 1;
+ int day = CastUtil.cint(DateUtil.format(stime, "dd"));
+ calendar.setDate(year, month, day);
+ calendar.setDay(day);
+
+ Label label = new Label(dialog, SWT.NONE);
+ label.setText("From");
+ final DateTime startTime = new DateTime(dialog, SWT.TIME | SWT.SHORT);
+ startTime.setHours(DateUtil.getHour(stime));
+ startTime.setMinutes(DateUtil.getMin(stime));
+
+ label = new Label(dialog, SWT.NONE);
+ label.setText("To");
+ final DateTime endTime = new DateTime(dialog, SWT.TIME | SWT.SHORT);
+ endTime.setHours(DateUtil.getHour(etime));
+ endTime.setMinutes(DateUtil.getMin(etime));
+
+ Button okButton = new Button(dialog, SWT.PUSH);
+ okButton.setText("&OK");
+ okButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ okButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ try {
+ String fromTime = (calendar.getMonth() + 1) + "/"
+ + calendar.getDay() + "/"
+ + calendar.getYear() + " "
+ + (startTime.getHours() < 10 ? "0" : "") + startTime.getHours() + ":"
+ + (startTime.getMinutes() < 10 ? "0" : "") + startTime.getMinutes();
+
+ boolean nextDay0 = false;
+ if (endTime.getHours() == 0 && endTime.getMinutes() == 0) {
+ nextDay0 = true;
+ }
+
+ String toTime = (calendar.getMonth() + 1) + "/"
+ + calendar.getDay() + "/"
+ + calendar.getYear() + " "
+ + (endTime.getHours() < 10 ? "0" : "") + endTime.getHours() + ":"
+ + (endTime.getMinutes() < 10 ? "0" : "") + endTime.getMinutes();
+
+ long startTime = DateUtil.getTime(fromTime, "MM/dd/yyyy HH:mm");
+ long endTime = DateUtil.getTime(toTime, "MM/dd/yyyy HH:mm");
+ if (nextDay0) {
+ endTime += DateUtil.MILLIS_PER_DAY - 1000;
+ }
+ if (endTime <= startTime) {
+ MessageDialog.openWarning(dialog, "Warning", "Time range is incorrect");
+ } else {
+ callback.onPressedOk(startTime, endTime);
+ dialog.close();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ MessageDialog.openError(dialog, "Error", "Date format error:" + e.getMessage());
+ }
+ break;
+ }
+ }
+ });
+
+ Button cancelButton = new Button(dialog, SWT.PUSH);
+ cancelButton.setText("&Cancel");
+ cancelButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ cancelButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Selection:
+ callback.onPressedCancel();
+ dialog.close();
+ break;
+ }
+ }
+ });
+
+
+ if (x > 0 && y > 0) {
+ dialog.setLocation(x, y);
+ }
+
+ dialog.setDefaultButton(okButton);
+ dialog.pack();
+ dialog.open();
+ }
+
public interface ILoadCalendarDialog {
void onPressedOk(long startTime, long endTime);
diff --git a/scouter.client/src/scouter/client/util/MenuUtil.java b/scouter.client/src/scouter/client/util/MenuUtil.java
index 7868c3688..f56589a9f 100644
--- a/scouter.client/src/scouter/client/util/MenuUtil.java
+++ b/scouter.client/src/scouter/client/util/MenuUtil.java
@@ -63,6 +63,8 @@
import scouter.client.context.actions.OpenCxtmenuHeapHistoViewAction;
import scouter.client.context.actions.OpenCxtmenuObjectClassListAction;
import scouter.client.context.actions.OpenCxtmenuObjectThreadDumpAction;
+import scouter.client.context.actions.OpenCxtmenuProfileBlockAction;
+import scouter.client.context.actions.OpenCxtmenuProfileMutexAction;
import scouter.client.context.actions.OpenCxtmenuPropertiesAction;
import scouter.client.context.actions.OpenCxtmenuResetCacheAction;
import scouter.client.context.actions.OpenCxtmenuSystemGcAction;
@@ -101,8 +103,15 @@
import scouter.client.counter.views.CounterRealTimeView;
import scouter.client.counter.views.CounterTodayAllView;
import scouter.client.counter.views.CounterTodayTotalView;
+import scouter.client.cubrid.CubridSingleItem;
+import scouter.client.cubrid.actions.OpenMultiViewAction;
+import scouter.client.cubrid.actions.OpenOtherViewAction;
+import scouter.client.cubrid.views.CubridSpaceDbView;
+import scouter.client.heapdump.actions.BlockProfileAction;
+import scouter.client.heapdump.actions.CpuProfileAction;
import scouter.client.heapdump.actions.HeapDumpAction;
import scouter.client.heapdump.actions.HeapDumpListAction;
+import scouter.client.heapdump.actions.MutexProfileAction;
import scouter.client.host.actions.OpenDiskUsageAction;
import scouter.client.host.actions.OpenTopAction;
import scouter.client.maria.actions.OpenDbRealtimeWaitCountAction;
@@ -324,6 +333,18 @@ public static void addObjectContextMenu(IMenuManager mgr, IWorkbenchWindow win,
performanceCounter.add(new OpenRealTimeMultiAction(win, "Table Locks", serverId, objHash, objType
, new String[] {"TBL_LOCK", "TBL_LOCK_W"}));
performanceCounter.add(new OpenDbRealtimeWaitCountAction(serverId, objHash));
+ } else if (counterEngine.isChildOf(objType, CounterConstants.FAMILY_CUBRID)) {
+ performanceCounter.add(new Separator());
+ for(int ordinal = 0 ; ordinal < CubridSingleItem.values().length ; ordinal++) {
+ performanceCounter.add(new OpenMultiViewAction(serverId, objHash, ordinal));
+ }
+ performanceCounter.add(new OpenOtherViewAction(serverId, objHash, OpenOtherViewAction.OtherViewType.DML_REALTIME));
+
+ MenuManager cubridDbListView = new MenuManager(MenuStr.CUBRID_DB_LIST_VIEW, Images.CAPTURE, MenuStr.CUBRID_DB_LIST_VIEW_ID);
+ mgr.add(cubridDbListView);
+ cubridDbListView.add(new OpenOtherViewAction(serverId, objHash, OpenOtherViewAction.OtherViewType.DB_SPACE_INFO));
+ cubridDbListView.add(new OpenOtherViewAction(serverId, objHash, OpenOtherViewAction.OtherViewType.LONG_TRANSACTION));
+
}
if (object.isAlive()) {
@@ -368,6 +389,43 @@ public static void addObjectContextMenu(IMenuManager mgr, IWorkbenchWindow win,
stackMgr.add(new Separator());
stackMgr.add(new OpenStackDialogAction(serverId, objHash));
+ if (server.isAllowAction(GroupPolicyConstants.ALLOW_CONFIGURE)) {
+ mgr.add(new Separator());
+ mgr.add(new OpenAgentConfigureAction(win, MenuStr.CONFIGURE, objHash, serverId));
+ }
+ } else if (counterEngine.isChildOf(objType, CounterConstants.FAMILY_GOLANG)) {
+ performanceSnapshot.add(new OpenCxtmenuThreadListAction(win, MenuStr.THREAD_LIST, objHash, serverId));
+ performanceSnapshot.add(new OpenCxtmenuActiveServiceListAction(win, MenuStr.ACTIVE_SERVICE_LIST, objHash, objType, serverId));
+ performanceSnapshot.add(new OpenCxtmenuResetCacheAction("Reset Text Cache", objHash, serverId));
+ if (server.isAllowAction(GroupPolicyConstants.ALLOW_HEAPDUMP)) {
+ MenuManager heapDump = new MenuManager(MenuStr.BINARY_DUMP, MenuStr.HEAP_DUMP_ID);
+ performanceSnapshot.add(heapDump);
+ heapDump.add(new HeapDumpListAction(win, MenuStr.BINARY_DUMP_LIST, objName, objHash, Images.heap, serverId));
+ heapDump.add(new Separator());
+ heapDump.add(new CpuProfileAction(win, MenuStr.CPU_PROFILE_DUMP_RUN, ""+objHash, objHash, objName, TimeUtil.getCurrentTime(serverId), Images.heap, serverId));
+ heapDump.add(new BlockProfileAction(win, MenuStr.BLOCK_PROFILE_DUMP_RUN, ""+objHash, objHash, objName, TimeUtil.getCurrentTime(serverId), Images.heap, serverId));
+ heapDump.add(new MutexProfileAction(win, MenuStr.MUTEX_PROFILE_DUMP_RUN, ""+objHash, objHash, objName, TimeUtil.getCurrentTime(serverId), Images.heap, serverId));
+ }
+ if (server.isAllowAction(GroupPolicyConstants.ALLOW_FILEDUMP)) {
+ MenuManager dumpMgr = new MenuManager(MenuStr.FILEDUMP, MenuStr.FILEDUMP_ID);
+ performanceSnapshot.add(dumpMgr);
+ dumpMgr.add(new OpenCxtmenuDumpFileListAction(win, MenuStr.LIST_DUMP_FILES, objHash, serverId));
+ dumpMgr.add(new Separator());
+// dumpMgr.add(new OpenCxtmenuDumpActiveServiceListAction(MenuStr.DUMP_ACTIVE_SERVICE_LIST, objHash, serverId));
+ dumpMgr.add(new OpenCxtmenuDumpThreadDumpAction(MenuStr.DUMP_GOROUTINE_DUMP, objHash, serverId));
+ dumpMgr.add(new OpenCxtmenuProfileBlockAction(MenuStr.DUMP_BLOCK_PROFILE, objHash, serverId));
+ dumpMgr.add(new OpenCxtmenuProfileMutexAction(MenuStr.DUMP_MUTEX_PROFILE, objHash, serverId));
+// dumpMgr.add(new OpenCxtmenuDumpThreadListAction(MenuStr.DUMP_THREAD_LIST, objHash, serverId));
+// dumpMgr.add(new OpenCxtmenuDumpHeapHistoAction(MenuStr.DUMP_HEAPHISTO, objHash, serverId));
+ }
+ mgr.add(new Separator());
+ MenuManager stackMgr = new MenuManager(MenuStr.STACK_ANALYZER, ImageUtil.getImageDescriptor(Images.page_white_stack), MenuStr.STACK_ANALYZER_ID);
+ mgr.add(stackMgr);
+ stackMgr.add(new TurnOnStackAction(serverId, objHash));
+ stackMgr.add(new TurnOffStackAction(serverId, objHash));
+ stackMgr.add(new Separator());
+ stackMgr.add(new OpenStackDialogAction(serverId, objHash));
+
if (server.isAllowAction(GroupPolicyConstants.ALLOW_CONFIGURE)) {
mgr.add(new Separator());
mgr.add(new OpenAgentConfigureAction(win, MenuStr.CONFIGURE, objHash, serverId));
@@ -386,8 +444,14 @@ public static void addObjectContextMenu(IMenuManager mgr, IWorkbenchWindow win,
if (server.isAllowAction(GroupPolicyConstants.ALLOW_CONFIGURE))
mgr.add(new OpenAgentConfigureAction(win, MenuStr.CONFIGURE, objHash, serverId));
performanceSnapshot.add(new OpenCxtmenuBatchActiveListAction(win, MenuStr.BATCH_ACTIVE_LIST, objHash, objType, serverId));
- }
+ } else {
+ if (objType.equals(CounterConstants.CUBRID_AGENT)) {
+ mgr.add(new Separator());
+ mgr.add(new OpenAgentConfigureAction(win, MenuStr.CONFIGURE, objHash, serverId));
+ }
+ }
}
+
if (server.isAllowAction(GroupPolicyConstants.ALLOW_DEFINEOBJTYPE)) {
if (counterEngine.isUnknownObjectType(objType)) {
mgr.add(new DefineObjectTypeAction(win, serverId, objType, DefineObjectTypeAction.DEFINE_MODE));
@@ -576,6 +640,23 @@ public static void addObjTypeSpecialMenu(IWorkbenchWindow win, IMenuManager mgr,
mgr.add(new OpenTypeSummaryAction(win, serverId, objType));
mgr.add(new OpenRTPairAllAction(win, "File Descriptor", serverId, objType, CounterConstants.JAVA_FD_USAGE));
+ } else if (counterEngine.isChildOf(objType, CounterConstants.FAMILY_GOLANG)) {
+ mgr.add(new Separator());
+// mgr.add(new OpenRTPairAllAction(win, "Heap Memory", serverId, objType, CounterConstants.JAVA_HEAP_TOT_USAGE));
+ mgr.add(new OpenEQViewAction(win, serverId, objType));
+ mgr.add(new OpenVerticalEQViewAction(win, serverId, objType));
+ mgr.add(new OpenActiveServiceListAction(win, objType, Images.thread, serverId));
+// mgr.add(new OpenActiveSpeedAction(win,objType, Images.TYPE_ACTSPEED, serverId));
+ mgr.add(new OpenXLogRealTimeAction(win, MenuStr.XLOG, objType, Images.star, serverId));
+// mgr.add(new OpenTodayServiceCountAction(win, MenuStr.SERVICE_COUNT, objType, CounterConstants.WAS_SERVICE_COUNT, Images.bar, serverId));
+// MenuManager serviceGroupMgr = new MenuManager("Serivce Group", ImageUtil.getImageDescriptor(Images.sum), "scouter.menu.id.javee.servicegroup");
+// mgr.add(serviceGroupMgr);
+// serviceGroupMgr.add(new OpenServiceGroupTPSAction(win, serverId, objType));
+// serviceGroupMgr.add(new OpenServiceGroupElapsedAction(win, serverId, objType));
+// mgr.add(new OpenUniqueTotalVisitorAction(win, serverId, objType));
+// mgr.add(new OpenTypeSummaryAction(win, serverId, objType));
+// mgr.add(new OpenRTPairAllAction(win, "File Descriptor", serverId, objType, CounterConstants.JAVA_FD_USAGE));
+
} else if (counterEngine.isChildOf(objType, CounterConstants.FAMILY_DATASOURCE)) {
mgr.add(new Separator());
mgr.add(new OpenRTPairAllAction2(win, "Pool Chart", serverId, objType, CounterConstants.DATASOURCE_CONN_MAX, CounterConstants.DATASOURCE_CONN_ACTIVE));
@@ -593,6 +674,10 @@ public static void addPastObjTypeSpecialMenu(IWorkbenchWindow win, IMenuManager
mgr.add(new Separator());
mgr.add(new OpenXLogLoadTimeAction(win, objType, Images.transrealtime, serverId, st, et));
mgr.add(new OpenDailyServiceCountAction(win, objType, CounterConstants.WAS_SERVICE_COUNT, Images.TYPE_SERVICE_COUNT, serverId, date));
+ } else if (counterEngine.isChildOf(objType, CounterConstants.FAMILY_GOLANG)) {
+ mgr.add(new Separator());
+ mgr.add(new OpenXLogLoadTimeAction(win, objType, Images.transrealtime, serverId, st, et));
+// mgr.add(new OpenDailyServiceCountAction(win, objType, CounterConstants.WAS_SERVICE_COUNT, Images.TYPE_SERVICE_COUNT, serverId, date));
}
}
}
diff --git a/scouter.client/src/scouter/client/views/ObjectDashboardView.java b/scouter.client/src/scouter/client/views/ObjectDashboardView.java
index c0bf12d1c..d25b3cbe8 100644
--- a/scouter.client/src/scouter/client/views/ObjectDashboardView.java
+++ b/scouter.client/src/scouter/client/views/ObjectDashboardView.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 the original author or authors.
+ * Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,10 +17,6 @@
*/
package scouter.client.views;
-import java.util.ArrayList;
-import java.util.Set;
-import java.util.TreeMap;
-
import org.eclipse.draw2d.IFigure;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -56,7 +52,6 @@
import org.eclipse.zest.layouts.algorithms.RadialLayoutAlgorithm;
import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
-
import scouter.client.Images;
import scouter.client.constants.MenuStr;
import scouter.client.context.actions.OpenCxtmenuActiveServiceListAction;
@@ -68,14 +63,14 @@
import scouter.client.model.DummyObject;
import scouter.client.model.HierarchyObject;
import scouter.client.model.RefreshThread;
-import scouter.client.model.ServerObject;
import scouter.client.model.RefreshThread.Refreshable;
+import scouter.client.model.ServerObject;
import scouter.client.popup.ObjectSelectionDialog;
import scouter.client.server.Server;
import scouter.client.server.ServerManager;
import scouter.client.threads.AlertProxyThread;
-import scouter.client.threads.ObjectSelectManager;
import scouter.client.threads.AlertProxyThread.IAlertListener;
+import scouter.client.threads.ObjectSelectManager;
import scouter.client.threads.ObjectSelectManager.IObjectCheckListener;
import scouter.client.util.DummyAction;
import scouter.client.util.ExUtil;
@@ -87,6 +82,10 @@
import scouter.lang.pack.AlertPack;
import scouter.util.CacheTable;
+import java.util.ArrayList;
+import java.util.Set;
+import java.util.TreeMap;
+
public class ObjectDashboardView extends ViewPart implements Refreshable, IObjectCheckListener, IAlertListener {
public final static String ID = ObjectDashboardView.class.getName();
@@ -209,6 +208,8 @@ public void doubleClick(DoubleClickEvent event) {
CounterEngine counterEngine = server.getCounterEngine();
if (counterEngine.isChildOf(ao.getObjType(), CounterConstants.FAMILY_JAVAEE)) {
new OpenCxtmenuActiveServiceListAction(getSite().getWorkbenchWindow(), MenuStr.ACTIVE_SERVICE_LIST, ao.getObjHash(), ao.getObjType(), ao.getServerId()).run();
+ } else if (counterEngine.isChildOf(ao.getObjType(), CounterConstants.FAMILY_GOLANG)) {
+ new OpenCxtmenuActiveServiceListAction(getSite().getWorkbenchWindow(), MenuStr.ACTIVE_SERVICE_LIST, ao.getObjHash(), ao.getObjType(), ao.getServerId()).run();
}
}
}
diff --git a/scouter.client/src/scouter/client/views/ObjectNavigationView.java b/scouter.client/src/scouter/client/views/ObjectNavigationView.java
index 6ca4fac50..511db7185 100644
--- a/scouter.client/src/scouter/client/views/ObjectNavigationView.java
+++ b/scouter.client/src/scouter/client/views/ObjectNavigationView.java
@@ -779,6 +779,9 @@ private synchronized void makeHierarchyMap() {
}
getObjectList();
for (AgentObject agent : objectList) {
+ if (agent.getObjType().startsWith("z$")) {
+ System.out.println("agent: " + agent);
+ }
int serverId = agent.getServerId();
Server server = ServerManager.getInstance().getServer(serverId);
if (server == null) {
diff --git a/scouter.client/src/scouter/client/xlog/SaveProfileJob.java b/scouter.client/src/scouter/client/xlog/SaveProfileJob.java
index 0f8c78b12..7fa2a7963 100644
--- a/scouter.client/src/scouter/client/xlog/SaveProfileJob.java
+++ b/scouter.client/src/scouter/client/xlog/SaveProfileJob.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 the original author or authors.
+ * Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,13 +17,6 @@
*/
package scouter.client.xlog;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.HashMap;
-
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -33,7 +26,6 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
-
import scouter.client.Images;
import scouter.client.actions.OpenWorkspaceExplorerAction;
import scouter.client.model.TextProxy;
@@ -44,15 +36,22 @@
import scouter.client.util.ExUtil;
import scouter.client.util.RCPUtil;
import scouter.client.util.StepWrapper;
+import scouter.io.DataInputX;
+import scouter.io.DataOutputX;
import scouter.lang.pack.XLogPack;
import scouter.lang.step.Step;
import scouter.lang.step.StepSingle;
import scouter.lang.step.StepSummary;
-import scouter.io.DataInputX;
-import scouter.io.DataOutputX;
import scouter.util.DateUtil;
import scouter.util.SortUtil;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.HashMap;
+
public class SaveProfileJob extends Job{
public static String xLogDirName = "xlog";
@@ -117,7 +116,7 @@ private void checkDir() {
File rootDir = new File(dir);
File[] fs = rootDir.listFiles();
if(fs != null){
- workingDir = dir+"/"+"["+String.format("%03d-", (fs.length+1))+DateUtil.format(date, "HHmmss")+"]"+txid+"_"+service+"/";
+ workingDir = dir+"/"+"_"+String.format("%03d-", (fs.length+1))+DateUtil.format(date, "HHmmss")+"_"+txid+"_"+service+"/";
for(File f : fs){
String dirPath = f.getAbsolutePath();
if(f.isDirectory() && dirPath != null && dirPath.indexOf(txid+"_"+service) != -1){
diff --git a/scouter.common/pom.xml b/scouter.common/pom.xml
index 6d961043f..d493512c6 100644
--- a/scouter.common/pom.xml
+++ b/scouter.common/pom.xml
@@ -4,7 +4,7 @@
io.github.scouter-project
scouter-parent
- 2.10.2
+ 2.15.0
scouter-common
diff --git a/scouter.common/src/main/java/scouter/lang/constants/StatusConstants.java b/scouter.common/src/main/java/scouter/lang/constants/StatusConstants.java
index fb41e66ea..8320f64a8 100644
--- a/scouter.common/src/main/java/scouter/lang/constants/StatusConstants.java
+++ b/scouter.common/src/main/java/scouter/lang/constants/StatusConstants.java
@@ -21,4 +21,11 @@ public class StatusConstants {
public final static String EVENTS_STATEMENTS_SUMMARY_BY_DIGEST = "events_statements_summary_by_digest";
public final static String EVENTS_STATEMENTS_CURRENT = "events_statements_current";
public final static String LOCK_INFO = "lock_info";
-}
\ No newline at end of file
+
+ //cubrid
+ public final static String CUBRID_ACTIVE_DB_LIST = "cubrid_active_db_list";
+ public final static String CUBRID_DB_SERVER_INFO = "cubrid_server_info_";
+ public final static String CUBRID_DB_TRANSACTION_INFO = "cubrid_taransaction_info_";
+ public final static String CUBRID_DB_DUMP_INFO = "cubrid_db_dump_info_";
+}
+
diff --git a/scouter.common/src/main/java/scouter/lang/counters/CounterConstants.java b/scouter.common/src/main/java/scouter/lang/counters/CounterConstants.java
index e440fcddf..37c7393c0 100644
--- a/scouter.common/src/main/java/scouter/lang/counters/CounterConstants.java
+++ b/scouter.common/src/main/java/scouter/lang/counters/CounterConstants.java
@@ -23,12 +23,14 @@ public class CounterConstants {
public final static String FAMILY_HOST = "host";
public final static String FAMILY_JAVAEE = "javaee";
+ public final static String FAMILY_GOLANG = "golang";
public final static String FAMILY_DATABASE = "database";
public final static String FAMILY_DATASOURCE = "datasource";
public final static String FAMILY_TRACING = "tracing";
public final static String FAMILY_REQUEST_PROCESS = "reqproc";
public final static String FAMILY_MARIA = "maria";
public final static String FAMILY_BATCH = "batch";
+ public final static String FAMILY_CUBRID = "cubrid";
public final static String HOST = "host";
public final static String WINDOWS = "windows";
@@ -58,6 +60,8 @@ public class CounterConstants {
public final static String MARIA_DB = "mariadb";
public final static String MARIA_PLUGIN = "mariaplugin";
+ public final static String CUBRID_AGENT = "cubridagent";
+
public final static String WAS_TPS = "TPS";
public final static String WAS_ACTIVE_SPEED = "ActiveSpeed";
public final static String WAS_ELAPSED_TIME = "ElapsedTime";
@@ -81,6 +85,13 @@ public class CounterConstants {
public final static String JAVA_PROCESS_CPU = "ProcCpu";
public final static String JAVA_FD_USAGE = "FdUsage";
+ public final static String GO_GOROUTINE = "Goroutine";
+ public final static String GO_CGO_CALL = "GoCgoCall";
+
+ public final static String GO_GC_COUNT = "GoGcCount";
+ public final static String GO_GC_PAUSE = "GoGcPause";
+ public final static String GO_HEAP_USED = "GoHeapUsed";
+
public final static String REQUESTPROCESS_BYTES_RECEIVED = "BytesReceived";
public final static String REQUESTPROCESS_BYTES_SENT = "BytesSent";
public final static String REQUESTPROCESS_ERROR_COUNT = "ErrorCount";
diff --git a/scouter.common/src/main/java/scouter/lang/counters/CounterEngine.java b/scouter.common/src/main/java/scouter/lang/counters/CounterEngine.java
index 8c0f796a9..782129045 100644
--- a/scouter.common/src/main/java/scouter/lang/counters/CounterEngine.java
+++ b/scouter.common/src/main/java/scouter/lang/counters/CounterEngine.java
@@ -364,7 +364,11 @@ public String getMasterCounter(String objType) {
if (obj == null) {
return null;
}
- return obj.getFamily().getMaster();
+ Family family = obj.getFamily();
+ if (family == null) {
+ return null;
+ }
+ return family.getMaster();
}
public String[] getSortedCounterName(String objType) {
diff --git a/scouter.common/src/main/java/scouter/net/RequestCmd.java b/scouter.common/src/main/java/scouter/net/RequestCmd.java
index e786f55ff..2f77c0d35 100644
--- a/scouter.common/src/main/java/scouter/net/RequestCmd.java
+++ b/scouter.common/src/main/java/scouter/net/RequestCmd.java
@@ -48,11 +48,14 @@ public class RequestCmd {
public static final String OBJECT_THREAD_DUMP = "OBJECT_THREAD_DUMP";
public static final String TRIGGER_ACTIVE_SERVICE_LIST = "TRIGGER_ACTIVE_SERVICE_LIST";
- public static final String TRIGGER_THREAD_DUMP = "TRIGGER_THREAD_DUMP";
+ public static final String TRIGGER_THREAD_DUMP = "TRIGGER_THREAD_DUMP"; //java and golang pprof cpu profile as plain text
public static final String TRIGGER_THREAD_DUMPS_FROM_CONDITIONS = "TRIGGER_THREAD_DUMPS_FROM_CONDITIONS";
public static final String TRIGGER_THREAD_LIST = "TRIGGER_THREAD_LIST";
public static final String TRIGGER_HEAPHISTO = "TRIGGER_HEAPHISTO";
+ public static final String TRIGGER_BLOCK_PROFILE = "TRIGGER_BLOCK_PROFILE"; //golang pprof block profile as plain text
+ public static final String TRIGGER_MUTEX_PROFILE = "TRIGGER_MUTEX_PROFILE"; //golang pprof mutex profile as plain text
+
public static final String TRIGGER_DUMP_REASON = "TRIGGER_DUMP_REASON";
public static final String TRIGGER_DUMP_REASON_TYPE_CPU_EXCEEDED = "TRIGGER_DUMP_REASON_TYPE_CPU_EXCEEDED";
@@ -65,6 +68,10 @@ public class RequestCmd {
public static final String OBJECT_DOWNLOAD_HEAP_DUMP = "OBJECT_DOWNLOAD_HEAP_DUMP";
public static final String OBJECT_DELETE_HEAP_DUMP = "OBJECT_DELETE_HEAP_DUMP";
+ public static final String OBJECT_CALL_CPU_PROFILE = "OBJECT_CALL_CPU_PROFILE"; //golang pprof cpu profile as protobuf
+ public static final String OBJECT_CALL_BLOCK_PROFILE = "OBJECT_CALL_BLOCK_PROFILE"; //golang pprof block profile as protobuf
+ public static final String OBJECT_CALL_MUTEX_PROFILE = "OBJECT_CALL_MUTEX_PROFILE"; //golang pprof mutex profile as protobuf
+
public static final String OBJECT_LIST_REAL_TIME = "OBJECT_LIST_REAL_TIME";
public static final String OBJECT_LIST_LOAD_DATE = "OBJECT_LIST_LOAD_DATE";
public static final String OBJECT_REMOVE_INACTIVE = "OBJECT_REMOVE_INACTIVE";
@@ -311,6 +318,18 @@ public class RequestCmd {
public static final String BATCH_ACTIVE_STACK = "BATCH_ACTIVE_STACK";
public static final String OBJECT_BATCH_ACTIVE_LIST = "OBJECT_BATCH_ACTIVE_LIST";
+ // CUBRID - AGENT
+ public static final String CUBRID_DB_REALTIME_DML = "CUBRID_DB_REALTIME_DML";
+ public static final String CUBRID_DB_REALTIME_STATUS = "CUBRID_DB_REALTIME_STATUS";
+ public static final String CUBRID_ACTIVE_DB_LIST = "CUBRID_ACTIVE_DB_LIST";
+ public static final String CUBRID_DB_SERVER_INFO = "CUBRID_DB_SERVER_INFO";
+ public static final String CUBRID_DB_PERIOD_MULTI_DATA = "CUBRID_DB_PERIOD_MULTI_DATA";
+ public static final String CUBRID_DB_LONG_PERIOD_MULTI_DATA = "CUBRID_DB_LONG_PERIOD_MULTI_DATA";
+ public static final String CUBRID_DB_REALTIME_MULTI_DATA = "CUBRID_DB_REALTIME_MULTI_DATA";
+ public static final String CUBRID_DB_LONG_TRANSACTION_DATA = "CUBRID_DB_LONG_TRANSACTION_DATA";
+ public static final String CUBRID_GET_ALERT_CONFIGURE = "CUBRID_GET_ALERT_CONFIGURE";
+ public static final String CUBRID_SET_ALERT_CONFIGURE = "CUBRID_SET_ALERT_CONFIGURE";
+
protected static Set freeCmdSet = new HashSet();
static {
diff --git a/scouter.common/src/main/java/scouter/util/Hexa32.java b/scouter.common/src/main/java/scouter/util/Hexa32.java
index 5c526e8f8..5ec5900f7 100644
--- a/scouter.common/src/main/java/scouter/util/Hexa32.java
+++ b/scouter.common/src/main/java/scouter/util/Hexa32.java
@@ -67,6 +67,9 @@ public static long toLong32(String str) {
}
public static void main(String[] args) {
+ System.out.println(toString32(792539709424970410L));
+ System.out.println(toString32(-342343233040343034L));
+
System.out.println(Hexa32.toLong32("z6eq8mqkdkpt7c"));
System.out.println(Hexa32.toString32(100000001L));
diff --git a/scouter.common/src/main/java/scouter/util/KeyGen.java b/scouter.common/src/main/java/scouter/util/KeyGen.java
index 59fa0d109..beef29eab 100644
--- a/scouter.common/src/main/java/scouter/util/KeyGen.java
+++ b/scouter.common/src/main/java/scouter/util/KeyGen.java
@@ -20,10 +20,9 @@
import java.util.Random;
-
public final class KeyGen {
private static Random rand = new Random(System.currentTimeMillis());
-
+
public static void setSeed(long seed){
rand.setSeed(seed);
}
@@ -31,4 +30,4 @@ public static long next(){
return rand.nextLong();
}
-}
\ No newline at end of file
+}
diff --git a/scouter.common/src/main/resources/scouter/lang/counters/counters.xml b/scouter.common/src/main/resources/scouter/lang/counters/counters.xml
index 86302eaa1..b650b8941 100644
--- a/scouter.common/src/main/resources/scouter/lang/counters/counters.xml
+++ b/scouter.common/src/main/resources/scouter/lang/counters/counters.xml
@@ -51,6 +51,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -88,6 +101,8 @@
+
+
diff --git a/scouter.deploy/pom.xml b/scouter.deploy/pom.xml
index 2ab4145be..9025384f4 100644
--- a/scouter.deploy/pom.xml
+++ b/scouter.deploy/pom.xml
@@ -4,7 +4,7 @@
io.github.scouter-project
scouter-parent
- 2.10.2
+ 2.15.0
scouter-deploy
diff --git a/scouter.server.boot/pom.xml b/scouter.server.boot/pom.xml
index 735cdbad8..652a90e44 100644
--- a/scouter.server.boot/pom.xml
+++ b/scouter.server.boot/pom.xml
@@ -4,7 +4,7 @@
io.github.scouter-project
scouter-parent
- 2.10.2
+ 2.15.0
scouter-server-boot
diff --git a/scouter.server/pom.xml b/scouter.server/pom.xml
index 4ac188ac6..299e2d7ae 100644
--- a/scouter.server/pom.xml
+++ b/scouter.server/pom.xml
@@ -4,7 +4,7 @@
io.github.scouter-project
scouter-parent
- 2.10.2
+ 2.15.0
scouter-server
@@ -22,12 +22,12 @@
org.scala-lang
scala-library
- 2.11.7
+ 2.11.12
org.scala-lang
scala-reflect
- 2.11.7
+ 2.11.12
io.github.scouter-project
@@ -127,6 +127,7 @@
maven-compiler-plugin
3.1
+ 1.8
1.8
diff --git a/scouter.server/src/main/java/scouter/server/netio/service/ServiceHandlingProxy.java b/scouter.server/src/main/java/scouter/server/netio/service/ServiceHandlingProxy.java
index 40b53919c..cd0470ffb 100644
--- a/scouter.server/src/main/java/scouter/server/netio/service/ServiceHandlingProxy.java
+++ b/scouter.server/src/main/java/scouter/server/netio/service/ServiceHandlingProxy.java
@@ -97,7 +97,6 @@ public static void load() {
public static void process(String cmd, DataInputX in, DataOutputX out, boolean login) {
Invocation handler = handlers.get(cmd);
if (handler != null) {
-// Logger.trace("[ScouterRequestHandler] " + cmd);
handler.exec(in, out, login);
} else {
// Logger.println("no handler " + cmd);
diff --git a/scouter.server/src/main/scala/scouter/server/netio/service/handle/CubridService.scala b/scouter.server/src/main/scala/scouter/server/netio/service/handle/CubridService.scala
new file mode 100755
index 000000000..b722ea03c
--- /dev/null
+++ b/scouter.server/src/main/scala/scouter/server/netio/service/handle/CubridService.scala
@@ -0,0 +1,372 @@
+/*
+ * 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.server.netio.service.handle;
+
+import java.util.ArrayList
+import java.util.HashMap
+import java.util.HashSet
+import scouter.lang.CounterKey
+import scouter.lang.DigestKey
+import scouter.lang.TimeTypeEnum
+import scouter.lang.constants.StatusConstants
+import scouter.lang.pack.MapPack
+import scouter.lang.pack.StatusPack
+import scouter.lang.value.DoubleValue
+import scouter.lang.value.FloatValue
+import scouter.lang.value.MapValue
+import scouter.io.DataInputX
+import scouter.io.DataOutputX
+import scouter.net.TcpFlag
+import scouter.server.core.AgentManager
+import scouter.server.core.cache.CounterCache
+import scouter.server.core.cache.StatusCache
+import scouter.server.db.DailyCounterRD
+import scouter.server.db.StatusRD
+import scouter.server.netio.AgentCall
+import scouter.server.netio.service.anotation.ServiceHandler
+import scouter.util.ArrayUtil
+import scouter.util.CastUtil
+import scouter.util.DateUtil
+import scouter.net.RequestCmd
+import scouter.server.Logger
+import scouter.util.{CastUtil, DateUtil, IntKeyMap, StringUtil}
+import scouter.server.util.TimedSeries
+import scouter.server.db.{ObjectRD, RealtimeCounterRD}
+import scouter.lang.counters.CounterConstants
+import scala.collection.JavaConversions._
+import scouter.util.HashUtil
+import scouter.util.DataUtil
+
+class CubridService {
+ @ServiceHandler(RequestCmd.CUBRID_DB_REALTIME_DML)
+ def realtimeDML(din: DataInputX, dout: DataOutputX, login: Boolean): Unit = {
+ val param = din.readMapPack();
+ val objHashLv = param.getList("objHash");
+ if (objHashLv.size() == 0) {
+ return;
+ }
+ var dbname = "";
+ var select = 0L;
+ var update = 0L;
+ var insert = 0L;
+ var delete = 0L;
+ for (i <- 0 to objHashLv.size()-1) {
+ val objHash = objHashLv.getInt(i);
+ val key1 = new CounterKey(objHash, "num_query_selects", TimeTypeEnum.REALTIME);
+ val v1 = CounterCache.get(key1);
+ if (v1 != null) {
+ select += CastUtil.clong(v1);
+ }
+ val key2 = new CounterKey(objHash, "num_query_updates", TimeTypeEnum.REALTIME);
+ val v2 = CounterCache.get(key2);
+ if (v2 != null) {
+ update += CastUtil.clong(v2);
+ }
+ val key3 = new CounterKey(objHash, "num_query_inserts", TimeTypeEnum.REALTIME);
+ val v3 = CounterCache.get(key3);
+ if (v3 != null) {
+ insert += CastUtil.clong(v3);
+ }
+ val key4 = new CounterKey(objHash, "num_query_deletes", TimeTypeEnum.REALTIME);
+ val v4 = CounterCache.get(key4);
+ if (v4 != null) {
+ delete += CastUtil.clong(v4);
+ }
+ val key5 = new CounterKey(objHash, "db_num", TimeTypeEnum.REALTIME);
+ val v5 = CounterCache.get(key5);
+ if (v5 != null) {
+ dbname += CastUtil.clong(v5);
+ }
+ }
+
+ val value = new MapValue();
+ value.put("dbname", dbname);
+ value.put("select", select);
+ value.put("update", update);
+ value.put("insert", insert);
+ value.put("delete", delete);
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writeValue(value);
+ }
+
+ @ServiceHandler(RequestCmd.CUBRID_ACTIVE_DB_LIST)
+ def realtimeActiveDBList(din: DataInputX, dout: DataOutputX, login: Boolean): Unit = {
+
+ val param = din.readPack().asInstanceOf[MapPack];
+ val objHashLv = param.getList("objHash");
+ val key = param.getText("key");
+ val time = param.getLong("time");
+
+ val date = DateUtil.yyyymmdd(time);
+
+ for (i <- 0 to objHashLv.size()-1) {
+ val objHash = objHashLv.getInt(i);
+ val status = StatusCache.get(objHash, key);
+ if(status != null) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(status);
+ }
+ }
+ }
+
+ @ServiceHandler(RequestCmd.CUBRID_DB_REALTIME_STATUS)
+ def realtimeDMLStatus(din: DataInputX, dout: DataOutputX, login: Boolean): Unit = {
+ val param = din.readPack().asInstanceOf[MapPack];
+ val objHashLv = param.getList("objHash");
+ val key = param.getText("key");
+ val date = param.getText("date");
+ val etime = param.getLong("etime");
+ val stime = param.getLong("stime");
+ val time = param.getLong("time");
+ val objArray = new ArrayList[Int]();
+
+ for (i <- 0 to objHashLv.size() - 1) {
+ val p = new MapPack();
+ val objHash = objHashLv.getInt(i);
+ objArray.add(objHash);
+ }
+
+ val handler = (time: Long, data: Array[Byte]) => {
+ val pk = new DataInputX(data).readPack().asInstanceOf[StatusPack];
+
+ if (objArray.contains(pk.objHash) && pk.key == key) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(pk);
+ return
+ }
+ }
+
+ for (i <- 0 to objArray.size() - 1) {
+ StatusRD.readFromEndTime(date, stime, etime, handler);
+ }
+
+ }
+
+ @ServiceHandler(RequestCmd.CUBRID_DB_SERVER_INFO)
+ def DbServerInfo(din: DataInputX, dout: DataOutputX, login: Boolean): Unit = {
+ val param = din.readPack().asInstanceOf[MapPack];
+ val objHashLv = param.getList("objHash");
+ val key = param.getText("key");
+ val date = param.getText("date");
+ val etime = param.getLong("etime");
+ val stime = param.getLong("stime");
+ val time = param.getLong("time");
+ val objArray = new ArrayList[Int]();
+
+ for (i <- 0 to objHashLv.size() - 1) {
+ val p = new MapPack();
+ val objHash = objHashLv.getInt(i);
+ objArray.add(objHash);
+ }
+
+ val handler = (time: Long, data: Array[Byte]) => {
+ val pk = new DataInputX(data).readPack().asInstanceOf[StatusPack];
+
+ if (objArray.contains(pk.objHash) && pk.key == key) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(pk);
+ return
+ }
+ }
+
+ for (i <- 0 to objHashLv.size() - 1) {
+ StatusRD.readFromEndTime(date, stime, etime, handler);
+ }
+
+ }
+
+ @ServiceHandler(RequestCmd.CUBRID_DB_PERIOD_MULTI_DATA)
+ def realtimeCouterTest(din: DataInputX, dout: DataOutputX, login: Boolean): Unit = {
+ val param = din.readPack().asInstanceOf[MapPack];
+ val objHashLv = param.getList("objHash");
+ val counter = param.getText("counter");
+ val stime = param.getLong("stime");
+ val etime = param.getLong("etime");
+ val date = DateUtil.yyyymmdd(stime);
+ val objectName = param.getText("objName");
+
+ val mapPackMap = new IntKeyMap[MapPack]();
+ for (i <- 0 to objHashLv.size() - 1) {
+ val objHash = objHashLv.getInt(i);
+ val mapPack = new MapPack();
+ mapPack.put("objHash", objHash);
+ val timeLv = mapPack.newList("time");
+ val valueLv = mapPack.newList("value");
+ mapPackMap.put(objHash, mapPack);
+ }
+
+ val handler = (mapValue: MapValue) => {
+ if (mapValue != null) {
+ val objHash = mapValue.getInt(CounterConstants.COMMON_OBJHASH)
+ val time = mapValue.getLong(CounterConstants.COMMON_TIME)
+ val value = mapValue.get(counter)
+ if(value != null) {
+ val curMapPack = mapPackMap.get(objHash)
+ if(curMapPack != null) {
+ curMapPack.getList("time").add(time)
+ curMapPack.getList("value").add(value)
+ }
+ }
+ }
+ }
+
+ RealtimeCounterRD.readBulk(date, stime, etime, handler)
+
+ for (i <- 0 to objHashLv.size() - 1) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ var mpack = mapPackMap.get(objHashLv.getInt(i))
+ dout.writePack(mpack)
+ dout.flush()
+ }
+ }
+
+
+ @ServiceHandler(RequestCmd.CUBRID_DB_REALTIME_MULTI_DATA)
+ def realtimeMultiData(din: DataInputX, dout: DataOutputX, login: Boolean): Unit = {
+ val param = din.readMapPack();
+ val objHashLv = param.getList("objHash");
+ val counter = param.getText("counter");
+
+ if (objHashLv.size() == 0) {
+ return;
+ }
+ var counterData = 0L;
+
+ for (i <- 0 to objHashLv.size()-1) {
+ val objHash = objHashLv.getInt(i);
+ val key1 = new CounterKey(objHash, counter, TimeTypeEnum.REALTIME);
+ val v1 = CounterCache.get(key1);
+ if (v1 != null) {
+ counterData += CastUtil.clong(v1);
+ }
+ }
+
+ val value = new MapValue();
+ value.put(counter, counterData);
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writeValue(value);
+ }
+
+ @ServiceHandler(RequestCmd.CUBRID_DB_LONG_PERIOD_MULTI_DATA)
+ def getPastLongDateAll(din: DataInputX, dout: DataOutputX, login: Boolean) {
+ val param = din.readMapPack();
+ val counter = param.getText("counter");
+ val sDate = param.getText("sDate");
+ val eDate = param.getText("eDate");
+ val objHashLv = param.getList("objHash");
+
+ var stime = DateUtil.yyyymmdd(sDate);
+ var etime = DateUtil.yyyymmdd(eDate) + DateUtil.MILLIS_PER_DAY;
+
+ var date = stime;
+ while (date <= (etime - DateUtil.MILLIS_PER_DAY)) {
+ val d = DateUtil.yyyymmdd(date);
+ for (i <- 0 to ArrayUtil.len(objHashLv) - 1) {
+ val objHash = objHashLv.getInt(i);
+
+ try {
+ val mpack = new MapPack();
+ mpack.put("objHash", objHash);
+ val timeLv = mpack.newList("time");
+ val valueLv = mpack.newList("value");
+
+ val v = DailyCounterRD.getValues(d, new CounterKey(objHash, counter, TimeTypeEnum.FIVE_MIN));
+
+ for (j <- 0 to ArrayUtil.len(v) - 1) {
+ val time = date + DateUtil.MILLIS_PER_MINUTE * 5 * j;
+ timeLv.add(time);
+ valueLv.add(v(j));
+ }
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(mpack);
+ dout.flush();
+ } catch {
+ case e: Throwable =>
+ val op = AgentManager.getAgent(objHash);
+ println(op.objName + " invalid data : " + e.getMessage())
+ e.printStackTrace()
+ }
+ }
+ date += DateUtil.MILLIS_PER_DAY;
+ };
+
+ }
+
+ def getObjName(date: String, objHash: Int): String = {
+ return ObjectRD.getObjName(date, objHash);
+ }
+
+ @ServiceHandler(RequestCmd.CUBRID_DB_LONG_TRANSACTION_DATA)
+ def DbLongTransactionInfo(din: DataInputX, dout: DataOutputX, login: Boolean): Unit = {
+ val param = din.readPack().asInstanceOf[MapPack];
+ val objHashLv = param.getList("objHash");
+ val key = param.getText("key");
+ val date = param.getText("date");
+ val etime = param.getLong("etime");
+ val stime = param.getLong("stime");
+ val time = param.getLong("time");
+ val objArray = new ArrayList[Int]();
+
+ for (i <- 0 to objHashLv.size() - 1) {
+ val p = new MapPack();
+ val objHash = objHashLv.getInt(i);
+ objArray.add(objHash);
+ }
+
+ val handler = (time: Long, data: Array[Byte]) => {
+ val pk = new DataInputX(data).readPack().asInstanceOf[StatusPack];
+
+ if (objArray.contains(pk.objHash) && pk.key == key) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(pk);
+ return
+ }
+ }
+
+ for (i <- 0 to objHashLv.size() - 1) {
+ StatusRD.readFromEndTime(date, stime, etime, handler);
+ }
+
+ }
+
+ @ServiceHandler(RequestCmd.CUBRID_GET_ALERT_CONFIGURE)
+ def setConfigureAgent(din: DataInputX, dout: DataOutputX, login: Boolean) {
+ val param = din.readPack().asInstanceOf[MapPack];
+ val objHash = param.getInt("objHash");
+ val o = AgentManager.getAgent(objHash);
+ val p = AgentCall.call(o, RequestCmd.CUBRID_GET_ALERT_CONFIGURE, param);
+ if (p != null) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(p);
+ }
+ }
+
+ @ServiceHandler(RequestCmd.CUBRID_SET_ALERT_CONFIGURE)
+ def listConfigureWas(din: DataInputX, dout: DataOutputX, login: Boolean) {
+ val param = din.readPack().asInstanceOf[MapPack];
+ val objHash = param.getInt("objHash");
+ val o = AgentManager.getAgent(objHash);
+ val p = AgentCall.call(o, RequestCmd.CUBRID_SET_ALERT_CONFIGURE, param);
+ if (p != null) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(p);
+ }
+ }
+
+
+}
+
diff --git a/scouter.server/src/main/scala/scouter/server/netio/service/handle/DumpService.scala b/scouter.server/src/main/scala/scouter/server/netio/service/handle/DumpService.scala
index 36fff1450..a926da231 100644
--- a/scouter.server/src/main/scala/scouter/server/netio/service/handle/DumpService.scala
+++ b/scouter.server/src/main/scala/scouter/server/netio/service/handle/DumpService.scala
@@ -79,6 +79,30 @@ class DumpService {
}
}
+ @ServiceHandler(RequestCmd.TRIGGER_BLOCK_PROFILE)
+ def triggerBlockProfile(din: DataInputX, dout: DataOutputX, login: Boolean) {
+ val param = din.readMapPack();
+ val objHash = param.getInt("objHash");
+ val o = AgentManager.getAgent(objHash);
+ val p = AgentCall.call(o, RequestCmd.TRIGGER_BLOCK_PROFILE, param);
+ if (p != null) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(p);
+ }
+ }
+
+ @ServiceHandler(RequestCmd.TRIGGER_MUTEX_PROFILE)
+ def triggerMutexrofile(din: DataInputX, dout: DataOutputX, login: Boolean) {
+ val param = din.readMapPack();
+ val objHash = param.getInt("objHash");
+ val o = AgentManager.getAgent(objHash);
+ val p = AgentCall.call(o, RequestCmd.TRIGGER_MUTEX_PROFILE, param);
+ if (p != null) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(p);
+ }
+ }
+
@ServiceHandler(RequestCmd.OBJECT_DUMP_FILE_LIST)
def getDumpFileList(din: DataInputX, dout: DataOutputX, login: Boolean) {
val param = din.readMapPack();
@@ -125,4 +149,4 @@ class DumpService {
dout.writePack(p);
}
}
-}
\ No newline at end of file
+}
diff --git a/scouter.server/src/main/scala/scouter/server/netio/service/handle/HeapDumpService.scala b/scouter.server/src/main/scala/scouter/server/netio/service/handle/HeapDumpService.scala
index f0d3807ad..bbbf7d080 100644
--- a/scouter.server/src/main/scala/scouter/server/netio/service/handle/HeapDumpService.scala
+++ b/scouter.server/src/main/scala/scouter/server/netio/service/handle/HeapDumpService.scala
@@ -81,4 +81,41 @@ class HeapDumpService {
dout.writePack(mpack);
}
}
-}
\ No newline at end of file
+
+ @ServiceHandler(RequestCmd.OBJECT_CALL_BLOCK_PROFILE)
+ def callBlockProfile(din: DataInputX, dout: DataOutputX, login: Boolean) {
+ val param = din.readMapPack();
+ val objHash = param.getInt("objHash");
+ val o = AgentManager.getAgent(objHash);
+ val mpack = AgentCall.call(o, RequestCmd.OBJECT_CALL_BLOCK_PROFILE, param);
+ if (mpack != null) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(mpack);
+ }
+ }
+
+ @ServiceHandler(RequestCmd.OBJECT_CALL_MUTEX_PROFILE)
+ def callMutexProfile(din: DataInputX, dout: DataOutputX, login: Boolean) {
+ val param = din.readMapPack();
+ val objHash = param.getInt("objHash");
+ val o = AgentManager.getAgent(objHash);
+ val mpack = AgentCall.call(o, RequestCmd.OBJECT_CALL_MUTEX_PROFILE, param);
+ if (mpack != null) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(mpack);
+ }
+ }
+
+ @ServiceHandler(RequestCmd.OBJECT_CALL_CPU_PROFILE)
+ def callCpuProfile(din: DataInputX, dout: DataOutputX, login: Boolean) {
+ val param = din.readMapPack();
+ val objHash = param.getInt("objHash");
+ val o = AgentManager.getAgent(objHash);
+ val mpack = AgentCall.call(o, RequestCmd.OBJECT_CALL_CPU_PROFILE, param);
+ if (mpack != null) {
+ dout.writeByte(TcpFlag.HasNEXT);
+ dout.writePack(mpack);
+ }
+ }
+
+}
diff --git a/scouter.webapp/pom.xml b/scouter.webapp/pom.xml
index 223bb65c3..d3de9d115 100644
--- a/scouter.webapp/pom.xml
+++ b/scouter.webapp/pom.xml
@@ -5,7 +5,7 @@
io.github.scouter-project
scouter-parent
- 2.10.2
+ 2.15.0
4.0.0