Skip to main content

Dozer

https://github.com/mgedmin/dozer/actions/workflows/build.yml/badge.svg?branch=master https://ci.appveyor.com/api/projects/status/github/mgedmin/dozer?branch=master&svg=true https://coveralls.io/repos/mgedmin/dozer/badge.svg?branch=master

Dozer was originally a WSGI middleware version of Robert Brewer’s Dowser CherryPy tool that displays information as collected by the gc module to assist in tracking down memory leaks. It now also has middleware for profiling and for looking at logged messages.

Tracking down memory leaks

Usage:

from dozer import Dozer

# my_wsgi_app is a WSGI application
wsgi_app = Dozer(my_wsgi_app)

Assuming you’re serving your application on the localhost at port 5000, you can then load up http://localhost:5000/_dozer/index to view the gc info.

Profiling requests

Usage:

from tempfile import mkdtemp
from dozer import Profiler

# my_wsgi_app is a WSGI application
wsgi_app = Profiler(my_wsgi_app, profile_path=mkdtemp(prefix='dozer-'))

Assuming you’re serving your application on the localhost at port 5000, you can then load up http://localhost:5000/_profiler to view the list of recorded request profiles.

The profiles are stored in the directory specified via profile_path. If you want to keep seeing older profiles after restarting the web app, specify a fixed directory instead of generating a fresh empty new one with tempfile.mkdtemp. Make sure the directory is not world-writable, as the profiles are stored as insecure Python pickles, which allow arbitrary command execution during load.

Here’s a blog post by Marius Gedminas that contains a longer description of Dozer’s profiler.

Inspecting log messages

Usage:

from dozer import Logview

# my_wsgi_app is a WSGI application
wsgi_app = Logview(my_wsgi_app)

Every text/html page served by your application will get some HTML and Javascript injected into the response body listing all logging messages produced by the thread that generated this response.

Here’s a blog post by Marius Gedminas that contains a longer description of Dozer’s logview.

Dozer Changelog

0.9 (November 7, 2025)

  • Add support for Python 3.10, 3.11, 3.12, 3.13, and 3.14.

  • Drop support for Python 2.7, 3.6, 3.7, 3.8, and 3.9.

  • Stop using the cgi module (which wasn’t really being used).

  • Possibly fix a bug where unbound methods were not being filtered out properly in memory leak reports.

0.8 (November 13, 2020)

  • Add support for Python 3.8 and 3.9.

  • Drop support for Python 3.5.

  • Add UI input for existing “floor” query string parameter (https://github.com/mgedmin/dozer/issues/2)

  • Add UI input to filter type charts by a regular expression

  • Add sorting option: monotonicity

  • Display traceback on 500 Internal Server Error

  • Dicts and sets with unsortable keys are no longer unrepresentable

  • Aggregate dynamically-created types with the same __name__ and __module__ (issue 9).

0.7 (April 23, 2019)

  • Add support for Python 3.7.

  • Drop support for Python 3.3 and 3.4.

  • Stop using cgi.escape on Python 3, which is especially important now that it’s been removed from Python 3.8.

0.6 (May 18, 2017)

  • Add support for Python 3.6.

  • Drop support for Python 2.6.

  • Fix rare TypeError when listing profiles, if two profiles happen to have the exact same timestamp (https://github.com/mgedmin/dozer/pull/4).

0.5 (December 2, 2015)

  • Make /_dozer show the index page (instead of an internal server error).

  • Add support for Python 3.4 and 3.5.

  • Drop support for Python 2.5.

  • Move to GitHub.

0.4 (March 21, 2013)

  • 100% test coverage.

  • Add support for Python 3.2 or newer.

  • Drop dependency on Paste.

0.3.2 (February 10, 2013)

0.3.1 (February 6, 2013)

0.3 (December 13, 2012)

  • Emit the “PIL is not installed” only if the Dozer middleware is actually used.

  • Give a name to the Dozer memleak thread.

  • You can now supply a function directly to Logview(stack_formatter=fn)

  • New configuration option for Logview middleware: tb_formatter, similar to stack_formatter, but for exception tracebacks.

0.2 (December 5, 2012)

  • Adding logview that appends log events for the current request to the bottom of the html output for html requests.

  • Adding profiler for request profiling and call tree viewing.

  • Refactored Dozer into its own leak package.

  • New maintainer: Marius Gedminas.

0.1 (June 14, 2008)

  • Initial public release, port from Dowser, a CherryPy tool.

Metadata

Release files for Dozer 0.9

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

Source distribution (sdist)

Source distribution for Dozer 0.9
File Size Uploaded
dozer-0.9.tar.gz 88.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Dozer 0.9
File Interpreter ABI Platform
dozer-0.9-py3-none-any.whl Python 3 none any Details

Total release size: 180.6 kB

Release files / dozer-0.9.tar.gz

Download URL dozer-0.9.tar.gz
Size 88.6 kB
Tags Source
SHA-256 checksum
How to use checksums
65fc27bf6ae5f642be14211c94e19c21c04e7c0572612a479ce6834fb25b5976
BLAKE2b-256 checksum
How to use checksums
5636eff9638fa2d1af5268d288ae105b1ef72cef181572b17edffdb60be67679
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / dozer-0.9-py3-none-any.whl

Download URL dozer-0.9-py3-none-any.whl
Size 92.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef2b15e0dd9b1eca0b59989ec842ae8f418a57e2a2823223cdcee3cfe56d3ebc
BLAKE2b-256 checksum
How to use checksums
706ee01c55b7224ef1bbedb724bd714c1ab113441270ded4d1fb01bb73c22a74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.9 This release

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3

1 release file

0.2

1 release file

0.1

2 release files

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