Merge branches 'master' and 'master' of https://github.com/wu-sheng/sky-walking
* 'master' of https://github.com/wu-sheng/sky-walking: 增加授权文件的初始化脚本 将所有的线程改为守护线程 修复Dubbo的viewpoint * 'master' of https://github.com/wu-sheng/sky-walking: 增加授权文件的初始化脚本 将所有的线程改为守护线程 修复Dubbo的viewpoint
This commit is contained in:
commit
e60469b121
|
|
@ -37,6 +37,7 @@ public class AlarmMessageProcessThread extends Thread {
|
|||
public AlarmMessageProcessThread() {
|
||||
// 初始化生成ThreadId
|
||||
threadId = UUID.randomUUID().toString();
|
||||
this.setDaemon(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ public class UserInfoCoordinator extends Thread {
|
|||
private boolean isCoordinator = false;
|
||||
|
||||
public UserInfoCoordinator() {
|
||||
this.setDaemon(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ public class HBaseTableMetaData {
|
|||
* @author wusheng
|
||||
*/
|
||||
public final static class TABLE_CALL_CHAIN {
|
||||
public static final String TABLE_NAME = "sw-call-chain";
|
||||
public static final String TABLE_NAME = "trace-data";
|
||||
|
||||
public static final String FAMILY_NAME = "call-chain";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ public class BufferGroup {
|
|||
super("ConsumerWorker");
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.setDaemon(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public class SDKHealthCollector extends Thread {
|
|||
|
||||
private SDKHealthCollector() {
|
||||
super("HealthCollector");
|
||||
this.setDaemon(true);
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ public class DataSenderFactoryWithBalance {
|
|||
public static class DataSenderChecker extends Thread {
|
||||
public DataSenderChecker() {
|
||||
super("Data-Sender-Checker");
|
||||
this.setDaemon(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ public class MonitorFilterInterceptor implements InstanceMethodsAroundIntercepto
|
|||
boolean isConsumer = rpcContext.isConsumerSide();
|
||||
context.set("isConsumer", isConsumer);
|
||||
if (isConsumer) {
|
||||
ContextData
|
||||
contextData = new RPCClientInvokeMonitor().beforeInvoke(createIdentification(invoker, invocation));
|
||||
ContextData contextData =
|
||||
new RPCClientInvokeMonitor().beforeInvoke(createIdentification(invoker, invocation, true));
|
||||
String contextDataStr = contextData.toString();
|
||||
|
||||
//追加参数
|
||||
|
|
@ -72,7 +72,7 @@ public class MonitorFilterInterceptor implements InstanceMethodsAroundIntercepto
|
|||
contextData = new ContextData(contextDataStr);
|
||||
}
|
||||
|
||||
new RPCServerInvokeMonitor().beforeInvoke(contextData, createIdentification(invoker, invocation));
|
||||
new RPCServerInvokeMonitor().beforeInvoke(contextData, createIdentification(invoker, invocation, false));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -85,9 +85,9 @@ public class MonitorFilterInterceptor implements InstanceMethodsAroundIntercepto
|
|||
dealException(result.getException(), context);
|
||||
}
|
||||
|
||||
if (isConsumer(context)){
|
||||
if (isConsumer(context)) {
|
||||
new RPCClientInvokeMonitor().afterInvoke();
|
||||
}else{
|
||||
} else {
|
||||
new RPCServerInvokeMonitor().afterInvoke();
|
||||
}
|
||||
|
||||
|
|
@ -95,25 +95,31 @@ public class MonitorFilterInterceptor implements InstanceMethodsAroundIntercepto
|
|||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(Throwable t, EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext) {
|
||||
public void handleMethodException(Throwable t, EnhancedClassInstanceContext context,
|
||||
InstanceMethodInvokeContext interceptorContext) {
|
||||
dealException(t, context);
|
||||
}
|
||||
|
||||
|
||||
private boolean isConsumer(EnhancedClassInstanceContext context){
|
||||
private boolean isConsumer(EnhancedClassInstanceContext context) {
|
||||
return (boolean) context.get("isConsumer");
|
||||
}
|
||||
|
||||
private void dealException(Throwable t, EnhancedClassInstanceContext context) {
|
||||
if (isConsumer(context)) {
|
||||
new RPCClientInvokeMonitor().occurException(t);
|
||||
new RPCClientInvokeMonitor().occurException(t);
|
||||
} else {
|
||||
new RPCServerInvokeMonitor().occurException(t);
|
||||
}
|
||||
}
|
||||
|
||||
private static Identification createIdentification(Invoker<?> invoker, Invocation invocation) {
|
||||
private static Identification createIdentification(Invoker<?> invoker, Invocation invocation, boolean isConsumer) {
|
||||
StringBuilder viewPoint = new StringBuilder();
|
||||
if (isConsumer) {
|
||||
viewPoint.append("comsumer:");
|
||||
} else {
|
||||
viewPoint.append("provider:");
|
||||
}
|
||||
viewPoint.append(invoker.getUrl().getProtocol() + "://");
|
||||
viewPoint.append(invoker.getUrl().getHost());
|
||||
viewPoint.append(":" + invoker.getUrl().getPort());
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class AppendEOFFlagThread extends Thread {
|
|||
super("AppendEOFFlagThread");
|
||||
this.dataBufferFiles = dataBufferFiles;
|
||||
this.countDownLatch = countDownLatch;
|
||||
this.setDaemon(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ public class DataBufferThread extends Thread {
|
|||
|
||||
public DataBufferThread(int threadIdx) {
|
||||
super("DataBufferThread_" + threadIdx);
|
||||
this.setDaemon(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ public class PersistenceThread extends Thread {
|
|||
|
||||
public PersistenceThread(int trdIndex) {
|
||||
super("PersistentThread" + trdIndex);
|
||||
this.setDaemon(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public class AlarmRedisConnector {
|
|||
Config.Alarm.ALARM_OFF_FLAG = true;
|
||||
}
|
||||
}
|
||||
this.setDaemon(true);
|
||||
}
|
||||
|
||||
private RedisInspector connect() {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<!-- 添加注解驱动 -->
|
||||
<mvc:annotation-driven/>
|
||||
<!-- 默认扫描的包路径 -->
|
||||
<context:component-scan base-package="com.ai.cloud.skywalking.web"/>
|
||||
<context:component-scan base-package="com.a.eye.skywalking.web"/>
|
||||
|
||||
<mvc:resources mapping="/bower_components/**" location="/bower_components/"/>
|
||||
|
||||
|
|
@ -59,4 +59,4 @@
|
|||
<!-- 数据库、事务配置 -->
|
||||
<import resource="application-jdbc.xml"/>
|
||||
|
||||
</beans>
|
||||
</beans>
|
||||
|
|
|
|||
|
|
@ -243,6 +243,10 @@ INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_des
|
|||
INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('14', 'buffer.pool_size', '5', '5', 'Buffer池的最大长度', 'A');
|
||||
INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('15', 'senderchecker.check_polling_time', '200', '200', '发送检查线程检查周期', 'A');
|
||||
INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('16', 'skywalking.charset', 'UTF-8', 'UTF-8', 'skywalking数据编码', 'A');
|
||||
INSERT INTO `auth_file_config` (`config_id`,`key`,`value0`,`value1`,`value2`,`value3`,`value4`,`key_desc`,`sts`) VALUES ('17','plugin.customlocalmethodinterceptorplugin.is_enable','false','false',NULL,NULL,NULL,'自定义本地方法插件是否开启','A');
|
||||
INSERT INTO `auth_file_config` (`config_id`,`key`,`value0`,`value1`,`value2`,`value3`,`value4`,`key_desc`,`sts`) VALUES ('18','plugin.customlocalmethodinterceptorplugin.package_prefix','','',NULL,NULL,NULL,'自定义插件拦截的包前缀','A');
|
||||
INSERT INTO `auth_file_config` (`config_id`,`key`,`value0`,`value1`,`value2`,`value3`,`value4`,`key_desc`,`sts`) VALUES ('19','plugin.customlocalmethodinterceptorplugin.record_param_enable','false','false',NULL,NULL,NULL,'自定义插件是否记录入参',NULL);
|
||||
|
||||
|
||||
# alter table since 2016-4-8
|
||||
ALTER TABLE `application_info`
|
||||
|
|
|
|||
Loading…
Reference in New Issue