Skip to content

Commit

Permalink
Add session timeout to server info page and export diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-adam committed Jan 24, 2024
1 parent 215d872 commit 5fa29c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions api/src/org/labkey/api/admin/AdminBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.labkey.api.security.UserManager;
import org.labkey.api.settings.AppProps;
import org.labkey.api.util.DateUtil;
import org.labkey.api.util.Formats;
import org.labkey.api.util.HtmlString;
import org.labkey.api.util.HtmlStringBuilder;
import org.labkey.api.util.MothershipReport;
Expand Down Expand Up @@ -77,6 +78,7 @@ public static class RecentUser
public static final String serverGuid = AppProps.getInstance().getServerGUID();
public static final String serverSessionGuid = AppProps.getInstance().getServerSessionGUID();
public static final String servletContainer = ModuleLoader.getServletContext().getServerInfo();
public static final String sessionTimeout = Formats.commaf0.format(ModuleLoader.getServletContext().getSessionTimeout());
@SuppressWarnings("unused") // Available substitution property, not used directly in code
public static final String buildTime = ModuleLoader.getInstance().getCoreModule().getBuildTime();
@SuppressWarnings("unused") // Available substitution property, not used directly in code
Expand Down
18 changes: 11 additions & 7 deletions core/src/org/labkey/core/admin/admin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,31 @@
<%@ page import="org.labkey.api.admin.AdminBean" %>
<%@ page import="org.labkey.api.data.DbScope" %>
<%@ page import="org.labkey.api.data.SqlSelector" %>
<%@ page import="org.labkey.api.files.FileContentService" %>
<%@ page import="org.labkey.api.module.DefaultModule" %>
<%@ page import="org.labkey.api.module.Module" %>
<%@ page import="org.labkey.api.moduleeditor.api.ModuleEditorService" %>
<%@ page import="org.labkey.api.settings.AdminConsole" %>
<%@ page import="org.labkey.api.settings.AdminConsole.AdminLink" %>
<%@ page import="org.labkey.api.settings.AdminConsole.SettingsLinkType" %>
<%@ page import="org.labkey.api.settings.AppProps" %>
<%@ page import="org.labkey.api.util.HtmlString" %>
<%@ page import="org.labkey.api.util.Formats" %>
<%@ page import="org.labkey.api.util.HtmlString"%>
<%@ page import="org.labkey.api.view.NavTree" %>
<%@ page import="org.labkey.core.admin.AdminController"%>
<%@ page import="org.labkey.core.admin.AdminController" %>
<%@ page import="java.text.DecimalFormat" %>
<%@ page import="java.time.Duration" %>
<%@ page import="java.time.LocalDateTime" %>
<%@ page import="java.time.format.DateTimeFormatter" %>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.TreeMap" %>
<%@ page import="org.labkey.api.files.FileContentService" %>
<%@ page extends="org.labkey.api.jsp.JspBase" %>
<%@ taglib prefix="labkey" uri="http://www.labkey.org/taglib" %>
<%
boolean devMode = AppProps.getInstance().isDevMode();
int row = 0;
DecimalFormat df = Formats.commaf0;
%>
<style type="text/css">
body { overflow-y: scroll; }
Expand Down Expand Up @@ -76,10 +79,10 @@
<tr class="<%=getShadeRowClass(row++)%>"><td>JDBC Driver Name</td><td id="databaseDriverName"><%=h(AdminBean.scope.getDriverName())%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>JDBC Driver Version</td><td id="databaseDriverVersion"><%=h(AdminBean.scope.getDriverVersion())%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>JDBC Driver Location</td><td id="databaseDriverLocation"><%=h(AdminBean.scope.getDriverLocation())%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Connection Pool Max Size</td><td id="connectionPoolSize"><%=h(AdminBean.scope.getDataSourceProperties().getMaxTotal())%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Connection Pool Active</td><td id="connectionPoolActive"><%=h(AdminBean.scope.getDataSourceProperties().getNumActive())%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Connection Pool Idle</td><td id="connectionPoolIdle"><%=h(AdminBean.scope.getDataSourceProperties().getNumIdle())%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Connection Max Wait (ms)</td><td id="connectionPoolMaxWait"><%=h(AdminBean.scope.getDataSourceProperties().getMaxWaitMillis())%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Connection Pool Max Size</td><td id="connectionPoolSize"><%=h(df.format(AdminBean.scope.getDataSourceProperties().getMaxTotal()))%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Connection Pool Active</td><td id="connectionPoolActive"><%=h(df.format(AdminBean.scope.getDataSourceProperties().getNumActive()))%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Connection Pool Idle</td><td id="connectionPoolIdle"><%=h(df.format(AdminBean.scope.getDataSourceProperties().getNumIdle()))%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Connection Max Wait (ms)</td><td id="connectionPoolMaxWait"><%=h(df.format(AdminBean.scope.getDataSourceProperties().getMaxWaitMillis()))%></td></tr>
</table>
<br/>
<%
Expand All @@ -101,6 +104,7 @@
<tr class="<%=getShadeRowClass(row++)%>"><td>Mode</td><td><%=h(AdminBean.mode)%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Asserts</td><td><%=h(AdminBean.asserts)%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Servlet Container</td><td><%=h(AdminBean.servletContainer)%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Session Timeout (minutes)</td><td><%=h(AdminBean.sessionTimeout)%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Java Runtime Vendor</td><td><%=h(AdminBean.javaVendor)%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Java Runtime Name</td><td><%=h(AdminBean.javaRuntimeName)%></td></tr>
<tr class="<%=getShadeRowClass(row++)%>"><td>Java Runtime Version</td><td><%=h(AdminBean.javaVersion)%></td></tr>
Expand Down

0 comments on commit 5fa29c2

Please sign in to comment.