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
Adding process tracing #165
Adding process tracing #165
Conversation
@jonatanklosko the current implementation discards the result of the function given to trace and I don't like that. We could instead return
WDYT? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing @akoutmos! I have added only some minor final comments!
Do you want me to remove all receive events and just have send events?
Yes, I think we can remove them all. :)
Co-authored-by: José Valim <jose.valim@gmail.com>
…os/kino into add_process_tracing_visualization
Co-authored-by: José Valim <jose.valim@gmail.com>
…os/kino into add_process_tracing_visualization
Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: José Valim <jose.valim@gmail.com>
…os/kino into add_process_tracing_visualization
Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: José Valim <jose.valim@gmail.com>
Thanks for the review @josevalim! Really appreciate it. I reworked the exception handling a little so that the call to the tracer GenServer was not part of the trace capture. I also need to rework that last reduce to handle the scenario when a process is started prior to the trace, but terminated during the trace. Mermaid throws an error if you attempt to deactivate an actor without it being activated prior. After that I think it is good to go :). Thanks! |
Co-authored-by: José Valim <jose.valim@gmail.com>
Co-authored-by: José Valim <jose.valim@gmail.com>
You can also do nested trys. The nesting is uglier but less code duplication and perhaps easier to understand? try do
try do
fun.()
after
stop_trace
end
get_trace_events
after
GenServer.stop
end |
It has been done :) |
I fixed that last issue that was on my TODO list and switched the PR from draft to ready. Let me know if there are any other issues I should address. I think the only open question at the moment is whether the result is kept from the trace function? |
I will let you know soon. I also just realized that we could name the current process as |
Hi @akoutmos, let's please change this one to return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akoutmos fantastic!!
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
Thanks @jonatanklosko! |
That sounds good to me @josevalim :). I think I implemented it as you described in 9a5b965. Let me know what you think! |
💚 💙 💜 💛 ❤️ |
Thanks for the review and the help @josevalim and @jonatanklosko! Happy to see this merged in :) |
This PR implements #159
Continuing the discussion from that issue:
At the moment I have the bar starting when a process is spawned and stopped when it exits (both of which have to be present during the trace in order for the bar to appear). In other words, it doesn't look like Mermaid renders anything unless there is both an actor activate and deactivate. That and it doesn't look like we can start bars at arbitrary points on the sequence. Rather it looks like they have to start and stop on events. All this to say, I think if we want to keep the bars, they'll only be present when a process starts and stops during the trace.
I'll have to explore this a bit more. I tried setting up a pop up Actor Menu as described in the docs...but the menu never popped up lol.
I think the Mermaid diagrams only allow for horizontal lines and cannot be linked back to another event. Do you want me to remove all receive events and just have send events? Or only in certain circumstances? Here is an example with no receives for reference:
It has been done! I also added that to the example code :).
I have a couple more things that I need to clean up and fix so I am opening this up as a draft PR. Should have those wrapped up during the weekend :). Thanks in advance for the review and have a great weekend!