<%-- * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software * Foundation. * * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html * or from the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. --%> <%@ page import="java.text.DecimalFormat" %> <%@ page import="org.pentaho.platform.repository.hibernate.HibernateUtil" %> <%@ page import="org.hibernate.SessionFactory" %> <% SessionFactory _hibSessionFactory = HibernateUtil.getSessionFactory(); %> <% String regionNames[] = _hibSessionFactory.getStatistics().getSecondLevelCacheRegionNames(); int totalItemsInMemory = 0; int totalItemsOnDisk = 0; float totalSizeInMemory = 0; DecimalFormat df = new DecimalFormat("#,##0.#"); for (int i=0;i <% if (_hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getHitCount() > 0) { %> <% } else { %> <% } float sizeInMemory = _hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getSizeInMemory(); totalItemsInMemory+=_hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getElementCountInMemory(); totalItemsOnDisk+=_hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getElementCountOnDisk(); totalSizeInMemory+=sizeInMemory; %> <% } } %> <% if (_hibSessionFactory.getStatistics().getSecondLevelCacheHitCount() > 0) { %> <% } else { %> <% } %> <% if (_hibSessionFactory.getStatistics().getQueryCacheHitCount() > 0) { %> <% } else { %> <% } %> <% if (_hibSessionFactory.getStatistics().getSecondLevelCacheHitCount() + _hibSessionFactory.getStatistics().getQueryCacheHitCount() > 0) { %> <% } else { %> <% } %>
Region Name Cache Puts Cache Hits Cache Misses Cache Hit % Elements in Memory Memory Used Elements on Disk
<%= regionNames[i] %> <%= _hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getPutCount() %> <%= _hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getHitCount() %> <%= _hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getMissCount() %><%= (int)(((float)_hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getHitCount() / (float)(_hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getHitCount() + _hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getMissCount())) * 100) + "%" %><%= "0%" %><%= _hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getElementCountInMemory() %> <%= df.format(sizeInMemory/1024) + "k" %> <%= _hibSessionFactory.getStatistics().getSecondLevelCacheStatistics(regionNames[i]).getElementCountOnDisk() %>
Second Level Cache Totals <%= _hibSessionFactory.getStatistics().getSecondLevelCachePutCount() %> <%= _hibSessionFactory.getStatistics().getSecondLevelCacheHitCount() %> <%= _hibSessionFactory.getStatistics().getSecondLevelCacheMissCount() %><%= (int)(((float)_hibSessionFactory.getStatistics().getSecondLevelCacheHitCount() / (float)(_hibSessionFactory.getStatistics().getSecondLevelCacheHitCount() + _hibSessionFactory.getStatistics().getSecondLevelCacheMissCount())) * 100) + "%" %><%= "0%" %>- - -
Query Cache Totals <%= _hibSessionFactory.getStatistics().getQueryCachePutCount() %> <%= _hibSessionFactory.getStatistics().getQueryCacheHitCount() %> <%= _hibSessionFactory.getStatistics().getQueryCacheMissCount() %><%= (int)(((float)_hibSessionFactory.getStatistics().getQueryCacheHitCount() / (float)(_hibSessionFactory.getStatistics().getQueryCacheHitCount() + _hibSessionFactory.getStatistics().getQueryCacheMissCount())) * 100) + "%" %><%= "0%" %>- - -
Grand Totals <%= _hibSessionFactory.getStatistics().getSecondLevelCachePutCount() + _hibSessionFactory.getStatistics().getQueryCachePutCount() %> <%= _hibSessionFactory.getStatistics().getSecondLevelCacheHitCount() + _hibSessionFactory.getStatistics().getQueryCacheHitCount() %> <%= _hibSessionFactory.getStatistics().getSecondLevelCacheMissCount() + _hibSessionFactory.getStatistics().getQueryCacheMissCount() %><%= (int)(((float)(_hibSessionFactory.getStatistics().getSecondLevelCacheHitCount() + _hibSessionFactory.getStatistics().getQueryCacheHitCount()) / (float)(_hibSessionFactory.getStatistics().getSecondLevelCacheHitCount() + _hibSessionFactory.getStatistics().getQueryCacheHitCount() + _hibSessionFactory.getStatistics().getSecondLevelCacheMissCount() + _hibSessionFactory.getStatistics().getQueryCacheMissCount())) * 100) + "%" %><%= "0%" %><%= totalItemsInMemory %> <%= df.format(totalSizeInMemory/1024) + "k" %> <%= totalItemsOnDisk %>