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

Added by Daniel Lichtenberger, last edited by Markus Plesser on Nov 28, 2011  (view change) show comment
Labels: 
(None)

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):

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), " \
+ com.flexive.shared.CacheAdmin.instance.getChildrenNames("/FxContent").size() \
+ " cached content instances."
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