-
Notifications
You must be signed in to change notification settings - Fork 219
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
It would be nice if snakeviz worked. #6817
Comments
I can seem to run # tst.py
def fib(n):
if n <= 1:
return 1
return fib(n-1)+fib(n-2)
print(fib(10)) ~$ python -m cProfile -o program.prof tst.py
89
~$ snakeviz -s -H 0.0.0.0 -p 12345 program.prof
snakeviz web server started on 0.0.0.0:12345; enter Ctrl-C to exit
http://0.0.0.0:12345/snakeviz/%2Fhome%2Fuser%2Fprogram.prof I can open this on Not sure if this has something to do with HTTP vs HTTPS. (Link above to a CoCalc project demonstrating the issue for developers.) |
Can you set a base url for snakeviz? https://doc.cocalc.com/howto/webserver.html#using-the-port-proxy Note the big warning in https://doc.cocalc.com/howto/webserver.html#webserver-proxy |
Their cli options are:
so I guess it doesn't support setting a custom base url, unless there is an environment variable that it uses for that. |
My guess is that slightly changing this line https://github.com/jiffyclub/snakeviz/blob/master/snakeviz/main.py#L67 would be how to add a base url. But there would also be several other places where they explicitly hardcode /snakeviz, rather than /user/configurable/path/to/snakeviz, many of which you can see listed here: https://github.com/search?q=repo%3Ajiffyclub%2Fsnakeviz%20%2Fsnakeviz&type=code e.g., in snakeviz/templates/dir.html |
Thanks. I figured it was something like this. I will try patching SnakeViz and see if I can get this working. Once this is done, is there anything special that would be needed for getting it to working inline with CoCalc notebooks (i.e. along the lines of issues with ipywidgets etc.) or should that be straightforward and work too? |
Not exactly sure where the problem lies, but it would be very nice if snakeviz could work with CoCalc notebooks.
It is not currently installed, so needs to be installed:
Now it can be loaded as an extension...
... then used as a cell magic:
Currently this gives something like this:
Instead, it should display an interface like this:
Running this through the Classic Notebook server also fails. The following error appears in the JS console in both cases:
SnakeViz must be running a server and trying to place this in a frame. Any obvious way to make this work?
The text was updated successfully, but these errors were encountered: