Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SnakeViz integration #83

Closed
AgDude opened this issue Oct 29, 2015 · 6 comments
Closed

SnakeViz integration #83

AgDude opened this issue Oct 29, 2015 · 6 comments

Comments

@AgDude
Copy link

AgDude commented Oct 29, 2015

Does silk actually perform profiling? Or only log sql queries?

This is a nice looking project, and didn't take long to set up, but I didn't see anything I would call a profile, and don't see any screenshots of one in the readme. There is a nice log of all database queries, but when I hear about a profile in python, I think of something like this:
https://docs.python.org/2/library/profile.html

@AgDude
Copy link
Author

AgDude commented Oct 29, 2015

I decided to use http://jiffyclub.github.io/snakeviz/. If silk could be combined with snakeviz, so silk put the profile in the database, then somehow had a link for snakeviz to view it, that would be awesome. Clearly this would not be a trivial undertaking, snakeviz wants to read a file, and doesn't know anything about django models.

@mtford90
Copy link
Collaborator

@AgDude yep silk's profiling is limited to profiling time taken to execute blocks of code & num. database queries executed in that block of code and allows you to trace back those db queries to their origin. @JoshData contributed a cProfile integration a while back though, which sounds more like what you're wanting.

If you fancy contributing the snakeviz integration I'll happy add you to the django-silk org - this would be an awesome enhancement & i'd be around for any questions you may have wrt. the code base. Doubt I'll have time to implement this myself though - which you can probably tell by my awful response time :(

@mtford90 mtford90 changed the title Provide profiling example SnakeViz integration Nov 17, 2015
@hanleyhansen
Copy link
Member

When I add SILKY_PYTHON_PROFILER = True to my settings files I get a nice cProfile output in the Profiling tab under Python Profiling.

I copied that text and saved it in a .prof but when I run it through snakeviz i get the following error:

snakeviz: error: the file ~/Desktop/test1.prof is not a valid profile. Generate profiles using:
python -m cProfile -o my_program.prof my_program.py

Any ideas?

@avelis
Copy link
Collaborator

avelis commented Jul 22, 2016

@AgDude @hanleyhansen Was enhancement possibly pushed out in a recent release?

@hanleyhansen
Copy link
Member

Yes. The PR i submitted adds a download button to the Profiling page where you can download the binary .prof file and use it in snakeviz.

See: #123

That was merged and uploaded to pypi.

@avelis
Copy link
Collaborator

avelis commented Jul 28, 2016

@hanleyhansen Thanks for confirming with me. I will close this issue and say it was released in v0.6.0 as an exportable feature.

@avelis avelis closed this as completed Jul 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants