You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2013/04/06 00:01:09 UTC
[7/8] Create T5Dashboard page
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/04bf4d86/tapestry-hibernate/src/main/resources/org/apache/tapestry5/hibernate/t5internal/pages/HibernateStatistics.properties
----------------------------------------------------------------------
diff --git a/tapestry-hibernate/src/main/resources/org/apache/tapestry5/hibernate/t5internal/pages/HibernateStatistics.properties b/tapestry-hibernate/src/main/resources/org/apache/tapestry5/hibernate/t5internal/pages/HibernateStatistics.properties
new file mode 100644
index 0000000..98cfb66
--- /dev/null
+++ b/tapestry-hibernate/src/main/resources/org/apache/tapestry5/hibernate/t5internal/pages/HibernateStatistics.properties
@@ -0,0 +1,15 @@
+# Copyright 2009, 2013 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+hibernate-statistics-hidden=Hibernate statistics are only available in development mode.
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/04bf4d86/tapestry-hibernate/src/main/resources/org/apache/tapestry5/hibernate/t5internal/pages/HibernateStatistics.tml
----------------------------------------------------------------------
diff --git a/tapestry-hibernate/src/main/resources/org/apache/tapestry5/hibernate/t5internal/pages/HibernateStatistics.tml b/tapestry-hibernate/src/main/resources/org/apache/tapestry5/hibernate/t5internal/pages/HibernateStatistics.tml
new file mode 100644
index 0000000..4cd9886
--- /dev/null
+++ b/tapestry-hibernate/src/main/resources/org/apache/tapestry5/hibernate/t5internal/pages/HibernateStatistics.tml
@@ -0,0 +1,69 @@
+<t:block id="content" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
+
+ <!-- TODO: Convert to a Bootstrap tab set -->
+
+ <t:unless test="productionMode">
+ <ul>
+ <li>
+ <a href="#EntitiesStatistics">
+ Entities Statistics
+ </a>
+ </li>
+ <li>
+ <a href="#CollectionStatistics">
+ Collection Statistics
+ </a>
+ </li>
+ <li>
+ <a href="#QueriesStatistics">Queries Statistics</a>
+ </li>
+ <li>
+ <a href="#SecondLevelCacheStatistics">
+ Second Level Cache Statistics
+ </a>
+ </li>
+ </ul>
+
+ <h1>Session Factory Statistics</h1>
+ <t:beandisplay object="statistics"/>
+
+ <a name="EntitiesStatistics"/>
+
+ <h1>Entities Statistics</h1>
+ <t:loop source="statistics.entityNames"
+ value="currentEntityName">
+ <h2>${currentEntityName}</h2>
+ <t:beandisplay object="entityStatistics"/>
+ </t:loop>
+
+ <a name="CollectionStatistics"/>
+
+ <h1>Collection Statistics</h1>
+ <t:loop source="statistics.collectionRoleNames"
+ value="currentCollectionRoleName">
+ <h2>${currentCollectionRoleName}</h2>
+ <t:beandisplay object="collectionStatistics"/>
+ </t:loop>
+
+ <a name="QueriesStatistics"/>
+
+ <h1>Queries Statistics</h1>
+ <t:loop source="statistics.queries" value="currentQuery">
+ <t:beandisplay object="queryStatistics"/>
+ </t:loop>
+
+ <a name="SecondLevelCacheStatistics"/>
+
+ <h1>Second Level Cache Statistics</h1>
+ <t:loop source="statistics.secondLevelCacheRegionNames"
+ value="currentSecondLevelCacheRegionName">
+ <t:beandisplay object="secondLevelCacheStatistics"/>
+ </t:loop>
+
+ <p:else>
+ <p>
+ <em>${message:hibernate-statistics-hidden}</em>
+ </p>
+ </p:else>
+ </t:unless>
+</t:block>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/04bf4d86/tapestry-hibernate/src/test/java/org/apache/tapestry5/hibernate/integration/TapestryHibernateIntegrationTests.java
----------------------------------------------------------------------
diff --git a/tapestry-hibernate/src/test/java/org/apache/tapestry5/hibernate/integration/TapestryHibernateIntegrationTests.java b/tapestry-hibernate/src/test/java/org/apache/tapestry5/hibernate/integration/TapestryHibernateIntegrationTests.java
index 06f4418..ada61bf 100644
--- a/tapestry-hibernate/src/test/java/org/apache/tapestry5/hibernate/integration/TapestryHibernateIntegrationTests.java
+++ b/tapestry-hibernate/src/test/java/org/apache/tapestry5/hibernate/integration/TapestryHibernateIntegrationTests.java
@@ -1,4 +1,4 @@
-// Copyright 2008, 2012 The Apache Software Foundation
+// Copyright 2008, 2012, 2013 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -147,9 +147,7 @@ public class TapestryHibernateIntegrationTests extends SeleniumTestCase
public void hibernate_statistics()
{
- open(getBaseURL() + "hibernate/Statistics");
-
- assertTextPresent("Hibernate Statistics");
+ open(getBaseURL() + "t5dashboard/hibernate");
assertTextPresent("Entities Statistics");