Skip to content

Commit 0261b3f

Browse files
authored
Merge pull request #286 from scouter-project/master
Merge for release
2 parents 03f10e8 + 1eaafdd commit 0261b3f

File tree

81 files changed

+2869
-563
lines changed

Some content is hidden

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

81 files changed

+2869
-563
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ Session.vim
4848
.netrwhist
4949
*~
5050

51+
### Eclipse template
52+
.metadata
53+
.settings
54+
5155
### JetBrains template
5256
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
5357

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
![Englsh](https://img.shields.io/badge/language-English-red.svg) [![Korean](https://img.shields.io/badge/language-Korean-blue.svg)](README_kr.md)
44

5-
## Open Source S/W Application Performance Monitoring
5+
## Application Performance Monitoring for Open Source S/Ws.
66

7-
SCOUTER is an open source APM and a database monitoring tool.
8-
APM means application performance monitoring or application performance management.
7+
SCOUTER is an open source APM line new relic and appdynamics.
8+
(APM means application performance monitoring or application performance management.)
99

1010
- Monitoring target (currently)
11-
- Opensource WAS - Tomcat, JBoss, Resin ...
12-
- Opensource DB - MariaDB(on closed beta testing now)
11+
- Java application - Web applications (on Tomcat, JBoss, Resin...), Standalone java applications
12+
- OS - Linux, Windows, Unix
1313

14-
15-
- Monitoring target (hopeful with every contributor)
16-
- Nodejs, Redis, MongoDB, PostgreSQL, Apach HTTPD, nginX, php ...
14+
- Monitoring target (to-be : hopeful with every contributor)
15+
- Nodejs, Redis, Apach HTTPD, nginX, php ...
1716

1817
![Screen](./scouter.document/img/main/dashboard-sample-1.png)
1918

README_kr.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44

55
## 오픈소스 S/W 어플리케이션 성능 모니터링
66

7-
APM은 Application performance montoring 또는 application performance management를 의미하고 SCOUTER는 오픈소스 APM 도구로서 Java, WAS에 대한 모니터링 및 DB Agent를 통해 오픈소스 DB 모니터링 기능을 제공한다.
7+
SCOUTER는 오픈소스 APM 도구로서 Java, WAS에 대한 모니터링 모니터링 기능을 제공한다.
8+
- **APM** : Application performance montoring / application performance management
89

910
기업용 IT는 상용 서비스를 기반으로 진화하여 왔다. 그러나 이제는 점점 더 오픈 소스 기반의 시스템 구축이 늘어나고 있다. 오픈소스 기반의 시스템을 구축할때 성능 관리 또한 같이 고려 되어야하는데 오픈 소스인 Scouter는 가장 훌륭한 선택이 될 것이다.
1011

11-
- 모니터링 대상
12-
- 오픈소스 WAS - Tomcat, JBoss, Resin ...
13-
- 오픈소스 DB - MariaDB (클로즈 베타 테스트 진행중)
12+
- 모니터링 대상 (현재)
13+
- Java application - Web application (on Tomcat, JBoss, Resin ...), Standalone java application
14+
- OS - LInux, Windows, Unix
15+
16+
- 모니터링 대상 (TOBE)
17+
- Nodejs, Redis, Apach HTTPD, nginX, php ...
18+
1419

1520
![Screen](./scouter.document/img/main/dashboard-sample-1.png)
1621

scouter.agent.batch/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ private void apply() {
304304
this.sfa_dump_dir = dir;
305305
this.sfa_dump_header_exists = getBoolean("sfa_dump_header_exists", true);
306306
}
307-
308307
this.sfa_dump_send_elapsed_ms = getLong("sfa_dump_send_elapsed_ms", 30000L);
309308
this.batch_log_send_elapsed_ms = getLong("batch_log_send_elapsed_ms", 30000L);
310309

@@ -321,9 +320,8 @@ private void apply() {
321320
this.net_collector_tcp_so_timeout_ms = getInt("net_collector_tcp_so_timeout_ms", 60000);
322321

323322
this.net_local_udp_port = getInt("net_local_udp_port", NetConstants.LOCAL_UDP_PORT);
324-
this.net_tcp_stack_session_count = getInt("net_tcp_stack_session_count", 1);
325-
326-
323+
this.net_tcp_stack_session_count = getInt("net_tcp_stack_session_count", 1, 1);
324+
327325
this.sql_enabled = getBoolean("sql_enabled", true);
328326
this.hook_jdbc_pstmt_classes = getValue("hook_jdbc_pstmt_classes", "");
329327
this.hook_jdbc_stmt_classes = getValue("hook_jdbc_stmt_classes", "");
@@ -333,10 +331,11 @@ private void apply() {
333331
this._log_asm_enabled = getBoolean("_log_asm_enabled", false);
334332
this.obj_type_inherit_to_child_enabled = getBoolean("obj_type_inherit_to_child_enabled", false);
335333

336-
this.log_dir = getValue("log_dir", "");
334+
this.log_dir = getValue("log_dir", ".");
337335
this.log_rotation_enabled = getBoolean("log_rotation_enabled", true);
338-
this.log_keep_days = getInt("log_keep_days", 7);
339-
this._trace = getBoolean("_trace", false);
336+
this.log_keep_days = getInt("log_keep_days", 7, 1);
337+
338+
this._trace = getBoolean("_trace", false);
340339
this._trace_use_logger = getBoolean("_trace_use_logger", false);
341340
this.log_ignore_set = getStringSet("mgr_log_ignore_ids", ",");
342341

scouter.agent.batch/src/scouter/agent/batch/Main.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2016 the original author or authors.
3+
* @https://github.com/scouter-project/scouter
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
117
package scouter.agent.batch;
218

319
import java.io.File;
@@ -8,6 +24,7 @@
824
import scouter.agent.batch.netio.data.net.UdpLocalServer;
925
import scouter.agent.batch.netio.request.ReqestHandlingProxy;
1026
import scouter.agent.batch.netio.service.net.TcpRequestMgr;
27+
import scouter.agent.batch.task.LogMonitor;
1128
import scouter.agent.batch.task.StatusSender;
1229
import scouter.lang.pack.MapPack;
1330
import scouter.lang.pack.ObjectPack;
@@ -42,7 +59,9 @@ public static void main(String[] args) {
4259
exit.deleteOnExit();
4360
long startTime = System.currentTimeMillis();
4461
long currentTime;
45-
62+
63+
LogMonitor.getInstance();
64+
4665
StatusSender statusSender = new StatusSender();
4766
while (true) {
4867
currentTime = System.currentTimeMillis();

scouter.agent.batch/src/scouter/agent/batch/netio/data/net/BatchNetFlag.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2016 the original author or authors.
3+
* @https://github.com/scouter-project/scouter
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
117
package scouter.agent.batch.netio.data.net;
218

319
public class BatchNetFlag {

scouter.agent.batch/src/scouter/agent/batch/netio/data/net/TCPStackZipWorker.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2016 the original author or authors.
3+
* @https://github.com/scouter-project/scouter
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
117
package scouter.agent.batch.netio.data.net;
218

319
import java.io.BufferedInputStream;

scouter.agent.batch/src/scouter/agent/batch/netio/data/net/TcpAgentReqMgr.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2016 the original author or authors.
3+
* @https://github.com/scouter-project/scouter
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
117
package scouter.agent.batch.netio.data.net;
218

319
import java.io.File;

scouter.agent.batch/src/scouter/agent/batch/netio/data/net/UdpLocalServer.java

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2016 the original author or authors.
3+
* @https://github.com/scouter-project/scouter
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
117
package scouter.agent.batch.netio.data.net;
218

319
import java.net.DatagramPacket;
@@ -11,6 +27,11 @@
1127
public class UdpLocalServer extends Thread{
1228
private static UdpLocalServer instance;
1329

30+
private int days = 0;
31+
private int startBatchs = 0;
32+
private int endBatchs = 0;
33+
private int endNoSignalBatchs = 0;
34+
1435
public static synchronized UdpLocalServer getInstance() {
1536
if (instance == null) {
1637
instance = new UdpLocalServer();
@@ -58,12 +79,41 @@ public void run(){
5879
}
5980
}
6081

82+
public int getStartBatchs(){
83+
return startBatchs;
84+
}
85+
86+
public int getEndBatchs(){
87+
return endBatchs;
88+
}
89+
90+
public int getEndNoSignalBatchs(){
91+
return endNoSignalBatchs;
92+
}
93+
94+
public void addEndNoSignalBatchs(){
95+
checkDays();
96+
endNoSignalBatchs++;
97+
}
98+
99+
private void checkDays(){
100+
int currentDays = (int)(System.currentTimeMillis() / 86400000L);
101+
if(currentDays != days){
102+
startBatchs = endBatchs = endNoSignalBatchs = 0;
103+
days = currentDays;
104+
}
105+
}
106+
61107
private void processRunningInfo(byte [] data){
62108
DataInputX input = new DataInputX(data);
63109
try{
64110
MapPack mapPack = new MapPack();
65111
mapPack.read(input);
66112
String key = new StringBuilder(50).append(mapPack.getText("batchJobId")).append('-').append(mapPack.getLong("pID")).append('-').append(mapPack.getLong("startTime")).toString();
113+
checkDays();
114+
if(!Main.batchMap.containsKey(key)){
115+
startBatchs++;
116+
}
67117
Main.batchMap.put(key, mapPack);
68118
}catch(Exception ex){
69119
ex.printStackTrace();
@@ -74,9 +124,11 @@ private void processEndInfo(byte [] data){
74124
DataInputX input = new DataInputX(data);
75125
try{
76126
String key = new StringBuilder(50).append(input.readText()).append('-').append(input.readInt()).append('-').append(input.readLong()).toString();
127+
checkDays();
128+
endBatchs++;
77129
Main.batchMap.remove(key);
78130
}catch(Exception ex){
79131
ex.printStackTrace();
80-
}
132+
}
81133
}
82134
}

0 commit comments

Comments
 (0)