Skip to content

Commit

Permalink
Merge pull request #6 from uavorg/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
wanglinlin8 committed Dec 18, 2018
2 parents 52cc63a + 991ed36 commit 7668026
Show file tree
Hide file tree
Showing 425 changed files with 41,313 additions and 33,052 deletions.
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -34,8 +34,6 @@ uavstack is the All in One source repository of UAVStack.
* com.creditease.uav.jetty.plus.core: JVM MonitorFramework extension for Jetty
* com.creditease.uav.mock.sl4j: mock sl4j
* com.creditease.uav.ttl: com.alibaba.ttl source code introduction (Alibaba TTL)
* com.creditease.uav.monitorframework.buildFat: function test of JVM MonitorFramework)
* com.creditease.uav.monitorframework.springbootFat: function test of JVM MonitorFramework for Springboot)
* com.creditease.uav.agent.buildComponent: build POM for MonitorAgent
* com.creditease.uav.healthmanager.buildComponent: build POM for HealthManager
* com.creditease.uav.monitorframework.buildComponent: build POM for JVM MonitorFramework
Expand Down
2 changes: 0 additions & 2 deletions README中文版.md
Expand Up @@ -48,8 +48,6 @@ uavstack is the All in One source repository of UAVStack.
* com.creditease.uav.jetty.plus.core 探针MOF对Jetty支持 (JVM MonitorFramework extension for Jetty)
* com.creditease.uav.mock.sl4j 去除某些框架依赖sl4j (mock sl4j)
* com.creditease.uav.ttl com.alibaba.ttl源代码引入 (Alibaba TTL)
* com.creditease.uav.monitorframework.buildFat WAR测试程序 (Function Test of JVM MonitorFramework)
* com.creditease.uav.monitorframework.springbootFat SpringBoot测试程序 (Function Test of JVM MonitorFramework for springboot)
* com.creditease.uav.agent.buildComponent 制作监控代理程序部署包 (Build POM for MonitorAgent)
* com.creditease.uav.healthmanager.buildComponent 制作健康管理程序部署包 (Build POM for HealthManager)
* com.creditease.uav.monitorframework.buildComponent 制作探针MOF部署包 (Build POM for JVM MonitorFramework)
Expand Down
4 changes: 4 additions & 0 deletions com.creditease.uav.agent.buildComponent/bin/stop.sh
Expand Up @@ -2,6 +2,10 @@

# del crontab
process_flag=$1
if [ -z "$process_flag" ]; then
process_flag=uav_proc_watcher
fi

count=`crontab -l 2>/dev/null | grep "$process_flag" | wc -l`
if [ $count -ne 0 ]; then
cronfile=/tmp/$process_flag".tmp"
Expand Down
Expand Up @@ -127,6 +127,9 @@ public void handleClientOut(HeartBeatEvent data) {
}
ni.putInfo(InfoType.OS, "io.disk", str);

// netcard info, include name,ip,Bcast and Mask
ni.putInfo(InfoType.OS, "netcard", NetworkHelper.getNetCardInfo());

// java version
ni.putInfo(InfoType.OS, "java.ver", System.getProperty("java.version"));
// java vm name
Expand Down
Expand Up @@ -306,7 +306,7 @@ else if (profileName.contains("test")) {
sbf.append(" && sh start_upgrade.sh ");
}

sbf.append(upgrade_profile + " ").append(System.getProperty("NetCardIndex", "0")).append(" ");
sbf.append(upgrade_profile + " ");

if (JVMToolHelper.isWindows()) {
sbf.append(JSONHelper.toString(upgradeInfo).replace("\"", "'"));
Expand Down
7 changes: 6 additions & 1 deletion com.creditease.uav.agent/pom.xml
Expand Up @@ -37,7 +37,12 @@
<dependency>
<groupId>com.creditease.moniter</groupId>
<artifactId>com.creditease.uav.agent.heartbeat</artifactId>

<exclusions>
<exclusion>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.creditease.moniter</groupId>
Expand Down
Expand Up @@ -27,6 +27,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -121,6 +122,18 @@ public void run() {
}
}

// up to date SystemProperties
String getSysUrl = this.appServerInfo.getJVMAccessURL() + "jvm?action=getSystemPro";
String data = accessData(getSysUrl, null);
@SuppressWarnings("unchecked")
Map<String, String> p = JSONHelper.toObject(data, Map.class);

Properties sysPro = new Properties();
if (!p.isEmpty()) {
sysPro.putAll(p);
this.appServerInfo.setSystemProperties(sysPro);
}

// get all profile's MBean
MonitorDataFrame pmdf = new MonitorDataFrame(this.getWorkerId(), "P", timeFlag);
pmdf.addExt("pid", pid);
Expand Down Expand Up @@ -153,6 +166,9 @@ public void run() {
// if connect fails, try process detecting
doHealthReaction();
}
catch (Exception e) {
log.err(this, "up to date SystemProperties failed", e);
}
}

/**
Expand Down
Expand Up @@ -93,8 +93,8 @@ public void executeNCHttpTestcase() {

UAVHttpMessage request = new UAVHttpMessage();

String nceventKey = "127.0.0.1@notificationEvent@NotificaitonScheduleWorker@notifytestagent@-1172353146";
request.putRequest("ncevent", nceventKey);
String ntfkey = "127.0.0.1@notificationEvent@NotificaitonScheduleWorker@notifytestagent@-1172353146";
request.putRequest("ntfkey", ntfkey);
String content = JSONHelper.toString(request);
executeHttpCommand(url, content);
}
Expand Down
Expand Up @@ -67,6 +67,16 @@ public class NotificationEvent {
private String host;
private String ip;


/**
* Notification Event Level Tag
*
*/
public final static String EVENT_LEVEL_KEY = "notifyLevel";
public final static String INFO_NOTIFY_EVENT = "info";
public final static String WARN_NOTIFY_EVENT = "warn";
public final static String CRITICAL_NOTIFY_EVENT = "critical";

/**
* NotificationEvent的过滤字段(可选) 增加过滤字段可以提高Notification检索的准确性
*/
Expand Down
Expand Up @@ -900,6 +900,12 @@ private void getSpringMVCURLs(String springMVCBaseUrl, Map<String, Set<String>>
if (annoWebService != null) {

resourceClassRelativePaths = (List<String>) annoWebService.get("value");
/**
* NOTE: RequestMapping can setup a path by 'value' or 'path'
*/
if (resourceClassRelativePaths == null) {
resourceClassRelativePaths = (List<String>) annoWebService.get("path");
}
}

/**
Expand Down Expand Up @@ -935,13 +941,44 @@ private void getSpringMVCURLs(String springMVCBaseUrl, Map<String, Set<String>>
/**
* each method has Path info except only one
*/
if (methodAnnoInfo.containsKey("org.springframework.web.bind.annotation.RequestMapping")) {
if (methodAnnoInfo.containsKey("org.springframework.web.bind.annotation.RequestMapping")
|| methodAnnoInfo.containsKey("org.springframework.web.bind.annotation.PostMapping")
|| methodAnnoInfo.containsKey("org.springframework.web.bind.annotation.GetMapping")
|| methodAnnoInfo.containsKey("org.springframework.web.bind.annotation.PutMapping")
|| methodAnnoInfo.containsKey("org.springframework.web.bind.annotation.DeleteMapping")
|| methodAnnoInfo.containsKey("org.springframework.web.bind.annotation.PatchMapping")) {

Map<String, Object> pathAnnoInfo = (Map<String, Object>) methodAnnoInfo
.get("org.springframework.web.bind.annotation.RequestMapping");

if (pathAnnoInfo == null) {
pathAnnoInfo = (Map<String, Object>) methodAnnoInfo
.get("org.springframework.web.bind.annotation.PostMapping");
}
if (pathAnnoInfo == null) {
pathAnnoInfo = (Map<String, Object>) methodAnnoInfo
.get("org.springframework.web.bind.annotation.GetMapping");
}
if (pathAnnoInfo == null) {
pathAnnoInfo = (Map<String, Object>) methodAnnoInfo
.get("org.springframework.web.bind.annotation.PutMapping");
}
if (pathAnnoInfo == null) {
pathAnnoInfo = (Map<String, Object>) methodAnnoInfo
.get("org.springframework.web.bind.annotation.DeleteMapping");
}
if (pathAnnoInfo == null) {
pathAnnoInfo = (Map<String, Object>) methodAnnoInfo
.get("org.springframework.web.bind.annotation.PatchMapping");
}

List<String> methodRelativePaths = (List<String>) pathAnnoInfo.get("value");

// try to get info from filed 'path'
if (methodRelativePaths == null) {
methodRelativePaths = (List<String>) pathAnnoInfo.get("path");
}

// FIX NPE
if (methodRelativePaths == null) {
compServicesURLs.add(serviceURL);
Expand Down
Expand Up @@ -96,6 +96,7 @@ protected void handleMessage(HttpMessage message) {
/**
* step 2: run http handlers
*/
boolean dispatchFlag = false;
for (AbstractHttpHandler<T> handler : handlers) {

if (!path.equalsIgnoreCase(handler.getContextPath())) {
Expand All @@ -111,9 +112,16 @@ protected void handleMessage(HttpMessage message) {
e);
}

dispatchFlag = true;
break;
}

if (false == dispatchFlag) {
log.warn(this, "NO Matching Handler To Handle This REQUEST, for path: " + path);
message.putResponseBodyInString("NO Matching Handler To Handle This REQUEST, for IP: " + com.creditease.agent.helpers.NetworkHelper.getLocalIP() + ", and path: " + path, 404, "utf-8");
return;
}

/**
* step 3:
*/
Expand Down
Expand Up @@ -157,7 +157,7 @@ public AbstractHttpServiceComponent(String cName, String feature, String initHan
@Override
public void start(Executor executor, int port, int backlog) {

start(executor, port, backlog, false);
start(executor, port, backlog, true);

}

Expand All @@ -181,7 +181,7 @@ public void start(Executor executor, int port, int backlog, boolean forceExit) {
server = HttpServer.create(isa, backlog);

}
catch (IOException e) {
catch (Exception e) {

log.err(this, "HttpServiceComponent[" + this.cName + "] for feature[" + this.feature + "] starts FAIL.", e);

Expand Down
Expand Up @@ -328,13 +328,13 @@ public void start(int port, int backlog) {
@Override
public void start(int port, int backlog, int listenThreadCount, int handleThreadCount) {

start(port, backlog, listenThreadCount, handleThreadCount, false);
start(port, backlog, listenThreadCount, handleThreadCount, true);
}

@Override
public void start(Executor executor, int port, int backlog) {

start(executor, port, backlog, false);
start(executor, port, backlog, true);
}

@Override
Expand Down Expand Up @@ -373,7 +373,7 @@ public void start(int port, int backlog, int listenThreadCount, int handleThread
+ "] started SUCCESS: port=" + this.port);
}
}
catch (InterruptedException e) {
catch (Exception e) {
log.err(this, "HttpServiceComponent[" + this.cName + "] for feature[" + this.feature + "] starts FAIL.", e);

if (forceExit == true) {
Expand Down
@@ -1,4 +1,4 @@
app.title=基础集群管理
app.@eshead={"index":"1","title":"ES管理","file":"index.html"}
app.@jumpurl_1={"index":"2","title":"MQ管理","file":"jumpurl@http://uav.creditease.corp/rocket/cluster/list.do"}
app.@jumpurl_1={"index":"2","title":"MQ管理","file":"jumpurl@http://127.0.0.1:8080/rocket/cluster/list.do"}
app.@dbhead={"index":"3","title":"OpenTSDB管理","file":"index.html"}
Expand Up @@ -4326,7 +4326,7 @@
init: function(parent) {
this._super();
this.prefs = services.Preferences.instance();
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://uav.creditease.corp/apphub/es";
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://127.0.0.1:8080/apphub/es";
if( this.base_uri.charAt( this.base_uri.length - 1 ) !== "/" ) {
// XHR request fails if the URL is not ending with a "/"
this.base_uri += "/";
Expand Down
4 changes: 2 additions & 2 deletions com.creditease.uav.console.buildComponent/config/web_pro.xml
Expand Up @@ -174,7 +174,7 @@
<param-value>http://127.0.0.1:8044,http://127.0.0.1:8044</param-value>
</context-param>
<context-param>
<param-name>@url:uav.app.godeye.notify.view.http.addr</param-name>
<param-name>@url:uav.app.godeye.notify.update.http.addr</param-name>
<param-value>http://127.0.0.1:9011,http://127.0.0.1:9011</param-value>
</context-param>
<context-param>
Expand Down Expand Up @@ -231,7 +231,7 @@
</context-param>
<context-param>
<param-name>uav.apphub.sso.grafana.connection.info</param-name>
<param-value>{"api.url":"http://127.0.0.1:3000","web.url":"http://uav.creditease.corp/datacenter","datasource.opentsdb.url":"http://127.0.0.1:4242","datasource.elasticsearch.url":"http://127.0.0.1:9300","authorization.loginId":"apiuser","authorization.loginPwd":"Uav!630admin","authorization.register.defPwd":"1q@W3e","authorization.register.sleep.time":"2000"}</param-value>
<param-value>{"api.url":"http://127.0.0.1:3000","web.url":"http://127.0.0.1:8080/datacenter","datasource.opentsdb.url":"http://127.0.0.1:4242","datasource.elasticsearch.url":"http://127.0.0.1:9300","authorization.loginId":"apiuser","authorization.loginPwd":"Uav!630admin","authorization.register.defPwd":"1q@W3e","authorization.register.sleep.time":"2000"}</param-value>
</context-param>
<context-param>
<param-name>uav.apphub.sso.white.list</param-name>
Expand Down
Expand Up @@ -175,7 +175,7 @@
<param-value>http://127.0.0.1:8041,http://127.0.0.1:8041</param-value>
</context-param>
<context-param>
<param-name>@url:uav.app.godeye.notify.view.http.addr</param-name>
<param-name>@url:uav.app.godeye.notify.update.http.addr</param-name>
<param-value>http://127.0.0.1:9011,http://127.0.0.1:9011</param-value>
</context-param>
<context-param>
Expand Down
Expand Up @@ -45,7 +45,7 @@ private static GUISSOClient createGUISSOClient(HttpServletRequest request) {
String ClientImplClassName = request.getServletContext().getInitParameter("uav.apphub.sso.implclass");

if (StringHelper.isEmpty(ClientImplClassName)) {
ClientImplClassName = "com.creditease.uav.apphub.sso.GUISSOLdapClient";
ClientImplClassName = "com.creditease.uav.apphub.sso.GUISSOSimpleClient";
}

GUISSOClient GUISSOClientImpl = null;
Expand Down
@@ -0,0 +1,37 @@
package com.creditease.uav.apphub.sso;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

public class GUISSOSimpleClient extends GUISSOClient {

@SuppressWarnings("unused")
private GUISSOSimpleClient() {

}

protected GUISSOSimpleClient(HttpServletRequest request) {
super(request);
}

@Override
protected Map<String, String> getUserByLoginImpl(String loginId, String loginPwd) {
// TODO Auto-generated method stub
return null;
}

@Override
public List<Map<String, String>> getUserByQuery(String email) {
// TODO Auto-generated method stub
return null;
}

@Override
public Map<String, Object> getEmailListByQuery(String email) {
// TODO Auto-generated method stub
return null;
}

}

0 comments on commit 7668026

Please sign in to comment.