Skip to main content

collective.catalogtrace

Log details about ZCatalog query performance

Features

Logs details about each ZCatalog query:

  • Query parameters
  • Where the query was called
  • Detailed execution:
    • Index name
    • Elapsed time
    • Count of persistent objects loaded
    • Count of new objects tracked by the Python GC

This information can be used to troubleshoot poor query performance.

There is some overhead to recording these measures.

Tracing is enabled for all queries if the TRACE_CATALOG_QUERIES environment variable is set.

Tracing can be enabled for specific requests by setting the catalogtrace cookie.

Example Output

2025-11-04 09:39:39,984 INFO    [collective.catalogtrace:111][waitress-2] Catalog query completed in 0.0570s
    Query parameters:
      { 'allowedRolesAndUsers': [ 'Anonymous',
                                  'Authenticated',
                                  'Manager',
                                  'user:admin'],
        'exclude_from_nav': False,
        'is_default_page': False,
        'path': {'depth': 1, 'query': '/Plone/de'},
        'portal_type': [ 'Document',
                         'Folder',
                         'Link' ],
        'sort_on': 'getObjPositionInParent',
        'sort_order': 'ascending'}
    Query from:
      File "/Users/davisagli/Work/dlr-internet/backend/.venv/lib/python3.12/site-packages/plone/volto/browser/navigation.py", line 84, in topLevelTabs
        rawresult = catalog.searchResults(query)
      File "/Users/davisagli/Work/dlr-internet/backend/.venv/lib/python3.12/site-packages/collective/solr/monkey.py", line 19, in searchResults
        return adapter(REQUEST, **kw)
      File "/Users/davisagli/Work/dlr-internet/backend/.venv/lib/python3.12/site-packages/collective/solr/dispatcher.py", line 40, in __call__
        return self.context._cs_old_searchResults(request, **keywords)
    Details:
      Step: path | Time: 0.0098s | Results: 89 | DB Objects: +0 | GC Objects: +7
      Step: is_default_page | Time: 0.0082s | Results: 89 | DB Objects: +0 | GC Objects: +14
      Step: portal_type | Time: 0.0085s | Results: 21 | DB Objects: +0 | GC Objects: +17
      Step: exclude_from_nav | Time: 0.0102s | Results: 6 | DB Objects: +0 | GC Objects: +7
      Step: allowedRolesAndUsers | Time: 0.0102s | Results: 6 | DB Objects: +0 | GC Objects: +6
      Step: sort_on#getObjPositionInParent#asc | Time: 0.0100s | Results: 6 | DB Objects: +0 | GC Objects: +17

Installation

Install collective.catalogtrace with pip:

pip install collective.catalogtrace

And to create the Plone site:

make create-site

Contribute

Prerequisites ✅

Installation 🔧

  1. Clone this repository, then change your working directory.

    git clone git@github.com:collective/collective.catalogtrace.git
    cd collective.catalogtrace
    
  2. Install this code base.

    make install
    

License

The project is licensed under GPLv2.

Credits and acknowledgements 🙏

Generated using Cookieplone (0.9.10) and cookieplone-templates (888ff69) on 2025-11-03 14:45:41.122916. A special thanks to all contributors and supporters!

Metadata

Release files for collective.catalogtrace 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.catalogtrace 1.0.3
File Size Uploaded Provenance Actions
collective_catalogtrace-1.0.3.tar.gz 16.6 kB Without provenance Details for collective_catalogtrace-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for collective.catalogtrace 1.0.3
File Interpreter ABI Platform Actions
collective_catalogtrace-1.0.3-py3-none-any.whl Python 3 none any Details for collective_catalogtrace-1.0.3-py3-none-any.whl

Total release size: 30.0 kB

Release files / collective_catalogtrace-1.0.3.tar.gz

Download URL collective_catalogtrace-1.0.3.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
de3150c92841b4408e4882068a5143e7174458e653455bc47c6c2f1a931682b5
BLAKE2b-256 checksum
How to use checksums
2daee28c66f844c44201ce6e74847251958e56070a16966d1b141bb348edd4a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / collective_catalogtrace-1.0.3-py3-none-any.whl

Download URL collective_catalogtrace-1.0.3-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac328e7061df90092af990fdaca5535cb7f300c6ad4b4c05d6bb92eab5271650
BLAKE2b-256 checksum
How to use checksums
6a3dc54cfe351c043515ef9526078dab2ab70425f43a8e4ea905d6caa0486b04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Security for collective.catalogtrace 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page