Uploaded image for project: 'Content Types'
  1. Content Types
  2. MGNLCT-407

Expose the number of items in content apps for monitoring

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 2.0.0
    • None
    • Yes

      Questions for discovery

      • How to measure? JCR queries don't provide aggregation functions. Iterating of a result set or the items of the workspace is likely not efficient and adds to much load to the instance. One way is a JCR query:
        QueryResult result = queryManager.createQuery("SELECT * FROM [nt:base]", Query.JCR_SQL2).execute();
        long nodeCount = result.getRows().getSize(); 

        However, this might still have an impact on the instance as it collects all results into a list internally in Jackrabbit.

      • Can and should we track this number separately. Risk of getting out of sync?

      Discovery notes

      • We could look up the WorkspaceStats MBean from info.magnolia.types.datasource.jcr.JackrabbitInitializer#initialize and set the node type attribute for the workspace. Both are available from the ContentTypeDefinition.
      • The approach with looking up a WorkspaceStatsConfigurer instance via the service loader cannot be used since the name of the workspace is only known at the time the module starts.

        Acceptance criteria

              mduerig Michael Duerig
              mduerig Michael Duerig
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Work Started: