amcfague / linesman Goto Github PK
View Code? Open in Web Editor NEWIntelligent Profiling for Python WSGI Applications
Home Page: http://pypi.python.org/pypi/linesman
License: GNU General Public License v3.0
Intelligent Profiling for Python WSGI Applications
Home Page: http://pypi.python.org/pypi/linesman
License: GNU General Public License v3.0
This would make it much more palatable to have linesman available on deployed servers, since the extra load hit could be enabled as needed, rather than all the time.
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
By default linesman will used the total accumulated time in a function, regardless of call count. We should have the option to use the average call length instead which has less use cases but still would be good.
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.
Given a list of packages (such as ['os', 'sys']
), show these in a pie chart. Unlisted packages should be displayed as a combined tab.
Linesman should be able to sit atop any profiling that produces stack info. For example Java, C++, etc. So the backend piece should be plugin based with the initial Python cProfile as the first one.
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.
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.
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.
Add the ability to (1) clear all stored sessions, and (2) delete specific sessions.
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
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
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
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.
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.
There are several bits of linesman currently incompatible with Jython, such as with
statements and pygraphviz. Solving this issue implies also solving issue #14.
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
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:
pip freeze:
Flask==0.10.1
linesman==0.3.1
Whats the status of this? Has this been replaced by something else?
Hi,
Is there any way we can relax the constraint to networkx=1.7 for linesman? We are using the latest version of networkx (1.11)
Thanks
Carlos
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!
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..
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.