Appliscale / xprof

A visual tracer and profiler for Erlang and Elixir.
Other
276 stars 33 forks source link

Consider a separate "GUI mode" for elixir #22

Closed ppikula closed 7 years ago

ppikula commented 7 years ago

Right now to trace an elixir function one needs to put 'Elixir.sth.sth':fun/1 into the search box. I'd say this is Elixir unfriendly. I don't know if it is hard but maybe we could "fork" our GUI. Whenever xprof detects that is running in the Elixir env(I guess it is possible by looking if some Elixir apps are loaded), it could serve GUI which is translated & optimised for Elixir.

afronski commented 7 years ago

Very good idea! 👍

I'd not to do the fork of the UI, but rather the UI mode (which can be enabled / disabled).

My proposal is to do the following:

UI

We can introduce a small icon, representing detected language - by default it will be Erlang and in that way we will define filtering. When we detect Elixir (see below how) we can switch to different mode. This icon will be a button which will be able to switch if you want to use Erlang syntax in Elixir.

IMHO this make sense, because effectively Elixir apps runs inside the Erlang environment.

Detection

It is relatively easy, because we can sniff applications or MFA available to trace (which we're listing). Ideally you could sniff application elixir or search for Elixir specific modules like 'Elixir.Enum'.

Transformation

That is an open discussion which I want to start - we can do it either on front-end or back-end. I'm voting for first one, I'd try to argument why:

  1. This enables switching and makes it much easier, because it will not introduce any state on the back-end, this will be a purely client-side option.
  2. One feature of xprof which is nice is sharing the same UI / view with others that will open app e.g. remotely - question is do we want to share the mode too - if no, there is no other way of doing it than client-side.
ppikula commented 7 years ago

I feel convinced to doing this on the UI side. I think, the mode won't be switched very frequently, at least I can't see why would I want to do this on the daily basis. You have my axe!

gomoripeti commented 7 years ago

I would argue for the server side (I've taken steps in https://github.com/Appliscale/xprof/pull/16 to remove erlang function syntax specific regexes from the UI)

what are the erlang/elixir specific components and how they could be handled by UI to be mode agnostic:

drawbacks of server side implementation:

afronski commented 7 years ago

It looks like you've convinced me, @gomoripeti. 😉

It makes more sense now for me to have it on back-end, even if we need to introduce state on the server. Especially part with having on back-end side parsers / engines.

It looks like you have full plan for it and it is related with your work on match specifications - will you be able to tackle this one too?

gomoripeti commented 7 years ago

😄 I think we have a decision now

There are multiple steps: (and I could probably do with some help )

afronski commented 7 years ago

Great @gomoripeti, this looks complete for me.

For 3rd task please keep in mind that in Elixir you can call Erlang modules with :atom.fun/arity, so colon need to be included in module name.