Created
July 28, 2020 13:36
-
-
Save klcodanr/127c39743256d58a663bb46c2e6d5311 to your computer and use it in GitHub Desktop.
Simple groovy script for use with ICF Groovy Console in AEM to diagnose timing issues in ReferenceProviders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.day.cq.wcm.api.reference.ReferenceProvider; | |
def providers = getServices(ReferenceProvider.class, null); | |
def resource = resourceResolver.getResource("[PUT_A_PATH_HERE]"); | |
providers.each{provider -> | |
out.println(""); | |
out.println(provider.class.toString()) | |
long start = System.currentTimeMillis(); | |
def results = provider.findReferences(resource); | |
out.println("Execution Time: ${System.currentTimeMillis() - start}"); | |
out.println("Results: ${results.size()}"); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment