我正在尝试调整PSI Probe中使用的代码(或更一般地说,PSI Probe的概念),以便在我公司的Web应用程序中使用。我可以获得我想要做的大部分内容,但是我已经陷入了一些代码 - “状态”选项卡。一列数据是线程的处理时间,我真的想要的数据,但我无法弄清楚它来自何处。这是相关的片段:
<c:forEach items="${pools}" var="pool" varStatus="poolStatus">
<div class="poolInfo">
<h3>${pool.name}</h3>
<div class="processorInfo">
<span class="name">
<spring:message code="probe.jsp.status.processor.maxTime"/>
</span>
${pool.maxTime}
我无法弄清pools
对象的来源!有没有人有这种经历?谢谢!
答案 0 :(得分:3)
查看源代码(这是Google代码,Google搜索工作非常快)
中填充池List pools = containerListenerBean.getThreadPools();
return new ModelAndView(getViewName())
.addObject("pools", pools);
显示status.jsp
<span class="name"><spring:message code="probe.jsp.status.currentThreadCount"/></span> ${pool.currentThreadCount}
<span class="name"><spring:message code="probe.jsp.status.currentThreadsBusy"/></span> ${pool.currentThreadsBusy}
<span class="name"><spring:message code="probe.jsp.status.maxThreads"/></span> ${pool.maxThreads}
<span class="name"><spring:message code="probe.jsp.status.maxSpareThreads"/></span> ${pool.maxSpareThreads}
<span class="name"><spring:message code="probe.jsp.status.minSpareThreads"/></span> ${pool.minSpareThreads}
正在getThreadPools()
方法
ThreadPool threadPool = new ThreadPool();
threadPool.setName(executorName.getKeyProperty("name"));
threadPool.setMaxThreads(JmxTools.getIntAttr(server, executorName, "maxThreads"));
threadPool.setMaxSpareThreads(JmxTools.getIntAttr(server, executorName, "largestPoolSize"));
threadPool.setMinSpareThreads(JmxTools.getIntAttr(server, executorName, "minSpareThreads"));
threadPool.setCurrentThreadsBusy(JmxTools.getIntAttr(server, executorName, "activeCount"));
threadPool.setCurrentThreadCount(JmxTools.getIntAttr(server, executorName, "poolSize"));
答案 1 :(得分:2)
一般来说,它可能来自两个地方。在JSP或Filter之前调用的Servlet。检查所有过滤器,并将servlet映射到您要打开的URL。