Log In | Sign Up   View a printable version of the current page.
  Dashboard > [fleXive] > ... > How-Tos > Load all content instances > Information > Page Comparison

Version 1 by Daniel Lichtenberger
on Dec 04, 2008 09:28.


 
compared with
Current by Daniel Lichtenberger
on Dec 04, 2008 15:31.

(show comment)
 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 1 changes. View first change.

 h2. How to load all content instances
  
 The following script loads all content instances of a flexive installation, and prints basic performance data (useful for basic performance tests):
  
 {code}long start = System.currentTimeMillis()
 int count = 0
 new com.flexive.shared.search.query.SqlQueryBuilder().select("@pk").result.resultRows.each { row ->
  println "Loaded instance " + com.flexive.shared.EJBLookup.contentEngine.load(row.getPk(1)).pk
  count++
 }
 long time = System.currentTimeMillis() - start
  "Loaded ${count} instances in ${time} ms (" + (time / count) + "ms/instance)"{code}
  "Loaded ${count} instances in ${time} ms (" + (time / count) + "ms/instance), " \
 + com.flexive.shared.CacheAdmin.instance.getChildrenNames("/FxContent").size() \
 + " cached content instances."{code}
Site running on a free Atlassian Confluence Open Source Project License granted to [fleXive] . Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.6.1 Build:#916 Nov 09, 2007) - Bug/feature request - Contact Administrators