Changeset 176
- Timestamp:
- 02/22/06 11:06:10
- Files:
-
- trunk/calendar3/calCore/resources/hbms/Category.hbm.xml (modified) (2 diffs)
- trunk/calendar3/calCore/resources/hbms/Event.hbm.xml (modified) (1 diff)
- trunk/calendar3/calCore/resources/hbms/Location.hbm.xml (modified) (2 diffs)
- trunk/calendar3/calCore/resources/hbms/Sponsor.hbm.xml (modified) (2 diffs)
- trunk/calendar3/calCore/resources/properties/ehcache.xml (modified) (2 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java (modified) (3 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/DbStatistics.java (added)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwEventProperty.java (modified) (3 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwStats.java (modified) (4 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/base/CalintfBase.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/Calintf.java (modified) (2 diffs)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java (modified) (1 diff)
- trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java (modified) (1 diff)
- trunk/calendar3/docs/todo.txt (modified) (2 diffs)
- trunk/calendar3/webclient/war/WEB-INF/struts-config.xml (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/misc/StatisticsAction.java (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/calCore/resources/hbms/Category.hbm.xml
r2 r176 11 11 <class name="org.bedework.calfacade.BwCategory" 12 12 table="categories"> 13 <cache usage="read-write"/> 14 13 15 <id name="id" type="integer" column="categoryid" unsaved-value="-1"> 14 16 <generator class="native"/> … … 41 43 </property> 42 44 <property name="description" column="description" type="text"/> 43 44 <set name="events" table="event_categories"45 lazy="true"46 inverse="true"47 cascade="all" >48 <key column="categoryid"/>49 <many-to-many class="org.bedework.calfacade.BwEventObj"50 column="eventid"/>51 </set>52 45 </class> 53 46 trunk/calendar3/calCore/resources/hbms/Event.hbm.xml
r48 r176 133 133 <set name="categories" table="event_categories" 134 134 lazy="true" > 135 <cache usage="read-write"/> 135 136 <key column="eventid"/> 136 137 <many-to-many class="org.bedework.calfacade.BwCategory" trunk/calendar3/calCore/resources/hbms/Location.hbm.xml
r2 r176 11 11 <class name="org.bedework.calfacade.BwLocation" 12 12 table="locations"> 13 <cache usage="read-write"/> 14 13 15 <id name="id" type="integer" column="entityid" unsaved-value="-1"> 14 16 <generator class="native"/> … … 41 43 <property name="subaddress" column="subaddress" type="string"/> 42 44 <property name="link" column="link" type="string"/> 43 44 <set name="events"45 lazy="true"46 inverse="true"47 cascade="all" >48 <key column="locationid"/>49 <one-to-many class="org.bedework.calfacade.BwEventObj" />50 </set>51 45 </class> 52 46 trunk/calendar3/calCore/resources/hbms/Sponsor.hbm.xml
r2 r176 11 11 <class name="org.bedework.calfacade.BwSponsor" 12 12 table="sponsors"> 13 <cache usage="read-write"/> 14 13 15 <id name="id" type="integer" column="entityid" unsaved-value="-1"> 14 16 <generator class="native"/> … … 42 44 <property name="email" column="email" type="string"/> 43 45 <property name="link" column="link" type="string"/> 44 45 <set name="events"46 lazy="true"47 inverse="true" >48 <key column="sponsorid"/>49 <one-to-many class="org.bedework.calfacade.BwEventObj" />50 </set>51 46 </class> 52 47 trunk/calendar3/calCore/resources/properties/ehcache.xml
r2 r176 75 75 /> 76 76 77 <!-- Subscription cache - these change infrequently and we should be able to cache all entries 78 in use 77 <!-- categories cache - these change infrequently 79 78 --> 80 <cache name="org.bedework.calfacade.svc.BwSubscription" 79 <cache name="org.bedework.calfacade.BwCategory" 80 maxElementsInMemory="10000" 81 eternal="false" 82 timeToIdleSeconds="300" 83 timeToLiveSeconds="600" 84 overflowToDisk="true" 85 /> 86 87 <!-- event.categories cache - these change infrequently 88 --> 89 <cache name="org.bedework.calfacade.BwEventObj.categories" 90 maxElementsInMemory="10000" 91 eternal="false" 92 timeToIdleSeconds="300" 93 timeToLiveSeconds="600" 94 overflowToDisk="true" 95 /> 96 97 <!-- locations cache - these change infrequently 98 --> 99 <cache name="org.bedework.calfacade.BwLocation" 100 maxElementsInMemory="10000" 101 eternal="false" 102 timeToIdleSeconds="300" 103 timeToLiveSeconds="600" 104 overflowToDisk="true" 105 /> 106 107 <!-- sponsors cache - these change infrequently 108 --> 109 <cache name="org.bedework.calfacade.BwSponsor" 81 110 maxElementsInMemory="10000" 82 111 eternal="false" … … 113 142 /> 114 143 144 <!-- Subscription cache - these change infrequently and we should be able to cache all entries 145 in use 146 --> 147 <cache name="org.bedework.calfacade.svc.BwSubscription" 148 maxElementsInMemory="10000" 149 eternal="false" 150 timeToIdleSeconds="300" 151 timeToLiveSeconds="600" 152 overflowToDisk="true" 153 /> 154 115 155 <!-- users cache - these change infrequently but are referenced frequently, usually many 116 156 times a query. 117 157 --> 118 158 119 <cache name="org.bedework.calfacade.BwUser s"159 <cache name="org.bedework.calfacade.BwUser" 120 160 maxElementsInMemory="10000" 121 161 eternal="false" trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java
r164 r176 93 93 94 94 import org.hibernate.cfg.Configuration; 95 import org.hibernate.stat.Statistics; 95 96 import org.hibernate.SessionFactory; 96 97 … … 202 203 */ 203 204 private static SessionFactory sessFactory; 205 private static Statistics dbStats; 204 206 205 207 static { … … 339 341 } 340 342 343 public void setStats(boolean enable) throws CalFacadeException { 344 if (!enable && (dbStats == null)) { 345 return; 346 } 347 348 if (dbStats == null) { 349 dbStats = sessFactory.getStatistics(); 350 } 351 352 dbStats.setStatisticsEnabled(enable); 353 } 354 355 public void dumpStats() throws CalFacadeException { 356 DbStatistics.dumpStats(dbStats); 357 } 358 341 359 public BwSystem getSyspars() throws CalFacadeException { 342 360 if (syspars == null) { trunk/calendar3/calFacade/src/org/bedework/calfacade/BwEventProperty.java
r2 r176 56 56 import org.bedework.calfacade.base.BwShareableDbentity; 57 57 58 import java.util.Set;59 60 58 /** Base for those classes that can be a property of an event and are all 61 59 * treated in the same manner, being Category, Location and Sponsor. … … 68 66 */ 69 67 public class BwEventProperty extends BwShareableDbentity { 70 /** Events referencing this entity71 */72 protected Set events;73 74 68 /** Constructor 75 69 * … … 92 86 super(owner, publick, creator, access); 93 87 } 94 95 /** Set the events - must be a set of BwEvent96 *97 * @param val Set of EventVO98 */99 public void setEvents(Set val) {100 events = val;101 }102 103 /** Get the events104 *105 * @return Set of BwEvent106 */107 public Set getEvents() {108 return events;109 }110 88 } trunk/calendar3/calFacade/src/org/bedework/calfacade/BwStats.java
r2 r176 69 69 70 70 protected int tzStores; 71 72 protected double eventFetchTime; 73 74 protected long eventFetches; 71 75 72 76 /** … … 91 95 } 92 96 97 /** 98 * @return double event fetch millis. 99 */ 100 public double getEventFetchTime() { 101 return eventFetchTime; 102 } 103 104 /** 105 * @return long event fetches. 106 */ 107 public long getEventFetches() { 108 return eventFetches; 109 } 110 93 111 public String toString() { 94 112 StringBuffer sb = new StringBuffer(); … … 98 116 format(sb, "systemTzFetches: ", getSystemTzFetches()); 99 117 format(sb, "tzStores: ", getTzStores()); 118 119 format(sb, "event fetch time: ", getEventFetchTime()); 120 format(sb, "event fetches: ", getEventFetches()); 100 121 101 122 return sb.toString(); … … 116 137 } 117 138 139 private void format(StringBuffer sb, String name, double val) { 140 pad(sb, name, maxnamepad); 141 sb.append(": "); 142 pad(sb, String.valueOf(val), maxvalpad); 143 sb.append("\n"); 144 } 145 118 146 private void format(StringBuffer sb, String name, int val) { 119 147 pad(sb, name, maxnamepad); trunk/calendar3/calFacade/src/org/bedework/calfacade/base/CalintfBase.java
r162 r176 169 169 } 170 170 171 public void setStats(boolean enable) throws CalFacadeException { 172 } 173 174 public void dumpStats() throws CalFacadeException { 175 } 176 171 177 public BwSystem getSyspars() throws CalFacadeException { 172 178 return null; trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/Calintf.java
r99 r176 114 114 boolean debug) throws CalFacadeException; 115 115 116 /** Get the current s tats116 /** Get the current system (not db) stats 117 117 * 118 118 * @return BwStats object … … 120 120 */ 121 121 public BwStats getStats() throws CalFacadeException; 122 123 /** Enable/disable db statistics 124 * 125 * @param enable boolean true to turn on db statistics collection 126 * @throws CalFacadeException if not admin 127 */ 128 public void setStats(boolean enable) throws CalFacadeException; 129 130 /** Dump db statistics 131 * 132 * @throws CalFacadeException if not admin 133 */ 134 public void dumpStats() throws CalFacadeException; 122 135 123 136 /** Get the system pars trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java
r163 r176 324 324 325 325 public BwStats getStats() throws CalFacadeException { 326 if (!pars.getPublicAdmin()) {327 throw new CalFacadeAccessException();328 }326 //if (!pars.getPublicAdmin()) { 327 // throw new CalFacadeAccessException(); 328 //} 329 329 330 330 return getCal().getStats(); 331 } 332 333 public void setStats(boolean enable) throws CalFacadeException { 334 //if (!pars.getPublicAdmin()) { 335 // throw new CalFacadeAccessException(); 336 //} 337 338 getCal().setStats(enable); 339 } 340 341 public void dumpStats() throws CalFacadeException { 342 //if (!pars.getPublicAdmin()) { 343 // throw new CalFacadeAccessException(); 344 //} 345 346 trace(getStats().toString()); 347 getCal().dumpStats(); 331 348 } 332 349 trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java
r119 r176 114 114 public abstract BwStats getStats() throws CalFacadeException; 115 115 116 /** Enable/disable db statistics 117 * 118 * @param enable boolean true to turn on db statistics collection 119 * @throws CalFacadeException if not admin 120 */ 121 public abstract void setStats(boolean enable) throws CalFacadeException; 122 123 /** Dump db statistics 124 * 125 * @throws CalFacadeException if not admin 126 */ 127 public abstract void dumpStats() throws CalFacadeException; 128 116 129 /** Get the system pars 117 130 * trunk/calendar3/docs/todo.txt
r173 r176 1 1 Todo 2 2 3 -------------------------------------------------------------------------------- 4 Lost the exrules from the recurrence info hbm - add them 3 5 -------------------------------------------------------------------------------- 4 6 Installing webtest … … 22 24 Same url - eg week tab still causes fetch of events 23 25 -------------------------------------------------------------------------------- 26 Watch for same event appearing in different calendars through ref. 24 27 -------------------------------------------------------------------------------- 25 28 2.3.2 dump needs to dump filters before events. trunk/calendar3/webclient/war/WEB-INF/struts-config.xml
r111 r176 308 308 </action> 309 309 310 <action path="/stats" 311 type="org.bedework.webcommon.misc.StatisticsAction" 312 name="calForm" 313 scope="session" 314 validate="false"> 315 </action> 316 310 317 <action path="/manageLocations" 311 318 type="org.bedework.webclient.BwAction"
