mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge branch 'master' of https://github.com/zhouhaibin/druid
Conflicts: src/main/java/com/alibaba/druid/support/http/StatViewServlet.java
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.alibaba.druid.support.http;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -36,6 +38,7 @@ public class StatViewServlet extends HttpServlet {
|
||||
private static JSONDruidStatService jsonDruidStatService = JSONDruidStatService.getInstance();
|
||||
|
||||
public String templatePage;
|
||||
private static DateFormat format = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss:SSS");
|
||||
|
||||
public void init() throws ServletException {
|
||||
try {
|
||||
@@ -121,9 +124,29 @@ public class StatViewServlet extends HttpServlet {
|
||||
content.append("</textarea><br />");
|
||||
content.append("<p>API:com.alibaba.druid.sql.SQLUtils.format(sql,DBType);</p>");
|
||||
content.append("<br />");
|
||||
<<<<<<< HEAD
|
||||
|
||||
List<SQLStatement> statementList = SQLUtils.parseStatements((String) sqlStat.get("SQL"),
|
||||
(String) sqlStat.get("DbType"));
|
||||
=======
|
||||
|
||||
if (sqlStat.getLastSlowParameters() != null && sqlStat.getLastSlowParameters().trim().length() > 0) {
|
||||
content.append("<h2>LastSlow SQL View:</h2>");
|
||||
content.append("<table cellpadding='5' cellspacing='1' width='99%'>");
|
||||
content.append("<tr>");
|
||||
content.append("<td class='td_lable' width='130'>MaxTimespanOccurTime</td>");
|
||||
content.append("<td>" + format.format(sqlStat.getExecuteNanoSpanMaxOccurTime()) + "</td>");
|
||||
content.append("</tr>");
|
||||
content.append("<tr>");
|
||||
content.append("<td class='td_lable' width='130'>LastSlowParameters</td>");
|
||||
content.append("<td>" + sqlStat.getLastSlowParameters() + "</td>");
|
||||
content.append("</tr>");
|
||||
content.append("</table>");
|
||||
content.append("<br />");
|
||||
}
|
||||
|
||||
List<SQLStatement> statementList = SQLUtils.parseStatements(sqlStat.getSql(), sqlStat.getDbType());
|
||||
>>>>>>> e5365eae94e50a7b51cd1d1ab2ed0cd029738eb4
|
||||
if (!statementList.isEmpty()) {
|
||||
content.append("<h2>Parse View:</h2>");
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ReflectionUtils {
|
||||
try {
|
||||
result = HttpServletRequest.class.getClassLoader().loadClass(className);
|
||||
} catch (ClassNotFoundException e) {
|
||||
LOG.warn(e.getMessage(), e);
|
||||
if (LOG.isDebugEnabled()) LOG.debug(e.getMessage(), e);
|
||||
}
|
||||
if (result == null) {
|
||||
try {
|
||||
@@ -33,7 +33,6 @@ public class ReflectionUtils {
|
||||
}
|
||||
|
||||
public static Object callStaticMethod(Class<?> classObject, String methodName) {
|
||||
|
||||
try {
|
||||
Method m = classObject.getMethod(methodName);
|
||||
return m.invoke(classObject);
|
||||
|
||||
Reference in New Issue
Block a user