%--
- $Revision: 27964 $
- $Date: 2006-03-02 09:27:01 -0800 (Thu, 02 Mar 2006) $
-
- Copyright (C) 1999-2004 Jive Software. All rights reserved.
- This software is the proprietary information of Jive Software. Use is subject to license terms.
--%>
<%@ page import="java.text.*"
errorPage="error.jsp"
%>
<%@ page import="org.jivesoftware.database.DbConnectionManager"%>
<%@ page import="org.jivesoftware.util.JiveGlobals"%>
<%@ page import="org.jivesoftware.database.ProfiledConnection"%>
<%@ page import="org.jivesoftware.database.ProfiledConnectionEntry"%>
<%@ page import="org.jivesoftware.util.ParamUtils"%>
<%@ page import="org.jivesoftware.util.LocaleUtils"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<%! // Global methods, vars
// Default refresh values
static final int[] REFRESHES = {10,30,60,90};
%>
<%
// Get parameters
boolean doClear = request.getParameter("doClear") != null;
String enableStats = ParamUtils.getParameter(request,"enableStats");
int refresh = ParamUtils.getIntParameter(request,"refresh", -1);
boolean doSortByTime = ParamUtils.getBooleanParameter(request,"doSortByTime");
// Var for the alternating colors
int rowColor = 0;
// Clear the statistics
if (doClear) {
ProfiledConnection.resetStatistics();
// Reload the page without params.
response.sendRedirect("server-db-stats.jsp");
}
// Enable/disable stats
if ("true".equals(enableStats)) {
DbConnectionManager.setProfilingEnabled(true);
}
else if ("false".equals(enableStats)) {
DbConnectionManager.setProfilingEnabled(false);
}
boolean showQueryStats = DbConnectionManager.isProfilingEnabled();
// Number intFormat for pretty printing of large number values and decimals:
NumberFormat intFormat = NumberFormat.getInstance(JiveGlobals.getLocale());
DecimalFormat decFormat = new DecimalFormat("#,##0.00");
%>
<% if (showQueryStats) { %>