Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
b39f00a5
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b39f00a5
编写于
8月 18, 2016
作者:
A
ascrutae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
将所有的线程改为守护线程
上级
4679e26d
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
73 addition
and
58 deletion
+73
-58
skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/AlarmMessageProcessThread.java
...com/a/eye/skywalking/alarm/AlarmMessageProcessThread.java
+1
-0
skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/UserInfoCoordinator.java
.../java/com/a/eye/skywalking/alarm/UserInfoCoordinator.java
+1
-0
skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/UsersChangedDetectionThread.java
...m/a/eye/skywalking/alarm/UsersChangedDetectionThread.java
+4
-0
skywalking-collector/skywalking-api/src/main/java/com/a/eye/skywalking/buffer/BufferGroup.java
...rc/main/java/com/a/eye/skywalking/buffer/BufferGroup.java
+1
-0
skywalking-collector/skywalking-api/src/main/java/com/a/eye/skywalking/selfexamination/SDKHealthCollector.java
.../a/eye/skywalking/selfexamination/SDKHealthCollector.java
+1
-0
skywalking-collector/skywalking-api/src/main/java/com/a/eye/skywalking/sender/DataSenderFactoryWithBalance.java
...a/eye/skywalking/sender/DataSenderFactoryWithBalance.java
+1
-0
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/buffer/AppendEOFFlagThread.java
...a/eye/skywalking/reciever/buffer/AppendEOFFlagThread.java
+1
-0
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/buffer/DataBufferThread.java
...om/a/eye/skywalking/reciever/buffer/DataBufferThread.java
+1
-0
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/peresistent/PersistenceThread.java
...ye/skywalking/reciever/peresistent/PersistenceThread.java
+1
-0
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/peresistent/RegisterPersistenceThread.java
...lking/reciever/peresistent/RegisterPersistenceThread.java
+1
-0
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/processor/ackspan/alarm/AlarmRedisConnector.java
...reciever/processor/ackspan/alarm/AlarmRedisConnector.java
+1
-0
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/selfexamination/ServerHealthCollector.java
...lking/reciever/selfexamination/ServerHealthCollector.java
+59
-58
未找到文件。
skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/AlarmMessageProcessThread.java
浏览文件 @
b39f00a5
...
...
@@ -37,6 +37,7 @@ public class AlarmMessageProcessThread extends Thread {
public
AlarmMessageProcessThread
()
{
// 初始化生成ThreadId
threadId
=
UUID
.
randomUUID
().
toString
();
this
.
setDaemon
(
true
);
}
@Override
...
...
skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/UserInfoCoordinator.java
浏览文件 @
b39f00a5
...
...
@@ -31,6 +31,7 @@ public class UserInfoCoordinator extends Thread {
private
boolean
isCoordinator
=
false
;
public
UserInfoCoordinator
()
{
this
.
setDaemon
(
true
);
}
@Override
...
...
skywalking-alarm/src/main/java/com/a/eye/skywalking/alarm/UsersChangedDetectionThread.java
浏览文件 @
b39f00a5
...
...
@@ -19,6 +19,10 @@ public class UsersChangedDetectionThread extends Thread {
private
String
userIdsEncryptedStr
;
private
Logger
logger
=
LogManager
.
getLogger
(
UsersChangedDetectionThread
.
class
);
public
UsersChangedDetectionThread
()
{
this
.
setDaemon
(
true
);
}
public
void
run
()
{
while
(
true
)
{
try
{
...
...
skywalking-collector/skywalking-api/src/main/java/com/a/eye/skywalking/buffer/BufferGroup.java
浏览文件 @
b39f00a5
...
...
@@ -61,6 +61,7 @@ public class BufferGroup {
super
(
"ConsumerWorker"
);
this
.
start
=
start
;
this
.
end
=
end
;
this
.
setDaemon
(
true
);
}
@Override
...
...
skywalking-collector/skywalking-api/src/main/java/com/a/eye/skywalking/selfexamination/SDKHealthCollector.java
浏览文件 @
b39f00a5
...
...
@@ -18,6 +18,7 @@ public class SDKHealthCollector extends Thread {
private
SDKHealthCollector
()
{
super
(
"HealthCollector"
);
this
.
setDaemon
(
true
);
}
public
static
void
init
()
{
...
...
skywalking-collector/skywalking-api/src/main/java/com/a/eye/skywalking/sender/DataSenderFactoryWithBalance.java
浏览文件 @
b39f00a5
...
...
@@ -102,6 +102,7 @@ public class DataSenderFactoryWithBalance {
public
static
class
DataSenderChecker
extends
Thread
{
public
DataSenderChecker
()
{
super
(
"Data-Sender-Checker"
);
this
.
setDaemon
(
true
);
}
@Override
...
...
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/buffer/AppendEOFFlagThread.java
浏览文件 @
b39f00a5
...
...
@@ -19,6 +19,7 @@ class AppendEOFFlagThread extends Thread {
super
(
"AppendEOFFlagThread"
);
this
.
dataBufferFiles
=
dataBufferFiles
;
this
.
countDownLatch
=
countDownLatch
;
this
.
setDaemon
(
true
);
}
@Override
...
...
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/buffer/DataBufferThread.java
浏览文件 @
b39f00a5
...
...
@@ -26,6 +26,7 @@ public class DataBufferThread extends Thread {
public
DataBufferThread
(
int
threadIdx
)
{
super
(
"DataBufferThread_"
+
threadIdx
);
this
.
setDaemon
(
true
);
}
@Override
...
...
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/peresistent/PersistenceThread.java
浏览文件 @
b39f00a5
...
...
@@ -24,6 +24,7 @@ public class PersistenceThread extends Thread {
public
PersistenceThread
(
int
trdIndex
)
{
super
(
"PersistentThread"
+
trdIndex
);
this
.
setDaemon
(
true
);
}
@Override
...
...
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/peresistent/RegisterPersistenceThread.java
浏览文件 @
b39f00a5
...
...
@@ -30,6 +30,7 @@ public class RegisterPersistenceThread extends Thread {
Config
.
RegisterPersistence
.
REGISTER_FILE_PARENT_DIRECTORY
,
Config
.
RegisterPersistence
.
REGISTER_FILE_NAME
);
bakOffsetFile
=
new
File
(
Config
.
RegisterPersistence
.
REGISTER_FILE_PARENT_DIRECTORY
,
Config
.
RegisterPersistence
.
REGISTER_BAK_FILE_NAME
);
this
.
setDaemon
(
true
);
}
@Override
...
...
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/processor/ackspan/alarm/AlarmRedisConnector.java
浏览文件 @
b39f00a5
...
...
@@ -57,6 +57,7 @@ public class AlarmRedisConnector {
Config
.
Alarm
.
ALARM_OFF_FLAG
=
true
;
}
}
this
.
setDaemon
(
true
);
}
private
RedisInspector
connect
()
{
...
...
skywalking-server/src/main/java/com/a/eye/skywalking/reciever/selfexamination/ServerHealthCollector.java
浏览文件 @
b39f00a5
...
...
@@ -10,66 +10,67 @@ import org.apache.logging.log4j.LogManager;
import
org.apache.logging.log4j.Logger
;
public
class
ServerHealthCollector
extends
Thread
{
private
Logger
logger
=
LogManager
.
getLogger
(
ServerHealthCollector
.
class
);
private
Logger
logger
=
LogManager
.
getLogger
(
ServerHealthCollector
.
class
);
private
static
Map
<
String
,
ServerHeathReading
>
heathReadings
=
new
ConcurrentHashMap
<
String
,
ServerHeathReading
>();
private
static
Map
<
String
,
ServerHeathReading
>
heathReadings
=
new
ConcurrentHashMap
<
String
,
ServerHeathReading
>();
private
ServerHealthCollector
(){
super
(
"ServerHealthCollector"
);
}
public
static
void
init
(){
new
ServerHealthCollector
().
start
();
}
public
static
ServerHeathReading
getCurrentHeathReading
(
String
extraId
)
{
String
id
=
getId
(
extraId
);
if
(!
heathReadings
.
containsKey
(
id
))
{
synchronized
(
heathReadings
)
{
if
(!
heathReadings
.
containsKey
(
id
))
{
if
(
heathReadings
.
keySet
().
size
()
>
5000
){
throw
new
RuntimeException
(
"use ServerHealthCollector illegal. There is an overflow trend of Server Health Collector Report Data."
);
}
heathReadings
.
put
(
id
,
new
ServerHeathReading
(
id
));
}
}
}
return
heathReadings
.
get
(
id
);
}
private
ServerHealthCollector
()
{
super
(
"ServerHealthCollector"
);
this
.
setDaemon
(
true
);
}
private
static
String
getId
(
String
extraId
)
{
return
"SkyWalkingServer,M:"
+
MachineUtil
.
getHostDesc
()
+
",P:"
+
MachineUtil
.
getProcessNo
()
+
",T:"
+
Thread
.
currentThread
().
getName
()
+
"("
+
Thread
.
currentThread
().
getId
()
+
")"
+
(
extraId
==
null
?
""
:
",extra:"
+
extraId
);
}
public
static
void
init
()
{
new
ServerHealthCollector
().
start
();
}
@Override
public
void
run
()
{
while
(
true
)
{
try
{
Map
<
String
,
ServerHeathReading
>
heathReadingsSnapshot
=
heathReadings
;
heathReadings
=
new
ConcurrentHashMap
<
String
,
ServerHeathReading
>();
String
[]
keyList
=
heathReadingsSnapshot
.
keySet
().
toArray
(
new
String
[
0
]);
Arrays
.
sort
(
keyList
);
StringBuilder
log
=
new
StringBuilder
();
log
.
append
(
"\n---------Server Health Collector Report---------\n"
);
for
(
String
key
:
keyList
){
log
.
append
(
heathReadingsSnapshot
.
get
(
key
)).
append
(
"\n"
);
}
log
.
append
(
"------------------------------------------------\n"
);
logger
.
info
(
log
);
try
{
Thread
.
sleep
(
Config
.
HealthCollector
.
REPORT_INTERVAL
);
}
catch
(
InterruptedException
e
)
{
logger
.
warn
(
"sleep error."
,
e
);
}
}
catch
(
Throwable
t
)
{
logger
.
error
(
"ServerHealthCollector report error."
,
t
);
}
}
}
public
static
ServerHeathReading
getCurrentHeathReading
(
String
extraId
)
{
String
id
=
getId
(
extraId
);
if
(!
heathReadings
.
containsKey
(
id
))
{
synchronized
(
heathReadings
)
{
if
(!
heathReadings
.
containsKey
(
id
))
{
if
(
heathReadings
.
keySet
().
size
()
>
5000
)
{
throw
new
RuntimeException
(
"use ServerHealthCollector illegal. There is an overflow trend of Server Health Collector Report Data."
);
}
heathReadings
.
put
(
id
,
new
ServerHeathReading
(
id
));
}
}
}
return
heathReadings
.
get
(
id
);
}
private
static
String
getId
(
String
extraId
)
{
return
"SkyWalkingServer,M:"
+
MachineUtil
.
getHostDesc
()
+
",P:"
+
MachineUtil
.
getProcessNo
()
+
",T:"
+
Thread
.
currentThread
().
getName
()
+
"("
+
Thread
.
currentThread
().
getId
()
+
")"
+
(
extraId
==
null
?
""
:
",extra:"
+
extraId
);
}
@Override
public
void
run
()
{
while
(
true
)
{
try
{
Map
<
String
,
ServerHeathReading
>
heathReadingsSnapshot
=
heathReadings
;
heathReadings
=
new
ConcurrentHashMap
<
String
,
ServerHeathReading
>();
String
[]
keyList
=
heathReadingsSnapshot
.
keySet
().
toArray
(
new
String
[
0
]);
Arrays
.
sort
(
keyList
);
StringBuilder
log
=
new
StringBuilder
();
log
.
append
(
"\n---------Server Health Collector Report---------\n"
);
for
(
String
key
:
keyList
)
{
log
.
append
(
heathReadingsSnapshot
.
get
(
key
)).
append
(
"\n"
);
}
log
.
append
(
"------------------------------------------------\n"
);
logger
.
info
(
log
);
try
{
Thread
.
sleep
(
Config
.
HealthCollector
.
REPORT_INTERVAL
);
}
catch
(
InterruptedException
e
)
{
logger
.
warn
(
"sleep error."
,
e
);
}
}
catch
(
Throwable
t
)
{
logger
.
error
(
"ServerHealthCollector report error."
,
t
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录