Closed simonmcconnell closed 2 years ago
@TheFirstAvenger do we know if eflambe
works on Windows or not?
@bcardarella I have no reason to think it wouldn't work on windows, as far as I know it is pure Erlang.
@simonmcconnell Thanks for the report! I believe I had seen a similar error message referencing {:not_mocked, :cowboy_handler}
during development when I ran flame on a few times in a row and it hadn't cleaned up correctly. I reasoned that the flow that triggered it was something like meck.load, meck.load, meck.unload, meck.unload. If the second meck.load was a noop and the second meck.unload found it not mecked due to the first unload clearing it, it would account for the error. The other thing that might be happening is that two calls could be starting to trace, and the clean up trace message is being fired twice, however we definitely used eFlambe under heavy load on a client project, so I don't think it should be this.
Are you getting this error message every single time you try to run Flame On, or have you been successful in running it at all?
Could you try clean-booting the phoenix server and trying a profile, making sure to only run flame on once and then load a single page, and see if that works?
Additionally, can you check for a folder named flame_on_delete_me
on a server where you attempted this and see if there is a .bggg file in it?
I tried it three times and the only thing I was doing was starting the flame and then loading a page.
I noticed an empty folder of that name after I gave up.
I have an inkling that the creation and removing of the folder/files might be what's causing the Surface compiler to crash 🤷.
@simonmcconnell to see if this is an environment thing or something specific to your project, could you try creating a new web app and running a capture?
mix archive.install hex phx_new
mix phx.new flamegraphs --no-ecto
and add the dependency and dashboard page, and see if it works with a basic project?
@TheFirstAvenger works on the fresh install.
@simonmcconnell Assuming you aren't able to share the project publicly, can you try taking the generated page from the working project and drop it in your project and see if you can profile that page in your project?
@TheFirstAvenger no sorry I can't share the project. I tried adding Surface to the fresh Phoenix project and I get the error when I try to run the graph, regardless of whether I load a dead or live view.
@simonmcconnell can you push that fresh project that is failing so I can try and reproduce it?
@TheFirstAvenger I tell a lie, it is not Surface specifically. I tried a simple live view and it throws the same error.
@simonmcconnell I tried both main
and no-surface
and was able to generate a flame graph on both. I just released 0.3.0
that should fix the {:not_mocked, :cowboy_handler}
error you were seeing. Could you retry no-surface
on your end with 0.3.0
and see if it works and if not, what error messages you get?
@simonmcconnell I am going to close this for now. If you find that 0.3.0+ does't resolve your issue, please reply and let me know.
I tried to run the flame on the default
cowboy_handler
/execute
/2
but it crashed on the following:This is running as
iex.bat -S mix phx.server
on Windows 11 with...I tried calling it on the
mount/3
function of a LiveView and it errored on: