Giter Site home page Giter Site logo

amcfague / linesman Goto Github PK

View Code? Open in Web Editor NEW
108.0 108.0 16.0 1007 KB

Intelligent Profiling for Python WSGI Applications

Home Page: http://pypi.python.org/pypi/linesman

License: GNU General Public License v3.0

Python 80.31% JavaScript 6.04% CSS 13.66%

linesman's People

Contributors

amcfague avatar dahlia avatar gertburger avatar jjguy avatar peralta avatar simonsapin 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

linesman's Issues

Permanently delete filtered sessions button does not always from the right request to the backend.

Hello,

I have found linesman to be a very useful profiling tool for my wgsi app. I just want to point out a really minor issue with the UI. If a forward slash is not added to the end of the root name of the path the "permanently delete filtered session" button will not form the correct delete request. For example, when viewing the page in the browser with the url (http://host/**profiler**) the resulting delete url seen by the backend is (http://host/**profiler__delete) and nothing will be deleted from the database. If the page is viewed with the url (http://host/__profiler**/), everything works fine.

Keep up the awesome work!

Thanks,
Chris

Status?

Whats the status of this? Has this been replaced by something else?

Overall stats should be persisted

Currently, cProfile stats are converted to a native format to be used by Linesman and discarded. This is because the cProfile stats themselves contain lots of proprietary information that isn't used and can't safely be pickled--such as code.

However, because this is a tree, combining the two trees (and joining like nodes) is fairly trivial.

Add ability to filter based on mimetype and/or extension

Although the current session listing allows one to filter based on the URI (and thus, extension), it might be beneficial to do this at the profiler level. For example, images, CSS, and JavaScript, are just a few of the things that will be picked up by the profiler.

There should be an option to (a) filter by file extension, and (b) filter by mimetype, including wildcards. That is, application/* should block application/x-pdf, application/word, etc..

Editable Comments column on the __profiler__ page

Linesman Team,
Thanks for fixing the sort by timestamp bug !

I would like to reuest a comments column where I can make notes on what scenario I am profiling.
Often the URL is the same, the test data is what changes and there is no way to mark which result is for what.

Thanks much !
Anagha

Error when breaking cycles

I get an "Index out of range" error in linesman/middleware.py, line 441.

It is the breaking cycles code. You call the "simple_cycles" function from networkx, and it returns a list of lists with circuits of nodes. These lists could have just one element, and so the next code produces the error.

 u, v = cycle[0], cycle[1]

I've changed it to

u, v = cycle[0], cycle[-1]

and it works, but I don't know if it's semantically right.

thanks,
Leo

Investigate using linesman with Django

Currently, Django doesn't function using a server like paster, which means that introducing WSGI middleware requires using extraneous means. However, it does support using Django middleware, which means that it might still be able to support using the middleware using a Django-specific interface.

However, I will have to investigate using Django before being able to work on this bug.

Call graph can't be generated

I get this traceback:

2016-02-22 18:02:07,076 ERROR channel.py:339  service              | Exception when serving /__profiler__/graph/dcf6b404-d985-11e5-8382-005056221eef--968350.png
Traceback (most recent call last):
  File "/export/home/myuser/mysite/ve/lib/python2.7/site-packages/waitress/channel.py", line 336, in service
    task.service()
  File "/export/home/myuser/mysite/ve/lib/python2.7/site-packages/waitress/task.py", line 169, in service
    self.execute()
  File "/export/home/myuser/mysite/ve/lib/python2.7/site-packages/waitress/task.py", line 388, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/export/home/myuser/mysite/ve/lib/python2.7/site-packages/linesman/middleware.py", line 132, in __call__
    wsgi_app = self.render_graph(req)
  File "/export/home/myuser/mysite/ve/lib/python2.7/site-packages/linesman/middleware.py", line 244, in render_graph
    draw_graph(graph, path)
  File "/export/home/myuser/mysite/ve/lib/python2.7/site-packages/linesman/__init__.py", line 51, in draw_graph
    nx.to_agraph(graph).draw(output_path, prog="dot")
AttributeError: 'module' object has no attribute 'to_agraph'

Dependencies:

networkx==1.11
Pillow==3.1.1

The call graph is throwing ISE 500 on profile visit.

The call graph is throwing ISE 500 on profile visit.

The UI tries to pull the png from backend but the backend returns 500.

I have installed libcgraph6 graphviz graphviz-dev OS packages. I am using debian 8.
I have installed linesman using pip.

screen shot 2016-07-18 at 12 05 55 am

screen shot 2016-07-18 at 12 06 36 am

require help!!

Linesman doesn't work with Jython

There are several bits of linesman currently incompatible with Jython, such as with statements and pygraphviz. Solving this issue implies also solving issue #14.

Profile detail (graph) page is not available with IndexError

Error log

127.0.0.1 - - [28/Aug/2013 15:52:42] "GET /__profiler__/profiles/30f64b40-0fae-11e3-b925-c42c030096d3 HTTP/1.1" 500 -
Traceback (most recent call last):
  File "<path>/.env/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "<path>/.env/lib/python2.7/site-packages/linesman/middleware.py", line 136, in __call__
    wsgi_app = self.show_profile(req)
  File "<path>/.env/lib/python2.7/site-packages/linesman/middleware.py", line 312, in show_profile
    session._graph, cutoff_time, True)
  File "<path>/.env/lib/python2.7/site-packages/linesman/middleware.py", line 441, in prepare_graph
    u, v = cycle[0], cycle[1]
IndexError: list index out of range

environment:

  • OS X 10.8
  • graphviz with homebrew (graphviz: stable 2.32.0, devel 2.33.20130804.0447)

pip freeze:

Flask==0.10.1
linesman==0.3.1

Highlight row on mouseover

It would be convenient to have the row change color on mouseover. Otherise it can be difficult to determine which file on the left side corresponds to which call count/total time on the right side, especially on widescreen monitors.

Common interface design

Currently, the session listing is using some modified jQuery layouts, while the profile page is doing its own completely separate thing.

One option is to just use jQueryUI for everything--considering the session listing has this ability built in (thanks to DataTables), the only page that would require modification would be the profile page itself. This also opens up the possibility of dynamically switching layouts/color schemes.

Notification when graphviz is not installed

When accessing the profile page, a broken image is displayed if graphviz is not installed. Instead, a special "Please install graphviz" image/error message should be displayed instead.

Maximum Recursion Error on displaying a profile page

Hi

i get this error when i try to access a profile page.
Any ideas

This are my versions.
linesman = 0.3.1
pygraphviz = 1.2
pillow = 2.3.0
networkx = 1.7
mako = 0.9.1
MarkupSafe = 0.18

Exception happened during processing of request from ('127.0.0.1', 58244)
Traceback (most recent call last):
File "/Users/christian/.buildout/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 1068, in process_request_in_thread
self.finish_request(request, client_address)
File "/Users/christian/local/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Users/christian/local/lib/python2.7/SocketServer.py", line 639, in init
self.handle()
File "/Users/christian/.buildout/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 442, in handle
BaseHTTPRequestHandler.handle(self)
File "/Users/christian/local/lib/python2.7/BaseHTTPServer.py", line 343, in handle
self.handle_one_request()
File "/Users/christian/.buildout/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 437, in handle_one_request
self.wsgi_execute()
File "/Users/christian/.buildout/eggs/Paste-1.7.5.1-py2.7.egg/paste/httpserver.py", line 287, in wsgi_execute
self.wsgi_start_response)
File "/Users/christian/.buildout/eggs/linesman-0.3.1-py2.7.egg/linesman/middleware.py", line 136, in call
wsgi_app = self.show_profile(req)
File "/Users/christian/.buildout/eggs/linesman-0.3.1-py2.7.egg/linesman/middleware.py", line 316, in show_profile
resp.unicode_body = self.get_template('tree.tmpl').render_unicode(
File "/Users/christian/.buildout/eggs/Mako-0.9.1-py2.7.egg/mako/template.py", line 452, in render_unicode
as_unicode=True)
File "/Users/christian/.buildout/eggs/Mako-0.9.1-py2.7.egg/mako/runtime.py", line 807, in _render
**kwargs_for_callable(callable, data))
File "/Users/christian/.buildout/eggs/Mako-0.9.1-py2.7.egg/mako/runtime.py", line 839, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/Users/christian/.buildout/eggs/Mako-0.9.1-py2.7.egg/mako/runtime.py", line 865, in exec_template
callable
(context, _args, *_kwargs)
File "tree_tmpl", line 74, in render_body
File "tree_tmpl", line 25, in print_tree
File "tree_tmpl", line 159, in render_print_tree
File "tree_tmpl", line 118, in print_tree
File "tree_tmpl", line 159, in render_print_tree
File "tree_tmpl", line 118, in print_tree
File "tree_tmpl", line 159, in render_print_tree

Conflict with: filter-with = gzip

I have lots of HTML generated in internal web app (Pyramid), so I'm using filter-with = gzip. It seems that it conflicts with filter-with = linesman.

When I comment filter-with = gzip out, ".../profiler" page opens fine. Otherwise I get 404.

I'm using pserve (waitress) like so:

pserve development.ini --reload

Profiling without Paster?

Is it possible to use linesman without Paster? I'm just using uwsgi and my own wsgi.py without any frameworks. I don't see any uwsgi help options for injecting lineman in.

Not exactly sure how that works. Where would be a good spot for me to learn more?

Thank you!

Linesman should be able to run by itself

In preparation for allowing Linesman to support displaying profiles from different languages, Linesman may require the ability to host results in a stand-alone mode. This stand-alone mode would also require the ability to import profiling documents in a modular fashion, such that new importers could be written easily.

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.