GithubHelp home page GithubHelp logo

munhitsu / django-dowser Goto Github PK

View Code? Open in Web Editor NEW
92.0 5.0 29.0 157 KB

Django fork of amazing memory leaks tracking application for python wsgi - the Dowser

License: MIT License

Python 87.07% CSS 6.54% HTML 6.38%

django-dowser's Introduction

About

Based on: Dowser

A Django specific Dowser port.

Following enhancements have been implemented on top of the original Dowser:

  • long term historical analysis: 1m, 1h, 1d, 4w buffers
  • optimization by moving from lists to python deque
  • server load optimization by moving charts to google chart
  • only superuser can view the analysis (Django specific)
Screen shot

Screen shot

Future

  • move charts to javascript
  • move inline html to templates
  • drop Django 1.x and Python 2.x compatibility

Installation

# latest release
pip install django-dowser
# or latest master
pip install git+git://github.com/munhitsu/django-dowser.git

Next, modify project configuration.

settings.py

INSTALLED_APPS += ['django_dowser']

urls.py

from django.urls import path, include
urlpatterns += [url(r'^dowser/', include('django_dowser.urls'))]

Note

Use django-dowser only on multithreaded/gevent servers. With forking, or multiple servers, each process will have it's own Dowser storage, so you will only get a glimpse into one process and further requests may be load balanced to the other servers.

Usage

Start the project and open link:

http://domain/dowser/

When running in the local development mode, it is usually:

http://127.0.0.1:8000/dowser/

django-dowser's People

Contributors

dsjoerg avatar flisky avatar munhitsu avatar nailgun avatar symroe 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  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

django-dowser's Issues

Django 1.9 - 'WSGIRequest' object has no attribute 'REQUEST'

When running dowser on Django 1.9.5 I get:

Traceback (most recent call last):
File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 147, in get_response
response = wrapped_callback(request, _callback_args, *_callback_kwargs)
File "C:\Python27\lib\site-packages\django\contrib\auth\decorators.py", line 23, in _wrapped_view
return view_func(request, _args, *_kwargs)
File "C:\Python27\lib\site-packages\django_dowser\views.py", line 16, in index
floor = request.REQUEST.get('floor', 0)
AttributeError: 'WSGIRequest' object has no attribute 'REQUEST'

According to Django release notes see link
The WSGIRequest.REQUEST property is removed.

Error viewing trace

Not sure if this is dowser, or something on my end, but I'm getting an error when click trace: IOError: sys.stdout access restricted by mod_wsgi

SystemError: Objects/tupleobject.c:118: bad argument to internal function

After we installed django-dowser, we started to get strange errors:

Traceback (most recent call last):
  File "... site-packages/django/core/handlers/wsgi.py", line 
    from django.conf import settings
SystemError: Objects/tupleobject.c:118: bad argument to internal function

On devserver seems like everything is working fine, but when we use uwsgi - we get such error.

This error occurs after a second request to any page.

Not working in Django 1.3 because of bad import

django_dowser/urls.py:

name 'patterns' is not defined

This happens because of bad import: from django.conf.urls import * works without error but does not import patterns because it is in django.conf.urls.defaults.

Tested on django 1.3.7

Project still maintained?

Hi,

I'd like to know if this project is still being maintained; if so, I'd like to make it compatible with Python 3 (currently it's not, it uses Python 2 functions like iteritems or similar). Otherwise I'll fork it and release it with a different name, for Python 3 support.

Thanks!

redirection to the admin

Hi and thanks for the very nice project, I was trying to use it though but no luck so far, using Django 1.4.13.

I followed the instructions but every time I go to
http://localhost:8000/dowser/

my browser redirects automatically to (even after I'm logged in as admin):

http://localhost:8000/adminiu0Roojo/?next=/dowser/

I've also seen an error once

Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/andrea/.virtualenvs/depop_backend/lib/python2.7/site-packages/django_dowser/__init__.py", line 37, in start
    self.tick()
  File "/Users/andrea/.virtualenvs/depop_backend/lib/python2.7/site-packages/django_dowser/__init__.py", line 47, in tick
    typename = objtype.__module__ + "." + objtype.__name__
TypeError: unsupported operand type(s) for +: 'property' and 'str'

Which I guess depends on some unhandled type and I thought that this was the issue maybe, it still doesn't work even if I handle the exception.

Any ideas? Thanks

AttributeError: module 'sys' has no attribute 'getcheckinterval'. Did you mean: 'getswitchinterval'?

When trying to add urlpatterns += [url(r"^rest/dowser/", include("django_dowser.urls"))] , the following error occurs:

  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "urls.py", line 120, in <module>
    urlpatterns += [url(r"^rest/dowser/", include("django_dowser.urls"))]
  File ".venv/lib/python3.10/site-packages/django/urls/conf.py", line 34, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File ".venv/lib/python3.10/site-packages/django_dowser/urls.py", line 6, in <module>
    from . import views
  File ".venv/lib/python3.10/site-packages/django_dowser/views.py", line 111, in <module>
    type(sys.getcheckinterval),         # 'builtin_function_or_method'
AttributeError: module 'sys' has no attribute 'getcheckinterval'. Did you mean: 'getswitchinterval'?

I'm using Python 3.10 and it seems that sys.getcheckinterval was removed since Python 3.9

Release a new version on PyPI

The current PyPI version (0.1.4) is failing on recent Django versions. Would it be possible to make a release to fix 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.