Giter Club home page Giter Club logo

dozer's Introduction

Dozer

https://github.com/mgedmin/dozer/workflows/build/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's People

Contributors

bbangert avatar ianb avatar mgedmin avatar mizhi avatar paxcodes avatar saaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dozer's Issues

Allow securing with Basic auth

While you're probably not supported to run this in production or in public servers, sometimes that would be just convenient.

Securing with Basic auth wouldn't probably be too big a task, but should do the job and doesn't require a session.

Would this be viable?

Graphs fail to appear due to "Cannot render; PIL/Pillow is not installed"

After following the instructions on:
https://github.com/mgedmin/dozer#tracking-down-memory-leaks
...and navigating to:
.../_dozer/index

The graphs for each object appear with the broken image icon. Viewing an image manually shows the error:
"Cannot render; PIL/Pillow is not installed"

It would be great if setup.py referenced either one of these packages, causing it to be automatically installed (albeit they rely on system packages, so likely still require manual steps), or if the README at least mentioned the need to install them :-)

"need profile_path"

Followed README for profiler

from dozer import Profiler

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

App just crashes with

assert profile_path, "need profile_path"
AssertionError: need profile_path

But there doesn't seem to be any info on what profile_path is supposed to be or how to set it?

Non-deterministic test failure in test_count_objects

This looks like a non-deterministic test failure:

======================================================================
FAIL: test_count_objects (dozer.tests.test_reftree.TestGlobals)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/mgedmin/dozer/dozer/tests/test_reftree.py", line 61, in test_count_objects
    self.assertTrue((1, MyObj) in res)
AssertionError: False is not true

-- https://travis-ci.org/mgedmin/dozer/jobs/192265786

Support sort by growth

I'm workign with a large project which includes thousands of classes that they can't be easily located with floor or filter. I think it's possible to define a index that indicates how the object count was growing, then sort on that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.