#weaver-njpmsreport-3# 查询条件部门查询增加包含子部门的数据
parent
b79c52f0f7
commit
2bf175bd82
@ -0,0 +1,24 @@
|
||||
server.port=9896
|
||||
spring.application.name=weaver-secondev-service
|
||||
#dubbo.mvc.static-path-pattern=/**
|
||||
#dubbo.resources.static-locations=classpath:/ecode/,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/
|
||||
http.filter.exclusions=/health/*
|
||||
weaver.permission.module-type=SECONDEV
|
||||
weaver.secondev.localFile.enabled=n
|
||||
weaver.secondev.release.dir=
|
||||
weaver.secondev.component.scan.packages=com.weaver,cn.eteams.wechat
|
||||
#weaver.ecode.resource.ext=png,js,css,jpg,jpeg,gif
|
||||
weaver.secondev.cas.path=/api/**
|
||||
weaver.secondev.cas.whiteList=/papi/**,/sapi/**,/api/**
|
||||
weaver.secondev.token.timeout=1800
|
||||
weaver.secondev.token.refresh.timeout=7200
|
||||
weaver.swagger.basePackage=com.weaver.ecode
|
||||
#logging.level.com.weaver=debug
|
||||
#weaver.mybatis-plus.monitor-sql.info=true
|
||||
|
||||
spring.jackson.serialization.write-dates-as-timestamps=true
|
||||
spring.jackson.default-property-inclusion=NON_NULL
|
||||
spring.jackson.deserialization.READ_UNKNOWN_ENUM_VALUES_AS_NULL=true
|
||||
|
||||
# dubbo.protocol.port= 6677
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
||||
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
|
||||
|
||||
</beans>
|
@ -0,0 +1,93 @@
|
||||
<%@ page trimDirectiveWhitespaces="true" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
||||
<%@page import="java.util.*" %>
|
||||
<%@page import="org.springframework.web.context.support.*" %>
|
||||
<%@page import="org.springframework.context.*" %>
|
||||
<%@ page import="com.alibaba.druid.pool.DruidDataSource" %>
|
||||
<%@ page import="org.springframework.beans.BeansException" %>
|
||||
<%@ page import="java.lang.management.ManagementFactory" %>
|
||||
<%@ page import="java.lang.management.ThreadMXBean" %>
|
||||
<%@ page import="java.sql.*" %>
|
||||
<%@ page import="org.slf4j.Logger" %>
|
||||
<%@ page import="org.slf4j.LoggerFactory" %>
|
||||
<%@ page import="javax.management.MBeanServer" %>
|
||||
<%@ page import="javax.management.ObjectName" %>
|
||||
<%@ page import="javax.management.Query" %>
|
||||
|
||||
<%
|
||||
Map<String, String> result = new HashMap<String, String>();//返回结果
|
||||
Logger logger = LoggerFactory.getLogger("health.jsp");
|
||||
try {
|
||||
ApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(request.getServletContext());
|
||||
|
||||
/*内存状态 begin*/
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
long maxMemory = runtime.maxMemory()/(1024 * 1024);
|
||||
long totalMemory = runtime.totalMemory() / (1024 * 1024);
|
||||
long freeMemory = runtime.freeMemory() / (1024 * 1024);
|
||||
long memoryFreeRate = 100 * (maxMemory - totalMemory + freeMemory) / maxMemory;
|
||||
result.put("maxMemory", maxMemory + "M");
|
||||
result.put("totalMemory", totalMemory + "M");
|
||||
result.put("freeMemory", freeMemory + "M");
|
||||
result.put("memoryFreeRate", memoryFreeRate + "");
|
||||
/*内存状态 end*/
|
||||
|
||||
/*数据库连接测试 begin*/
|
||||
try {
|
||||
DruidDataSource druidDataSource = (DruidDataSource) applicationContext.getBean("dataSource");
|
||||
int activeConnectCount = druidDataSource.getActiveCount();
|
||||
int maxActive = druidDataSource.getMaxActive();
|
||||
int poolConnectCountIdleRate = 100 * (maxActive-activeConnectCount) / maxActive;
|
||||
result.put("activeConnectCount", activeConnectCount + "");
|
||||
result.put("maxActive", maxActive + "");
|
||||
result.put("poolConnectCountIdleRate", poolConnectCountIdleRate + "");
|
||||
//获得连接是否成功信息
|
||||
Connection connection = null;
|
||||
PreparedStatement ps = null;
|
||||
ResultSet rs = null;
|
||||
boolean databaseConnectStatus = true;
|
||||
try {
|
||||
connection = druidDataSource.getConnection();
|
||||
String sql = "select 1";
|
||||
ps = connection.prepareStatement(sql);
|
||||
rs = ps.executeQuery();
|
||||
} catch (Exception e) {
|
||||
databaseConnectStatus = false;
|
||||
} finally {
|
||||
if(rs!=null && !rs.isClosed()){
|
||||
rs.close();
|
||||
}
|
||||
if(ps!=null && !ps.isClosed()){
|
||||
ps.close();
|
||||
}
|
||||
if(connection!=null && !connection.isClosed()){
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
result.put("databaseConnectStatus", databaseConnectStatus + "");
|
||||
} catch (BeansException e) {
|
||||
result.put("databaseMap", "NONE");
|
||||
}
|
||||
/*数据库连接测试 end*/
|
||||
|
||||
/*应用的主线程活跃数监控 begin*/
|
||||
ThreadMXBean threadBean = ManagementFactory.getThreadMXBean();
|
||||
int threadCount = threadBean.getThreadCount();
|
||||
result.put("threadCount",threadCount + "");
|
||||
/*应用的主线程活跃数监控 end*/
|
||||
} catch (Exception e) {
|
||||
result.put("error", e.getMessage());
|
||||
}
|
||||
|
||||
result.put("abc", "abc");
|
||||
MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer();
|
||||
Set<ObjectName> objectNames = beanServer.queryNames(new ObjectName("*:type=Connector,*"), Query.match(Query.attr("protocol"), Query.value("HTTP/1.1")));
|
||||
String port = ((ObjectName) objectNames.iterator().next()).getKeyProperty("port");
|
||||
try {
|
||||
result.put("tomcat_port",port);
|
||||
} catch (Exception e) {
|
||||
logger.error(e+":"+ Arrays.toString(e.getStackTrace()));
|
||||
}
|
||||
|
||||
String resultStr = com.alibaba.druid.support.json.JSONUtils.toJSONString(result);
|
||||
response.getWriter().write(resultStr);
|
||||
%>
|
Loading…
Reference in New Issue